diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-26 21:20:24 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:10:07 -0400 |
commit | ecd188159efa112770d5f8a4a62f8d3586784f48 (patch) | |
tree | c4caa688bad2fc61c23f23549cad967822dcde80 /fs/btrfs | |
parent | 6bdf2954016ef7c1f4d4fa07a338ee197d9c3506 (diff) |
switch btrfs_ioctl_snap_create_transid() to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 14 |
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, | |||
1422 | NULL, transid, readonly, inherit); | 1422 | NULL, transid, readonly, inherit); |
1423 | } else { | 1423 | } else { |
1424 | struct inode *src_inode; | 1424 | struct inode *src_inode; |
1425 | src_file = fget(fd); | 1425 | int fput_needed; |
1426 | src_file = fget_light(fd, &fput_needed); | ||
1426 | if (!src_file) { | 1427 | if (!src_file) { |
1427 | ret = -EINVAL; | 1428 | ret = -EINVAL; |
1428 | goto out_drop_write; | 1429 | goto out_drop_write; |
@@ -1433,13 +1434,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, | |||
1433 | printk(KERN_INFO "btrfs: Snapshot src from " | 1434 | printk(KERN_INFO "btrfs: Snapshot src from " |
1434 | "another FS\n"); | 1435 | "another FS\n"); |
1435 | ret = -EINVAL; | 1436 | ret = -EINVAL; |
1436 | fput(src_file); | 1437 | } else { |
1437 | goto out_drop_write; | 1438 | ret = btrfs_mksubvol(&file->f_path, name, namelen, |
1439 | BTRFS_I(src_inode)->root, | ||
1440 | transid, readonly, inherit); | ||
1438 | } | 1441 | } |
1439 | ret = btrfs_mksubvol(&file->f_path, name, namelen, | 1442 | fput_light(src_file, fput_needed); |
1440 | BTRFS_I(src_inode)->root, | ||
1441 | transid, readonly, inherit); | ||
1442 | fput(src_file); | ||
1443 | } | 1443 | } |
1444 | out_drop_write: | 1444 | out_drop_write: |
1445 | mnt_drop_write_file(file); | 1445 | mnt_drop_write_file(file); |