diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e53d20331646..008e3445748e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -993,20 +993,13 @@ fail: | |||
993 | 993 | ||
994 | void btrfs_drop_inode(struct inode *inode) | 994 | void btrfs_drop_inode(struct inode *inode) |
995 | { | 995 | { |
996 | struct btrfs_trans_handle *trans; | 996 | if (!BTRFS_I(inode)->ordered_trans || inode->i_nlink) { |
997 | struct btrfs_root *root = BTRFS_I(inode)->root; | ||
998 | |||
999 | if (!BTRFS_I(inode)->ordered_trans) { | ||
1000 | generic_drop_inode(inode); | 997 | generic_drop_inode(inode); |
1001 | return; | 998 | return; |
1002 | } | 999 | } |
1003 | /* nasty, but it prevents a deadlock with data=ordered by preventing | 1000 | /* FIXME, make sure this delete actually ends up in the transaction */ |
1004 | * a commit until after this inode is done | 1001 | btrfs_del_ordered_inode(inode); |
1005 | */ | ||
1006 | trans = btrfs_start_transaction(root, 1); | ||
1007 | generic_drop_inode(inode); | 1002 | generic_drop_inode(inode); |
1008 | /* note, the inode is now untouchable */ | ||
1009 | btrfs_end_transaction(trans, root); | ||
1010 | } | 1003 | } |
1011 | 1004 | ||
1012 | void btrfs_delete_inode(struct inode *inode) | 1005 | void btrfs_delete_inode(struct inode *inode) |