Commit b6ae40ec authored by David Sterba's avatar David Sterba

btrfs: remove blocksize from reada_extent

Replace with global nodesize instead.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent d3e46fea
...@@ -66,7 +66,6 @@ struct reada_extctl { ...@@ -66,7 +66,6 @@ struct reada_extctl {
struct reada_extent { struct reada_extent {
u64 logical; u64 logical;
struct btrfs_key top; struct btrfs_key top;
u32 blocksize;
int err; int err;
struct list_head extctl; struct list_head extctl;
int refcnt; int refcnt;
...@@ -349,7 +348,6 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root, ...@@ -349,7 +348,6 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
blocksize = root->nodesize; blocksize = root->nodesize;
re->logical = logical; re->logical = logical;
re->blocksize = blocksize;
re->top = *top; re->top = *top;
INIT_LIST_HEAD(&re->extctl); INIT_LIST_HEAD(&re->extctl);
spin_lock_init(&re->lock); spin_lock_init(&re->lock);
...@@ -660,7 +658,6 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, ...@@ -660,7 +658,6 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info,
int mirror_num = 0; int mirror_num = 0;
struct extent_buffer *eb = NULL; struct extent_buffer *eb = NULL;
u64 logical; u64 logical;
u32 blocksize;
int ret; int ret;
int i; int i;
int need_kick = 0; int need_kick = 0;
...@@ -694,7 +691,7 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, ...@@ -694,7 +691,7 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info,
spin_unlock(&fs_info->reada_lock); spin_unlock(&fs_info->reada_lock);
return 0; return 0;
} }
dev->reada_next = re->logical + re->blocksize; dev->reada_next = re->logical + fs_info->tree_root->nodesize;
re->refcnt++; re->refcnt++;
spin_unlock(&fs_info->reada_lock); spin_unlock(&fs_info->reada_lock);
...@@ -709,7 +706,6 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, ...@@ -709,7 +706,6 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info,
} }
} }
logical = re->logical; logical = re->logical;
blocksize = re->blocksize;
spin_lock(&re->lock); spin_lock(&re->lock);
if (re->scheduled_for == NULL) { if (re->scheduled_for == NULL) {
...@@ -724,8 +720,8 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, ...@@ -724,8 +720,8 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info,
return 0; return 0;
atomic_inc(&dev->reada_in_flight); atomic_inc(&dev->reada_in_flight);
ret = reada_tree_block_flagged(fs_info->extent_root, logical, blocksize, ret = reada_tree_block_flagged(fs_info->extent_root, logical,
mirror_num, &eb); fs_info->tree_root->nodesize, mirror_num, &eb);
if (ret) if (ret)
__readahead_hook(fs_info->extent_root, NULL, logical, ret); __readahead_hook(fs_info->extent_root, NULL, logical, ret);
else if (eb) else if (eb)
...@@ -851,7 +847,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) ...@@ -851,7 +847,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
break; break;
printk(KERN_DEBUG printk(KERN_DEBUG
" re: logical %llu size %u empty %d for %lld", " re: logical %llu size %u empty %d for %lld",
re->logical, re->blocksize, re->logical, fs_info->tree_root->nodesize,
list_empty(&re->extctl), re->scheduled_for ? list_empty(&re->extctl), re->scheduled_for ?
re->scheduled_for->devid : -1); re->scheduled_for->devid : -1);
...@@ -886,7 +882,8 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) ...@@ -886,7 +882,8 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
} }
printk(KERN_DEBUG printk(KERN_DEBUG
"re: logical %llu size %u list empty %d for %lld", "re: logical %llu size %u list empty %d for %lld",
re->logical, re->blocksize, list_empty(&re->extctl), re->logical, fs_info->tree_root->nodesize,
list_empty(&re->extctl),
re->scheduled_for ? re->scheduled_for->devid : -1); re->scheduled_for ? re->scheduled_for->devid : -1);
for (i = 0; i < re->nzones; ++i) { for (i = 0; i < re->nzones; ++i) {
printk(KERN_CONT " zone %llu-%llu devs", printk(KERN_CONT " zone %llu-%llu devs",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment