diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-07-25 07:22:34 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-01 08:04:33 -0400 |
commit | facc8a2247340a9735fe8cc123c5da2102f5ef1b (patch) | |
tree | fc6a1ea604e0bd5c3d22da891669e0516d776916 /fs/btrfs/btrfs_inode.h | |
parent | f2a09da9d0cba17ad4041e7e54f1ca840b12d0be (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/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 08b286b2a2c5..d0ae226926ee 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -218,6 +218,27 @@ static inline int btrfs_inode_in_log(struct inode *inode, u64 generation) | |||
218 | return 0; | 218 | return 0; |
219 | } | 219 | } |
220 | 220 | ||
221 | struct btrfs_dio_private { | ||
222 | struct inode *inode; | ||
223 | u64 logical_offset; | ||
224 | u64 disk_bytenr; | ||
225 | u64 bytes; | ||
226 | void *private; | ||
227 | |||
228 | /* number of bios pending for this dio */ | ||
229 | atomic_t pending_bios; | ||
230 | |||
231 | /* IO errors */ | ||
232 | int errors; | ||
233 | |||
234 | /* orig_bio is our btrfs_io_bio */ | ||
235 | struct bio *orig_bio; | ||
236 | |||
237 | /* dio_bio came from fs/direct-io.c */ | ||
238 | struct bio *dio_bio; | ||
239 | u8 csum[0]; | ||
240 | }; | ||
241 | |||
221 | /* | 242 | /* |
222 | * Disable DIO read nolock optimization, so new dio readers will be forced | 243 | * Disable DIO read nolock optimization, so new dio readers will be forced |
223 | * to grab i_mutex. It is used to avoid the endless truncate due to | 244 | * to grab i_mutex. It is used to avoid the endless truncate due to |