Rework btrfs_drop_inode to avoid scheduling

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-01-15 08:40:48 -05:00
parent 61295eb866
commit cee36a03e8
6 changed files with 44 additions and 10 deletions

View File

@@ -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)