diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-22 18:56:44 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 10:06:57 -0500 |
commit | c28f158e5ee78621ae693b8b18a9b89c7695af40 (patch) | |
tree | d1ea17afb1fc82eae6f5c7bd61d23380f73d2db4 | |
parent | de143792253e244322dfe19410db5294d62571ff (diff) |
btrfs: struct reada_control.root -> reada_control.fs_info
The root is never used. We substitute extent_root in for the
reada_find_extent call, since it's only ever used to obtain the node
size. This call site will be changed to use fs_info in a later patch.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/reada.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 74110c7eebf1..9a3ca798087f 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -3652,7 +3652,7 @@ static inline void btrfs_bio_counter_dec(struct btrfs_fs_info *fs_info) | |||
3652 | 3652 | ||
3653 | /* reada.c */ | 3653 | /* reada.c */ |
3654 | struct reada_control { | 3654 | struct reada_control { |
3655 | struct btrfs_root *root; /* tree to prefetch */ | 3655 | struct btrfs_fs_info *fs_info; /* tree to prefetch */ |
3656 | struct btrfs_key key_start; | 3656 | struct btrfs_key key_start; |
3657 | struct btrfs_key key_end; /* exclusive */ | 3657 | struct btrfs_key key_end; /* exclusive */ |
3658 | atomic_t elems; | 3658 | atomic_t elems; |
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index f0beb63a6d82..540e729975be 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c | |||
@@ -544,17 +544,18 @@ static void reada_control_release(struct kref *kref) | |||
544 | static int reada_add_block(struct reada_control *rc, u64 logical, | 544 | static int reada_add_block(struct reada_control *rc, u64 logical, |
545 | struct btrfs_key *top, u64 generation) | 545 | struct btrfs_key *top, u64 generation) |
546 | { | 546 | { |
547 | struct btrfs_root *root = rc->root; | 547 | struct btrfs_fs_info *fs_info = rc->fs_info; |
548 | struct reada_extent *re; | 548 | struct reada_extent *re; |
549 | struct reada_extctl *rec; | 549 | struct reada_extctl *rec; |
550 | 550 | ||
551 | re = reada_find_extent(root, logical, top); /* takes one ref */ | 551 | /* takes one ref */ |
552 | re = reada_find_extent(fs_info->tree_root, logical, top); | ||
552 | if (!re) | 553 | if (!re) |
553 | return -1; | 554 | return -1; |
554 | 555 | ||
555 | rec = kzalloc(sizeof(*rec), GFP_KERNEL); | 556 | rec = kzalloc(sizeof(*rec), GFP_KERNEL); |
556 | if (!rec) { | 557 | if (!rec) { |
557 | reada_extent_put(root->fs_info, re); | 558 | reada_extent_put(fs_info, re); |
558 | return -ENOMEM; | 559 | return -ENOMEM; |
559 | } | 560 | } |
560 | 561 | ||
@@ -914,7 +915,7 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root, | |||
914 | if (!rc) | 915 | if (!rc) |
915 | return ERR_PTR(-ENOMEM); | 916 | return ERR_PTR(-ENOMEM); |
916 | 917 | ||
917 | rc->root = root; | 918 | rc->fs_info = root->fs_info; |
918 | rc->key_start = *key_start; | 919 | rc->key_start = *key_start; |
919 | rc->key_end = *key_end; | 920 | rc->key_end = *key_end; |
920 | atomic_set(&rc->elems, 0); | 921 | atomic_set(&rc->elems, 0); |
@@ -942,7 +943,7 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root, | |||
942 | int btrfs_reada_wait(void *handle) | 943 | int btrfs_reada_wait(void *handle) |
943 | { | 944 | { |
944 | struct reada_control *rc = handle; | 945 | struct reada_control *rc = handle; |
945 | struct btrfs_fs_info *fs_info = rc->root->fs_info; | 946 | struct btrfs_fs_info *fs_info = rc->fs_info; |
946 | 947 | ||
947 | while (atomic_read(&rc->elems)) { | 948 | while (atomic_read(&rc->elems)) { |
948 | if (!atomic_read(&fs_info->reada_works_cnt)) | 949 | if (!atomic_read(&fs_info->reada_works_cnt)) |
@@ -963,7 +964,7 @@ int btrfs_reada_wait(void *handle) | |||
963 | int btrfs_reada_wait(void *handle) | 964 | int btrfs_reada_wait(void *handle) |
964 | { | 965 | { |
965 | struct reada_control *rc = handle; | 966 | struct reada_control *rc = handle; |
966 | struct btrfs_fs_info *fs_info = rc->root->fs_info; | 967 | struct btrfs_fs_info *fs_info = rc->fs_info; |
967 | 968 | ||
968 | while (atomic_read(&rc->elems)) { | 969 | while (atomic_read(&rc->elems)) { |
969 | if (!atomic_read(&fs_info->reada_works_cnt)) | 970 | if (!atomic_read(&fs_info->reada_works_cnt)) |