diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-12-17 03:36:02 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-02-25 08:13:22 -0500 |
commit | 02a033df7a5ebf356d59eeabab1a37ca175e8b5b (patch) | |
tree | 7cfe0fe17e7bdcb3669c7c2eaed38e676fa33d39 /fs/btrfs | |
parent | b8eeab7fced20169f5d8b4e3894e9e470fdf01ef (diff) |
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 <jthumshirn@suse.de>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 6 |
1 files 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: | |||
6858 | goto not_found; | 6858 | goto not_found; |
6859 | if (start > found_key.offset) | 6859 | if (start > found_key.offset) |
6860 | goto next; | 6860 | goto next; |
6861 | |||
6862 | /* New extent overlaps with existing one */ | ||
6861 | em->start = start; | 6863 | em->start = start; |
6862 | em->orig_start = start; | 6864 | em->orig_start = start; |
6863 | em->len = found_key.offset - start; | 6865 | em->len = found_key.offset - start; |
6864 | goto not_found_em; | 6866 | em->block_start = EXTENT_MAP_HOLE; |
6867 | goto insert; | ||
6865 | } | 6868 | } |
6866 | 6869 | ||
6867 | btrfs_extent_item_to_extent_map(inode, path, item, | 6870 | btrfs_extent_item_to_extent_map(inode, path, item, |
@@ -6921,7 +6924,6 @@ not_found: | |||
6921 | em->start = start; | 6924 | em->start = start; |
6922 | em->orig_start = start; | 6925 | em->orig_start = start; |
6923 | em->len = len; | 6926 | em->len = len; |
6924 | not_found_em: | ||
6925 | em->block_start = EXTENT_MAP_HOLE; | 6927 | em->block_start = EXTENT_MAP_HOLE; |
6926 | insert: | 6928 | insert: |
6927 | btrfs_release_path(path); | 6929 | btrfs_release_path(path); |