Skip to content

Commit 7420558

Browse files
committed
btrfs: rename error to ret in btrfs_mksubvol()
Unify naming of return value to the preferred way. Reviewed-by: Daniel Vacek <neelx@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent ca588d1 commit 7420558

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

fs/btrfs/ioctl.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -903,28 +903,27 @@ static noinline int btrfs_mksubvol(const struct path *parent,
903903
struct btrfs_fs_info *fs_info = inode_to_fs_info(dir);
904904
struct dentry *dentry;
905905
struct fscrypt_str name_str = FSTR_INIT((char *)name, namelen);
906-
int error;
906+
int ret;
907907

908-
error = down_write_killable_nested(&dir->i_rwsem, I_MUTEX_PARENT);
909-
if (error == -EINTR)
910-
return error;
908+
ret = down_write_killable_nested(&dir->i_rwsem, I_MUTEX_PARENT);
909+
if (ret == -EINTR)
910+
return ret;
911911

912912
dentry = lookup_one(idmap, &QSTR_LEN(name, namelen), parent->dentry);
913-
error = PTR_ERR(dentry);
913+
ret = PTR_ERR(dentry);
914914
if (IS_ERR(dentry))
915915
goto out_unlock;
916916

917-
error = btrfs_may_create(idmap, dir, dentry);
918-
if (error)
917+
ret = btrfs_may_create(idmap, dir, dentry);
918+
if (ret)
919919
goto out_dput;
920920

921921
/*
922922
* even if this name doesn't exist, we may get hash collisions.
923923
* check for them now when we can safely fail
924924
*/
925-
error = btrfs_check_dir_item_collision(BTRFS_I(dir)->root,
926-
dir->i_ino, &name_str);
927-
if (error)
925+
ret = btrfs_check_dir_item_collision(BTRFS_I(dir)->root, dir->i_ino, &name_str);
926+
if (ret)
928927
goto out_dput;
929928

930929
down_read(&fs_info->subvol_sem);
@@ -933,19 +932,19 @@ static noinline int btrfs_mksubvol(const struct path *parent,
933932
goto out_up_read;
934933

935934
if (snap_src)
936-
error = create_snapshot(snap_src, dir, dentry, readonly, inherit);
935+
ret = create_snapshot(snap_src, dir, dentry, readonly, inherit);
937936
else
938-
error = create_subvol(idmap, dir, dentry, inherit);
937+
ret = create_subvol(idmap, dir, dentry, inherit);
939938

940-
if (!error)
939+
if (!ret)
941940
fsnotify_mkdir(dir, dentry);
942941
out_up_read:
943942
up_read(&fs_info->subvol_sem);
944943
out_dput:
945944
dput(dentry);
946945
out_unlock:
947946
btrfs_inode_unlock(BTRFS_I(dir), 0);
948-
return error;
947+
return ret;
949948
}
950949

951950
static noinline int btrfs_mksnapshot(const struct path *parent,

0 commit comments

Comments
 (0)