Skip to content

Commit 9babda9

Browse files
lorddoskiaskdave
authored andcommitted
btrfs: Remove async_transid from btrfs_mksubvol/create_subvol/create_snapshot
With BTRFS_SUBVOL_CREATE_ASYNC support remove it's no longer required to pass the async_transid parameter so remove it and any code using it. Signed-off-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 5d54c67 commit 9babda9

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

fs/btrfs/ioctl.c

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ int __pure btrfs_is_empty_uuid(u8 *uuid)
551551
static noinline int create_subvol(struct inode *dir,
552552
struct dentry *dentry,
553553
const char *name, int namelen,
554-
u64 *async_transid,
555554
struct btrfs_qgroup_inherit *inherit)
556555
{
557556
struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
@@ -723,14 +722,7 @@ static noinline int create_subvol(struct inode *dir,
723722
trans->bytes_reserved = 0;
724723
btrfs_subvolume_release_metadata(fs_info, &block_rsv);
725724

726-
if (async_transid) {
727-
*async_transid = trans->transid;
728-
err = btrfs_commit_transaction_async(trans, 1);
729-
if (err)
730-
err = btrfs_commit_transaction(trans);
731-
} else {
732-
err = btrfs_commit_transaction(trans);
733-
}
725+
err = btrfs_commit_transaction(trans);
734726
if (err && !ret)
735727
ret = err;
736728

@@ -748,8 +740,7 @@ static noinline int create_subvol(struct inode *dir,
748740
}
749741

750742
static int create_snapshot(struct btrfs_root *root, struct inode *dir,
751-
struct dentry *dentry,
752-
u64 *async_transid, bool readonly,
743+
struct dentry *dentry, bool readonly,
753744
struct btrfs_qgroup_inherit *inherit)
754745
{
755746
struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
@@ -833,14 +824,8 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
833824
list_add(&pending_snapshot->list,
834825
&trans->transaction->pending_snapshots);
835826
spin_unlock(&fs_info->trans_lock);
836-
if (async_transid) {
837-
*async_transid = trans->transid;
838-
ret = btrfs_commit_transaction_async(trans, 1);
839-
if (ret)
840-
ret = btrfs_commit_transaction(trans);
841-
} else {
842-
ret = btrfs_commit_transaction(trans);
843-
}
827+
828+
ret = btrfs_commit_transaction(trans);
844829
if (ret)
845830
goto fail;
846831

@@ -946,7 +931,7 @@ static inline int btrfs_may_create(struct inode *dir, struct dentry *child)
946931
static noinline int btrfs_mksubvol(const struct path *parent,
947932
const char *name, int namelen,
948933
struct btrfs_root *snap_src,
949-
u64 *async_transid, bool readonly,
934+
bool readonly,
950935
struct btrfs_qgroup_inherit *inherit)
951936
{
952937
struct inode *dir = d_inode(parent->dentry);
@@ -982,13 +967,11 @@ static noinline int btrfs_mksubvol(const struct path *parent,
982967
if (btrfs_root_refs(&BTRFS_I(dir)->root->root_item) == 0)
983968
goto out_up_read;
984969

985-
if (snap_src) {
986-
error = create_snapshot(snap_src, dir, dentry,
987-
async_transid, readonly, inherit);
988-
} else {
989-
error = create_subvol(dir, dentry, name, namelen,
990-
async_transid, inherit);
991-
}
970+
if (snap_src)
971+
error = create_snapshot(snap_src, dir, dentry, readonly, inherit);
972+
else
973+
error = create_subvol(dir, dentry, name, namelen, inherit);
974+
992975
if (!error)
993976
fsnotify_mkdir(dir, dentry);
994977
out_up_read:

0 commit comments

Comments
 (0)