]> Pileus Git - ~andy/linux/blobdiff - fs/fhandle.c
Merge tag 'stable/for-linus-3.7-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / fs / fhandle.c
index a48e4a139be150d01aed47a4e387a14db9e731cb..f775bfdd6e4a7f3e0700b8ea556261ad8c13e3ba 100644 (file)
@@ -113,24 +113,21 @@ SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
 
 static struct vfsmount *get_vfsmount_from_fd(int fd)
 {
-       struct path path;
+       struct vfsmount *mnt;
 
        if (fd == AT_FDCWD) {
                struct fs_struct *fs = current->fs;
                spin_lock(&fs->lock);
-               path = fs->pwd;
-               mntget(path.mnt);
+               mnt = mntget(fs->pwd.mnt);
                spin_unlock(&fs->lock);
        } else {
-               int fput_needed;
-               struct file *file = fget_light(fd, &fput_needed);
-               if (!file)
+               struct fd f = fdget(fd);
+               if (!f.file)
                        return ERR_PTR(-EBADF);
-               path = file->f_path;
-               mntget(path.mnt);
-               fput_light(file, fput_needed);
+               mnt = mntget(f.file->f_path.mnt);
+               fdput(f);
        }
-       return path.mnt;
+       return mnt;
 }
 
 static int vfs_dentry_acceptable(void *context, struct dentry *dentry)