diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-10-25 05:28:04 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-11 13:31:37 -0500 |
commit | 8ccf6f19b67f7e0921063cc309f4672a6afcb528 (patch) | |
tree | 98cd76ca5dd2e7c93adc1bd363fefaa803acc824 /fs/btrfs/ctree.h | |
parent | 7b398f8e58c415738e397645c926253c428cf002 (diff) |
Btrfs: make delalloc inodes be flushed by multi-task
This patch introduce a new worker pool named "flush_workers", and if we
want to force all the inode with pending delalloc to the disks, we can
queue those inodes into the work queue of the worker pool, in this way,
those inodes will be flushed by multi-task.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 8fd9fe4282f5..cad16566da37 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1333,6 +1333,7 @@ struct btrfs_fs_info { | |||
1333 | struct btrfs_workers generic_worker; | 1333 | struct btrfs_workers generic_worker; |
1334 | struct btrfs_workers workers; | 1334 | struct btrfs_workers workers; |
1335 | struct btrfs_workers delalloc_workers; | 1335 | struct btrfs_workers delalloc_workers; |
1336 | struct btrfs_workers flush_workers; | ||
1336 | struct btrfs_workers endio_workers; | 1337 | struct btrfs_workers endio_workers; |
1337 | struct btrfs_workers endio_meta_workers; | 1338 | struct btrfs_workers endio_meta_workers; |
1338 | struct btrfs_workers endio_meta_write_workers; | 1339 | struct btrfs_workers endio_meta_write_workers; |
@@ -3277,6 +3278,19 @@ int btrfs_csum_truncate(struct btrfs_trans_handle *trans, | |||
3277 | int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, | 3278 | int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, |
3278 | struct list_head *list, int search_commit); | 3279 | struct list_head *list, int search_commit); |
3279 | /* inode.c */ | 3280 | /* inode.c */ |
3281 | struct btrfs_delalloc_work { | ||
3282 | struct inode *inode; | ||
3283 | int wait; | ||
3284 | int delay_iput; | ||
3285 | struct completion completion; | ||
3286 | struct list_head list; | ||
3287 | struct btrfs_work work; | ||
3288 | }; | ||
3289 | |||
3290 | struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode, | ||
3291 | int wait, int delay_iput); | ||
3292 | void btrfs_wait_and_free_delalloc_work(struct btrfs_delalloc_work *work); | ||
3293 | |||
3280 | struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page, | 3294 | struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page, |
3281 | size_t pg_offset, u64 start, u64 len, | 3295 | size_t pg_offset, u64 start, u64 len, |
3282 | int create); | 3296 | int create); |