From 02a033df7a5ebf356d59eeabab1a37ca175e8b5b Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Mon, 17 Dec 2018 10:36:02 +0200 Subject: [PATCH] btrfs: Remove not_found_em label from btrfs_get_extent In order to avoid duplicating init code for em there is an additional label, not_found_em, which is used to only set ->block_start. The only case when it will be used is if the extent we are adding overlaps with an existing extent. Make that case more obvious by: 1. Adding a comment hinting at what's going on 2. Assigning EXTENT_MAP_HOLE and directly going to insert. No functional changes. Reviewed-by: Johannes Thumshirn Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/inode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c6fc283164b8..4a0da2d7758b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6858,10 +6858,13 @@ next: goto not_found; if (start > found_key.offset) goto next; + + /* New extent overlaps with existing one */ em->start = start; em->orig_start = start; em->len = found_key.offset - start; - goto not_found_em; + em->block_start = EXTENT_MAP_HOLE; + goto insert; } btrfs_extent_item_to_extent_map(inode, path, item, @@ -6921,7 +6924,6 @@ not_found: em->start = start; em->orig_start = start; em->len = len; -not_found_em: em->block_start = EXTENT_MAP_HOLE; insert: btrfs_release_path(path); -- 2.30.2