From: Al Viro Date: Mon, 27 Aug 2012 07:18:55 +0000 (-0400) Subject: switch btrfs_ioctl_clone() to fget_light() X-Git-Tag: next-20120928~93^2~23 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8319aa9127a1282b24c3ece473a058d246f35b0d;p=karo-tx-linux.git switch btrfs_ioctl_clone() to fget_light() Signed-off-by: Al Viro --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3c88abb0e265..3494f2f44167 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2350,7 +2350,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, struct btrfs_key key; u32 nritems; int slot; - int ret; + int ret, fput_needed; u64 len = olen; u64 bs = root->fs_info->sb->s_blocksize; u64 hint_byte; @@ -2376,7 +2376,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, if (ret) return ret; - src_file = fget(srcfd); + src_file = fget_light(srcfd, &fput_needed); if (!src_file) { ret = -EBADF; goto out_drop_write; @@ -2724,7 +2724,7 @@ out_unlock: vfree(buf); btrfs_free_path(path); out_fput: - fput(src_file); + fput_light(src_file, fput_needed); out_drop_write: mnt_drop_write_file(file); return ret;