summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason2008-07-17 18:54:14 +0200
committerChris Mason2008-09-25 17:04:04 +0200
commitf9295749388f82c8d2f485e99c72cd7c7876a99b (patch)
tree5089b0f723583d262116775b8b9fb5b4b8d291e0 /fs/btrfs/inode.c
parentBtrfs: Update on disk i_size only after pending ordered extents are done (diff)
downloadkernel-qcow2-linux-f9295749388f82c8d2f485e99c72cd7c7876a99b.tar.gz
kernel-qcow2-linux-f9295749388f82c8d2f485e99c72cd7c7876a99b.tar.xz
kernel-qcow2-linux-f9295749388f82c8d2f485e99c72cd7c7876a99b.zip
btrfs_start_transaction: wait for commits in progress to finish
btrfs_commit_transaction has to loop waiting for any writers in the transaction to finish before it can proceed. btrfs_start_transaction should be polite and not join a transaction that is in the process of being finished off. There are a few places that can't wait, basically the ones doing IO that might be needed to finish the transaction. For them, btrfs_join_transaction is added. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index baf46017d0d3..0a687326c0b0 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -116,7 +116,7 @@ static int cow_file_range(struct inode *inode, u64 start, u64 end)
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
int ret = 0;
- trans = btrfs_start_transaction(root, 1);
+ trans = btrfs_join_transaction(root, 1);
BUG_ON(!trans);
btrfs_set_trans_block_group(trans, inode);
@@ -502,7 +502,7 @@ int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
return 0;
}
- trans = btrfs_start_transaction(root, 1);
+ trans = btrfs_join_transaction(root, 1);
ordered_extent = btrfs_lookup_ordered_extent(inode, start);
BUG_ON(!ordered_extent);
@@ -1812,7 +1812,7 @@ int btrfs_write_inode(struct inode *inode, int wait)
int ret = 0;
if (wait) {
- trans = btrfs_start_transaction(root, 1);
+ trans = btrfs_join_transaction(root, 1);
btrfs_set_trans_block_group(trans, inode);
ret = btrfs_commit_transaction(trans, root);
}
@@ -1830,7 +1830,7 @@ void btrfs_dirty_inode(struct inode *inode)
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_trans_handle *trans;
- trans = btrfs_start_transaction(root, 1);
+ trans = btrfs_join_transaction(root, 1);
btrfs_set_trans_block_group(trans, inode);
btrfs_update_inode(trans, root, inode);
btrfs_end_transaction(trans, root);
@@ -2395,7 +2395,7 @@ again:
free_extent_map(em);
em = NULL;
btrfs_release_path(root, path);
- trans = btrfs_start_transaction(root, 1);
+ trans = btrfs_join_transaction(root, 1);
goto again;
}
write_extent_buffer(leaf, map + pg_offset, ptr,