aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 059546aa8fdf..8dcd4ff0c3a5 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -530,9 +530,10 @@ fail:
530 return ret; 530 return ret;
531} 531}
532 532
533static int create_snapshot(struct btrfs_root *root, struct dentry *dentry, 533static int create_snapshot(struct btrfs_root *root, struct inode *dir,
534 char *name, int namelen, u64 *async_transid, 534 struct dentry *dentry, char *name, int namelen,
535 bool readonly, struct btrfs_qgroup_inherit *inherit) 535 u64 *async_transid, bool readonly,
536 struct btrfs_qgroup_inherit *inherit)
536{ 537{
537 struct inode *inode; 538 struct inode *inode;
538 struct btrfs_pending_snapshot *pending_snapshot; 539 struct btrfs_pending_snapshot *pending_snapshot;
@@ -551,6 +552,7 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
551 pending_snapshot->dentry = dentry; 552 pending_snapshot->dentry = dentry;
552 pending_snapshot->root = root; 553 pending_snapshot->root = root;
553 pending_snapshot->readonly = readonly; 554 pending_snapshot->readonly = readonly;
555 pending_snapshot->dir = dir;
554 pending_snapshot->inherit = inherit; 556 pending_snapshot->inherit = inherit;
555 557
556 trans = btrfs_start_transaction(root->fs_info->extent_root, 6); 558 trans = btrfs_start_transaction(root->fs_info->extent_root, 6);
@@ -728,7 +730,7 @@ static noinline int btrfs_mksubvol(struct path *parent,
728 goto out_up_read; 730 goto out_up_read;
729 731
730 if (snap_src) { 732 if (snap_src) {
731 error = create_snapshot(snap_src, dentry, name, namelen, 733 error = create_snapshot(snap_src, dir, dentry, name, namelen,
732 async_transid, readonly, inherit); 734 async_transid, readonly, inherit);
733 } else { 735 } else {
734 error = create_subvol(BTRFS_I(dir)->root, dentry, 736 error = create_subvol(BTRFS_I(dir)->root, dentry,