aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-25 08:51:48 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:02 -0400
commit81d7ed29ff6bdec903c36c26b386e16c014993b2 (patch)
tree561f6d5b85c9af14acc97ec45b6ce6622c3ec3f4 /fs/btrfs/inode.c
parentbce4eae9864e6b6ebde5d7f05576ff0a6c3724d0 (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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d58b4d5a1fe..b31f52d4f2c 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)
inode->i_mapping, GFP_NOFS);
extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree,
inode->i_mapping, GFP_NOFS);
+ atomic_set(&BTRFS_I(inode)->ordered_writeback, 0);
return 0;
}
@@ -1728,6 +1729,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
inode->i_mapping, GFP_NOFS);
extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree,
inode->i_mapping, GFP_NOFS);
+ atomic_set(&BTRFS_I(inode)->ordered_writeback, 0);
BTRFS_I(inode)->delalloc_bytes = 0;
BTRFS_I(inode)->root = root;
@@ -1956,6 +1958,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree,
inode->i_mapping, GFP_NOFS);
BTRFS_I(inode)->delalloc_bytes = 0;
+ atomic_set(&BTRFS_I(inode)->ordered_writeback, 0);
BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
}
dir->i_sb->s_dirt = 1;
@@ -3292,6 +3295,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
extent_io_tree_init(&BTRFS_I(inode)->io_failure_tree,
inode->i_mapping, GFP_NOFS);
BTRFS_I(inode)->delalloc_bytes = 0;
+ atomic_set(&BTRFS_I(inode)->ordered_writeback, 0);
BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
}
dir->i_sb->s_dirt = 1;