Skip to content

Commit

Permalink
switch btrfs_ioctl_snap_create_transid() to fget_light()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 6bdf295 commit ecd1881
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit ecd1881

Please sign in to comment.