aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-06-25 16:01:31 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commit89ce8a63d0c761fbb02089850605360f389477d8 (patch)
treea509b1daf6e41f7768eaf49235c573690f12ef9b /fs/btrfs/disk-io.c
parent333db94cdde9e6dfdedab9290d04d812f83e0922 (diff)
Add btrfs_end_transaction_throttle to force writers to wait for pending commits
The existing throttle mechanism was often not sufficient to prevent new writers from coming in and making a given transaction run forever. This adds an explicit wait at the end of most operations so they will allow the current transaction to close. There is no wait inside file_write, inode updates, or cow filling, all which have different deadlock possibilities. This is a temporary measure until better asynchronous commit support is added. This code leads to stalls as it waits for data=ordered writeback, and it really needs to be fixed. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 3cc480b83819..52569b57692d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1672,24 +1672,6 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
1672 set_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree, buf); 1672 set_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree, buf);
1673} 1673}
1674 1674
1675void btrfs_throttle(struct btrfs_root *root)
1676{
1677#if 0
1678 struct backing_dev_info *bdi;
1679
1680 bdi = &root->fs_info->bdi;
1681 if (atomic_read(&root->fs_info->throttles) &&
1682 bdi_write_congested(bdi)) {
1683#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
1684 congestion_wait(WRITE, HZ/20);
1685#else
1686 blk_congestion_wait(WRITE, HZ/20);
1687#endif
1688
1689 }
1690#endif
1691}
1692
1693void btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr) 1675void btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr)
1694{ 1676{
1695 /* 1677 /*