Lines Matching full:handle

25 	struct file_handle *handle = NULL;  in do_sys_name_to_handle()  local
29 * the file handle if decodeable file handle was requested. in do_sys_name_to_handle()
35 * A request to encode a connectable handle for a disconnected dentry in do_sys_name_to_handle()
48 handle = kzalloc(struct_size(handle, f_handle, f_handle.handle_bytes), in do_sys_name_to_handle()
50 if (!handle) in do_sys_name_to_handle()
53 /* convert handle size to multiple of sizeof(u32) */ in do_sys_name_to_handle()
56 /* Encode a possibly decodeable/connectable file handle */ in do_sys_name_to_handle()
58 (struct fid *)handle->f_handle, in do_sys_name_to_handle()
60 handle->handle_type = retval; in do_sys_name_to_handle()
61 /* convert handle size to bytes */ in do_sys_name_to_handle()
63 handle->handle_bytes = handle_bytes; in do_sys_name_to_handle()
64 if ((handle->handle_bytes > f_handle.handle_bytes) || in do_sys_name_to_handle()
68 * But file system returned 255 always. So handle in do_sys_name_to_handle()
74 * set the handle size to zero so we copy only in do_sys_name_to_handle()
80 * When asked to encode a connectable file handle, encode this in do_sys_name_to_handle()
81 * property in the file handle itself, so that we later know in do_sys_name_to_handle()
83 * For sanity, also encode in the file handle if the encoded in do_sys_name_to_handle()
89 handle->handle_type |= FILEID_IS_CONNECTABLE; in do_sys_name_to_handle()
105 /* copy the handle */ in do_sys_name_to_handle()
107 copy_to_user(ufh, handle, in do_sys_name_to_handle()
108 struct_size(handle, f_handle, handle_bytes))) in do_sys_name_to_handle()
110 kfree(handle); in do_sys_name_to_handle()
115 * sys_name_to_handle_at: convert name to handle
117 * @name: name that should be converted to handle.
118 * @handle: resulting file handle
122 * and whether a decodable file handle is required.
124 * @handle->handle_size indicate the space available to store the
125 * variable part of the file handle in bytes. If there is not
130 struct file_handle __user *, handle, void __user *, mnt_id, in SYSCALL_DEFINE5()
143 * AT_HANDLE_FID means there is no intention to decode file handle in SYSCALL_DEFINE5()
148 * connectable file handle, because its parent is unknown. in SYSCALL_DEFINE5()
163 err = do_sys_name_to_handle(&path, handle, mnt_id, in SYSCALL_DEFINE5()
248 static int do_handle_to_path(struct file_handle *handle, struct path *path, in do_handle_to_path() argument
255 /* change the handle size to multiple of sizeof(u32) */ in do_handle_to_path()
256 handle_dwords = handle->handle_bytes >> 2; in do_handle_to_path()
257 dentry = exportfs_decode_fh_raw(mnt, (struct fid *)handle->f_handle, in do_handle_to_path()
258 handle_dwords, handle->handle_type, in do_handle_to_path()
285 * way to the encoded file handle. If the caller is only able to in may_decode_fh()
326 struct file_handle *handle = NULL; in handle_to_path() local
357 handle = kmalloc(struct_size(handle, f_handle, f_handle.handle_bytes), in handle_to_path()
359 if (!handle) { in handle_to_path()
363 /* copy the full handle */ in handle_to_path()
364 *handle = f_handle; in handle_to_path()
365 if (copy_from_user(&handle->f_handle, in handle_to_path()
373 * If handle was encoded with AT_HANDLE_CONNECTABLE, verify that we in handle_to_path()
384 handle->handle_type &= ~FILEID_USER_FLAGS_MASK; in handle_to_path()
385 retval = do_handle_to_path(handle, path, &ctx); in handle_to_path()
388 kfree(handle); in handle_to_path()
424 * sys_open_by_handle_at: Open the file handle
426 * @handle: file handle to be opened
430 * of the mount point. file handle is decoded relative
435 struct file_handle __user *, handle, in SYSCALL_DEFINE3()
443 ret = do_handle_open(mountdirfd, handle, flags); in SYSCALL_DEFINE3()
453 struct file_handle __user *, handle, int, flags) in COMPAT_SYSCALL_DEFINE3()
455 return do_handle_open(mountdirfd, handle, flags); in COMPAT_SYSCALL_DEFINE3()