summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-26 21:20:24 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 21:10:07 -0400
commitecd188159efa112770d5f8a4a62f8d3586784f48 (patch)
treec4caa688bad2fc61c23f23549cad967822dcde80 /fs
parent6bdf2954016ef7c1f4d4fa07a338ee197d9c3506 (diff)
downloadlinux-ecd188159efa112770d5f8a4a62f8d3586784f48.tar.bz2
switch btrfs_ioctl_snap_create_transid() to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ioctl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 9df50fa8a078..3c88abb0e265 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1422,7 +1422,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
NULL, transid, readonly, inherit);
} else {
struct inode *src_inode;
- src_file = fget(fd);
+ int fput_needed;
+ src_file = fget_light(fd, &fput_needed);
if (!src_file) {
ret = -EINVAL;
goto out_drop_write;
@@ -1433,13 +1434,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
printk(KERN_INFO "btrfs: Snapshot src from "
"another FS\n");
ret = -EINVAL;
- fput(src_file);
- goto out_drop_write;
+ } else {
+ ret = btrfs_mksubvol(&file->f_path, name, namelen,
+ BTRFS_I(src_inode)->root,
+ transid, readonly, inherit);
}
- ret = btrfs_mksubvol(&file->f_path, name, namelen,
- BTRFS_I(src_inode)->root,
- transid, readonly, inherit);
- fput(src_file);
+ fput_light(src_file, fput_needed);
}
out_drop_write:
mnt_drop_write_file(file);