diff options
author | David Sterba <dsterba@suse.com> | 2018-07-18 13:23:45 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 07:12:55 -0400 |
commit | 05912a3c04ebca217507b4323b679c60eda4ac11 (patch) | |
tree | 280659829e3bf63ff6f7c412f4598c30dc218294 | |
parent | e288c080dddd1fdc3b7e0165cebd7af51a52d016 (diff) |
btrfs: drop extent_io_ops::tree_fs_info callback
All implementations of the callback are trivial and do the same and
there's only one user. Merge everything together.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/disk-io.c | 7 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 14 | ||||
-rw-r--r-- | fs/btrfs/extent_io.h | 1 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 7 |
4 files changed, 4 insertions, 25 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 03a7ed448f38..126460214512 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -4523,12 +4523,6 @@ static int btrfs_cleanup_transaction(struct btrfs_fs_info *fs_info) | |||
4523 | return 0; | 4523 | return 0; |
4524 | } | 4524 | } |
4525 | 4525 | ||
4526 | static struct btrfs_fs_info *btree_fs_info(void *private_data) | ||
4527 | { | ||
4528 | struct inode *inode = private_data; | ||
4529 | return btrfs_sb(inode->i_sb); | ||
4530 | } | ||
4531 | |||
4532 | static const struct extent_io_ops btree_extent_io_ops = { | 4526 | static const struct extent_io_ops btree_extent_io_ops = { |
4533 | /* mandatory callbacks */ | 4527 | /* mandatory callbacks */ |
4534 | .submit_bio_hook = btree_submit_bio_hook, | 4528 | .submit_bio_hook = btree_submit_bio_hook, |
@@ -4537,7 +4531,6 @@ static const struct extent_io_ops btree_extent_io_ops = { | |||
4537 | .merge_bio_hook = btrfs_merge_bio_hook, | 4531 | .merge_bio_hook = btrfs_merge_bio_hook, |
4538 | .readpage_io_failed_hook = btree_io_failed_hook, | 4532 | .readpage_io_failed_hook = btree_io_failed_hook, |
4539 | .set_range_writeback = btrfs_set_range_writeback, | 4533 | .set_range_writeback = btrfs_set_range_writeback, |
4540 | .tree_fs_info = btree_fs_info, | ||
4541 | 4534 | ||
4542 | /* optional callbacks */ | 4535 | /* optional callbacks */ |
4543 | }; | 4536 | }; |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3440053f3599..7a19437c6eda 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -140,14 +140,6 @@ static int add_extent_changeset(struct extent_state *state, unsigned bits, | |||
140 | 140 | ||
141 | static void flush_write_bio(struct extent_page_data *epd); | 141 | static void flush_write_bio(struct extent_page_data *epd); |
142 | 142 | ||
143 | static inline struct btrfs_fs_info * | ||
144 | tree_fs_info(struct extent_io_tree *tree) | ||
145 | { | ||
146 | if (tree->ops) | ||
147 | return tree->ops->tree_fs_info(tree->private_data); | ||
148 | return NULL; | ||
149 | } | ||
150 | |||
151 | int __init extent_io_init(void) | 143 | int __init extent_io_init(void) |
152 | { | 144 | { |
153 | extent_state_cache = kmem_cache_create("btrfs_extent_state", | 145 | extent_state_cache = kmem_cache_create("btrfs_extent_state", |
@@ -564,8 +556,10 @@ alloc_extent_state_atomic(struct extent_state *prealloc) | |||
564 | 556 | ||
565 | static void extent_io_tree_panic(struct extent_io_tree *tree, int err) | 557 | static void extent_io_tree_panic(struct extent_io_tree *tree, int err) |
566 | { | 558 | { |
567 | btrfs_panic(tree_fs_info(tree), err, | 559 | struct inode *inode = tree->private_data; |
568 | "Locking error: Extent tree was modified by another thread while locked."); | 560 | |
561 | btrfs_panic(btrfs_sb(inode->i_sb), err, | ||
562 | "locking error: extent tree was modified by another thread while locked"); | ||
569 | } | 563 | } |
570 | 564 | ||
571 | /* | 565 | /* |
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 4e6d34dd7caf..004517f3eb35 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -105,7 +105,6 @@ struct extent_io_ops { | |||
105 | size_t size, struct bio *bio, | 105 | size_t size, struct bio *bio, |
106 | unsigned long bio_flags); | 106 | unsigned long bio_flags); |
107 | int (*readpage_io_failed_hook)(struct page *page, int failed_mirror); | 107 | int (*readpage_io_failed_hook)(struct page *page, int failed_mirror); |
108 | struct btrfs_fs_info *(*tree_fs_info)(void *private_data); | ||
109 | void (*set_range_writeback)(void *private_data, u64 start, u64 end); | 108 | void (*set_range_writeback)(void *private_data, u64 start, u64 end); |
110 | 109 | ||
111 | /* | 110 | /* |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6cb42e33fdc3..f279e380f36e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -10473,12 +10473,6 @@ static int btrfs_readpage_io_failed_hook(struct page *page, int failed_mirror) | |||
10473 | return -EAGAIN; | 10473 | return -EAGAIN; |
10474 | } | 10474 | } |
10475 | 10475 | ||
10476 | static struct btrfs_fs_info *iotree_fs_info(void *private_data) | ||
10477 | { | ||
10478 | struct inode *inode = private_data; | ||
10479 | return btrfs_sb(inode->i_sb); | ||
10480 | } | ||
10481 | |||
10482 | static void btrfs_check_extent_io_range(void *private_data, const char *caller, | 10476 | static void btrfs_check_extent_io_range(void *private_data, const char *caller, |
10483 | u64 start, u64 end) | 10477 | u64 start, u64 end) |
10484 | { | 10478 | { |
@@ -10553,7 +10547,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = { | |||
10553 | .readpage_end_io_hook = btrfs_readpage_end_io_hook, | 10547 | .readpage_end_io_hook = btrfs_readpage_end_io_hook, |
10554 | .merge_bio_hook = btrfs_merge_bio_hook, | 10548 | .merge_bio_hook = btrfs_merge_bio_hook, |
10555 | .readpage_io_failed_hook = btrfs_readpage_io_failed_hook, | 10549 | .readpage_io_failed_hook = btrfs_readpage_io_failed_hook, |
10556 | .tree_fs_info = iotree_fs_info, | ||
10557 | .set_range_writeback = btrfs_set_range_writeback, | 10550 | .set_range_writeback = btrfs_set_range_writeback, |
10558 | 10551 | ||
10559 | /* optional callbacks */ | 10552 | /* optional callbacks */ |