Btrfs: make SNAP_DESTROY async
authorSage Weil <sage@newdream.net>
Fri, 29 Oct 2010 19:41:32 +0000 (15:41 -0400)
committerChris Mason <chris.mason@oracle.com>
Sat, 30 Oct 2010 01:42:10 +0000 (21:42 -0400)
There is no reason to force an immediate commit when deleting a snapshot.
Users have some expectation that space from a deleted snapshot be freed
immediately, but even if we do commit the reclaim is a background process.

If users _do_ want the deletion to be durable, they can call 'sync'.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c

index e8a26a3..fdd88f2 100644 (file)
@@ -1351,7 +1351,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
                BUG_ON(ret);
        }
 
-       ret = btrfs_commit_transaction(trans, root);
+       ret = btrfs_end_transaction(trans, root);
        BUG_ON(ret);
        inode->i_flags |= S_DEAD;
 out_up_write: