aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.h
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-07-25 07:22:34 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 08:04:33 -0400
commitfacc8a2247340a9735fe8cc123c5da2102f5ef1b (patch)
treefc6a1ea604e0bd5c3d22da891669e0516d776916 /fs/btrfs/extent_io.h
parentf2a09da9d0cba17ad4041e7e54f1ca840b12d0be (diff)
Btrfs: don't cache the csum value into the extent state tree
Before applying this patch, we cached the csum value into the extent state tree when reading some data from the disk, this operation increased the lock contention of the state tree. Now, we just store the csum value into the bio structure or other unshared structure, so we can reduce the lock contention. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r--fs/btrfs/extent_io.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 3b8c4e26e1da..f7544afefdb9 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -62,6 +62,7 @@
62 62
63struct extent_state; 63struct extent_state;
64struct btrfs_root; 64struct btrfs_root;
65struct btrfs_io_bio;
65 66
66typedef int (extent_submit_bio_hook_t)(struct inode *inode, int rw, 67typedef int (extent_submit_bio_hook_t)(struct inode *inode, int rw,
67 struct bio *bio, int mirror_num, 68 struct bio *bio, int mirror_num,
@@ -77,8 +78,9 @@ struct extent_io_ops {
77 size_t size, struct bio *bio, 78 size_t size, struct bio *bio,
78 unsigned long bio_flags); 79 unsigned long bio_flags);
79 int (*readpage_io_failed_hook)(struct page *page, int failed_mirror); 80 int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
80 int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end, 81 int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset,
81 struct extent_state *state, int mirror); 82 struct page *page, u64 start, u64 end,
83 int mirror);
82 int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end, 84 int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
83 struct extent_state *state, int uptodate); 85 struct extent_state *state, int uptodate);
84 void (*set_bit_hook)(struct inode *inode, struct extent_state *state, 86 void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
@@ -262,10 +264,6 @@ int extent_readpages(struct extent_io_tree *tree,
262int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, 264int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
263 __u64 start, __u64 len, get_extent_t *get_extent); 265 __u64 start, __u64 len, get_extent_t *get_extent);
264int set_state_private(struct extent_io_tree *tree, u64 start, u64 private); 266int set_state_private(struct extent_io_tree *tree, u64 start, u64 private);
265void extent_cache_csums_dio(struct extent_io_tree *tree, u64 start, u32 csums[],
266 int count);
267void extent_cache_csums(struct extent_io_tree *tree, struct bio *bio,
268 int bvec_index, u32 csums[], int count);
269int get_state_private(struct extent_io_tree *tree, u64 start, u64 *private); 267int get_state_private(struct extent_io_tree *tree, u64 start, u64 *private);
270void set_page_extent_mapped(struct page *page); 268void set_page_extent_mapped(struct page *page);
271 269