summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-15 08:40:48 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:59 -0400
commitcee36a03e8f7c6e14aefd497d3acf01bcd3ef153 (patch)
tree14195245463be27ab4314da6eb943b146e6c8591 /fs/btrfs/inode.c
parent61295eb8665e723e77af91d0a1e655a4bd28344f (diff)
Rework btrfs_drop_inode to avoid scheduling
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index e53d2033164..008e3445748 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -993,20 +993,13 @@ fail:
void btrfs_drop_inode(struct inode *inode)
{
- struct btrfs_trans_handle *trans;
- struct btrfs_root *root = BTRFS_I(inode)->root;
-
- if (!BTRFS_I(inode)->ordered_trans) {
+ if (!BTRFS_I(inode)->ordered_trans || inode->i_nlink) {
generic_drop_inode(inode);
return;
}
- /* nasty, but it prevents a deadlock with data=ordered by preventing
- * a commit until after this inode is done
- */
- trans = btrfs_start_transaction(root, 1);
+ /* FIXME, make sure this delete actually ends up in the transaction */
+ btrfs_del_ordered_inode(inode);
generic_drop_inode(inode);
- /* note, the inode is now untouchable */
- btrfs_end_transaction(trans, root);
}
void btrfs_delete_inode(struct inode *inode)