Rework btrfs_drop_inode to avoid scheduling
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user