diff options
author | Gu Jinxiang <gujx@cn.fujitsu.com> | 2018-04-27 10:22:07 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:07:28 +0200 |
commit | 0338dff6e0d91af053ef5d350d7388df666ae78e (patch) | |
tree | 6c25dba30676482bac12647e1cca2060604f199a | |
parent | btrfs: trace: Add trace points for unused block groups (diff) | |
download | linux-0338dff6e0d91af053ef5d350d7388df666ae78e.tar.xz linux-0338dff6e0d91af053ef5d350d7388df666ae78e.zip |
btrfs: do reverse path readahead in btrfs_shrink_device
In btrfs_shrink_device, before btrfs_search_slot, path->reada is set to
READA_FORWARD. But I think READA_BACK is correct.
Since:
1. key.offset is set to (u64)-1
2. after btrfs_search_slot, btrfs_previous_item is called
So, for readahead previous items, READA_BACK is the correct one.
Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 7b3b235cf214..78f6cd1de33a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -4414,7 +4414,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size) if (!path) return -ENOMEM; - path->reada = READA_FORWARD; + path->reada = READA_BACK; mutex_lock(&fs_info->chunk_mutex); |