瀏覽代碼

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>
David Sterba 7 年之前
父節點
當前提交
05912a3c04
共有 4 個文件被更改,包括 4 次插入25 次删除
  1. 0 7
      fs/btrfs/disk-io.c
  2. 4 10
      fs/btrfs/extent_io.c
  3. 0 1
      fs/btrfs/extent_io.h
  4. 0 7
      fs/btrfs/inode.c

+ 0 - 7
fs/btrfs/disk-io.c

@@ -4523,12 +4523,6 @@ static int btrfs_cleanup_transaction(struct btrfs_fs_info *fs_info)
 	return 0;
 	return 0;
 }
 }
 
 
-static struct btrfs_fs_info *btree_fs_info(void *private_data)
-{
-	struct inode *inode = private_data;
-	return btrfs_sb(inode->i_sb);
-}
-
 static const struct extent_io_ops btree_extent_io_ops = {
 static const struct extent_io_ops btree_extent_io_ops = {
 	/* mandatory callbacks */
 	/* mandatory callbacks */
 	.submit_bio_hook = btree_submit_bio_hook,
 	.submit_bio_hook = btree_submit_bio_hook,
@@ -4537,7 +4531,6 @@ static const struct extent_io_ops btree_extent_io_ops = {
 	.merge_bio_hook = btrfs_merge_bio_hook,
 	.merge_bio_hook = btrfs_merge_bio_hook,
 	.readpage_io_failed_hook = btree_io_failed_hook,
 	.readpage_io_failed_hook = btree_io_failed_hook,
 	.set_range_writeback = btrfs_set_range_writeback,
 	.set_range_writeback = btrfs_set_range_writeback,
-	.tree_fs_info = btree_fs_info,
 
 
 	/* optional callbacks */
 	/* optional callbacks */
 };
 };

+ 4 - 10
fs/btrfs/extent_io.c

@@ -140,14 +140,6 @@ static int add_extent_changeset(struct extent_state *state, unsigned bits,
 
 
 static void flush_write_bio(struct extent_page_data *epd);
 static void flush_write_bio(struct extent_page_data *epd);
 
 
-static inline struct btrfs_fs_info *
-tree_fs_info(struct extent_io_tree *tree)
-{
-	if (tree->ops)
-		return tree->ops->tree_fs_info(tree->private_data);
-	return NULL;
-}
-
 int __init extent_io_init(void)
 int __init extent_io_init(void)
 {
 {
 	extent_state_cache = kmem_cache_create("btrfs_extent_state",
 	extent_state_cache = kmem_cache_create("btrfs_extent_state",
@@ -564,8 +556,10 @@ alloc_extent_state_atomic(struct extent_state *prealloc)
 
 
 static void extent_io_tree_panic(struct extent_io_tree *tree, int err)
 static void extent_io_tree_panic(struct extent_io_tree *tree, int err)
 {
 {
-	btrfs_panic(tree_fs_info(tree), err,
-		    "Locking error: Extent tree was modified by another thread while locked.");
+	struct inode *inode = tree->private_data;
+
+	btrfs_panic(btrfs_sb(inode->i_sb), err,
+	"locking error: extent tree was modified by another thread while locked");
 }
 }
 
 
 /*
 /*

+ 0 - 1
fs/btrfs/extent_io.h

@@ -105,7 +105,6 @@ struct extent_io_ops {
 			      size_t size, struct bio *bio,
 			      size_t size, struct bio *bio,
 			      unsigned long bio_flags);
 			      unsigned long bio_flags);
 	int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
 	int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
-	struct btrfs_fs_info *(*tree_fs_info)(void *private_data);
 	void (*set_range_writeback)(void *private_data, u64 start, u64 end);
 	void (*set_range_writeback)(void *private_data, u64 start, u64 end);
 
 
 	/*
 	/*

+ 0 - 7
fs/btrfs/inode.c

@@ -10473,12 +10473,6 @@ static int btrfs_readpage_io_failed_hook(struct page *page, int failed_mirror)
 	return -EAGAIN;
 	return -EAGAIN;
 }
 }
 
 
-static struct btrfs_fs_info *iotree_fs_info(void *private_data)
-{
-	struct inode *inode = private_data;
-	return btrfs_sb(inode->i_sb);
-}
-
 static void btrfs_check_extent_io_range(void *private_data, const char *caller,
 static void btrfs_check_extent_io_range(void *private_data, const char *caller,
 					u64 start, u64 end)
 					u64 start, u64 end)
 {
 {
@@ -10553,7 +10547,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = {
 	.readpage_end_io_hook = btrfs_readpage_end_io_hook,
 	.readpage_end_io_hook = btrfs_readpage_end_io_hook,
 	.merge_bio_hook = btrfs_merge_bio_hook,
 	.merge_bio_hook = btrfs_merge_bio_hook,
 	.readpage_io_failed_hook = btrfs_readpage_io_failed_hook,
 	.readpage_io_failed_hook = btrfs_readpage_io_failed_hook,
-	.tree_fs_info = iotree_fs_info,
 	.set_range_writeback = btrfs_set_range_writeback,
 	.set_range_writeback = btrfs_set_range_writeback,
 
 
 	/* optional callbacks */
 	/* optional callbacks */