2 #include <linux/slab.h>
10 #include <linux/personality.h>
11 #include <asm/uaccess.h>
15 static long do_sys_name_to_handle(
struct path *
path,
28 if (!path->
dentry->d_sb->s_export_op ||
29 !path->
dentry->d_sb->s_export_op->fh_to_dentry)
44 handle_dwords =
f_handle.handle_bytes >> 2;
52 handle_bytes = handle_dwords *
sizeof(
u32);
55 (retval == 255) || (retval == -
ENOSPC)) {
93 struct file_handle __user *, handle,
int __user *, mnt_id,
108 err = do_sys_name_to_handle(&path, handle, mnt_id);
114 static struct vfsmount *get_vfsmount_from_fd(
int fd)
120 spin_lock(&fs->
lock);
122 spin_unlock(&fs->
lock);
124 struct fd
f = fdget(fd);
126 return ERR_PTR(-
EBADF);
138 static int do_handle_to_path(
int mountdirfd,
struct file_handle *handle,
144 path->
mnt = get_vfsmount_from_fd(mountdirfd);
145 if (IS_ERR(path->
mnt)) {
146 retval = PTR_ERR(path->
mnt);
154 vfs_dentry_acceptable,
NULL);
155 if (IS_ERR(path->
dentry)) {
156 retval = PTR_ERR(path->
dentry);
166 static int handle_to_path(
int mountdirfd,
struct file_handle __user *ufh,
205 retval = do_handle_to_path(mountdirfd, handle, path);
221 retval = handle_to_path(mountdirfd, ufh, &path);
233 retval = PTR_ERR(file);