diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-25 08:51:48 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:02 -0400 |
commit | 81d7ed29ff6bdec903c36c26b386e16c014993b2 (patch) | |
tree | 561f6d5b85c9af14acc97ec45b6ce6622c3ec3f4 /fs/btrfs/inode.c | |
parent | bce4eae9864e6b6ebde5d7f05576ff0a6c3724d0 (diff) |
Btrfs: Throttle file_write when data=ordered is flushing the inode
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d58b4d5a1fef..b31f52d4f2ca 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1419,6 +1419,7 @@ static int btrfs_init_locked_inode(struct inode *inode, void *p) | |||
1419 | inode->i_mapping, GFP_NOFS); | 1419 | inode->i_mapping, GFP_NOFS); |
1420 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, | 1420 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, |
1421 | inode->i_mapping, GFP_NOFS); | 1421 | inode->i_mapping, GFP_NOFS); |
1422 | atomic_set(&BTRFS_I(inode)->ordered_writeback, 0); | ||
1422 | return 0; | 1423 | return 0; |
1423 | } | 1424 | } |
1424 | 1425 | ||
@@ -1728,6 +1729,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
1728 | inode->i_mapping, GFP_NOFS); | 1729 | inode->i_mapping, GFP_NOFS); |
1729 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, | 1730 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, |
1730 | inode->i_mapping, GFP_NOFS); | 1731 | inode->i_mapping, GFP_NOFS); |
1732 | atomic_set(&BTRFS_I(inode)->ordered_writeback, 0); | ||
1731 | BTRFS_I(inode)->delalloc_bytes = 0; | 1733 | BTRFS_I(inode)->delalloc_bytes = 0; |
1732 | BTRFS_I(inode)->root = root; | 1734 | BTRFS_I(inode)->root = root; |
1733 | 1735 | ||
@@ -1956,6 +1958,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, | |||
1956 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, | 1958 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, |
1957 | inode->i_mapping, GFP_NOFS); | 1959 | inode->i_mapping, GFP_NOFS); |
1958 | BTRFS_I(inode)->delalloc_bytes = 0; | 1960 | BTRFS_I(inode)->delalloc_bytes = 0; |
1961 | atomic_set(&BTRFS_I(inode)->ordered_writeback, 0); | ||
1959 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; | 1962 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; |
1960 | } | 1963 | } |
1961 | dir->i_sb->s_dirt = 1; | 1964 | dir->i_sb->s_dirt = 1; |
@@ -3292,6 +3295,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, | |||
3292 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, | 3295 | extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree, |
3293 | inode->i_mapping, GFP_NOFS); | 3296 | inode->i_mapping, GFP_NOFS); |
3294 | BTRFS_I(inode)->delalloc_bytes = 0; | 3297 | BTRFS_I(inode)->delalloc_bytes = 0; |
3298 | atomic_set(&BTRFS_I(inode)->ordered_writeback, 0); | ||
3295 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; | 3299 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; |
3296 | } | 3300 | } |
3297 | dir->i_sb->s_dirt = 1; | 3301 | dir->i_sb->s_dirt = 1; |