aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.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/ordered-data.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/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 3ee51e10c187..b474902c90e2 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -269,3 +269,16 @@ int btrfs_del_ordered_inode(struct inode *inode)
269 return ret; 269 return ret;
270} 270}
271 271
272int btrfs_ordered_throttle(struct btrfs_root *root, struct inode *inode)
273{
274 struct btrfs_transaction *cur = root->fs_info->running_transaction;
275 while(cur == root->fs_info->running_transaction &&
276 atomic_read(&BTRFS_I(inode)->ordered_writeback)) {
277#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
278 congestion_wait(WRITE, HZ/20);
279#else
280 blk_congestion_wait(WRITE, HZ/20);
281#endif
282 }
283 return 0;
284}