Lines Matching +full:iov +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-only
17 args->out_args[0].size = sizeof(*outarg); in fuse_send_ioctl()
18 args->out_args[0].value = outarg; in fuse_send_ioctl()
23 if (ret == -ENOSYS) in fuse_send_ioctl()
24 ret = -ENOTTY; in fuse_send_ioctl()
26 if (ret >= 0 && outarg->result == -ENOSYS) in fuse_send_ioctl()
27 outarg->result = -ENOTTY; in fuse_send_ioctl()
49 * non-compat (i.e. ones coming from 64bit apps) ioctl in fuse_copy_ioctl_iovec_old()
53 return -EINVAL; in fuse_copy_ioctl_iovec_old()
64 return -EIO; in fuse_copy_ioctl_iovec_old()
71 static int fuse_verify_ioctl_iov(struct fuse_conn *fc, struct iovec *iov, in fuse_verify_ioctl_iov() argument
75 u32 max = fc->max_pages << PAGE_SHIFT; in fuse_verify_ioctl_iov()
77 for (n = 0; n < count; n++, iov++) { in fuse_verify_ioctl_iov()
78 if (iov->iov_len > (size_t) max) in fuse_verify_ioctl_iov()
79 return -ENOMEM; in fuse_verify_ioctl_iov()
80 max -= iov->iov_len; in fuse_verify_ioctl_iov()
92 if (fc->minor < 16) { in fuse_copy_ioctl_iovec()
98 return -EIO; in fuse_copy_ioctl_iovec()
101 /* Did the server supply an inappropriate value? */ in fuse_copy_ioctl_iovec()
104 return -EIO; in fuse_copy_ioctl_iovec()
113 return -EIO; in fuse_copy_ioctl_iovec()
137 * On the first callout to FUSE server, inarg->in_size and
138 * inarg->out_size will be NULL; then, the server completes the ioctl
139 * with FUSE_IOCTL_RETRY set in out->flags, out->in_iovs set to 1 and
140 * the actual iov array to
147 * it sets FUSE_IOCTL_RETRY, out->in_iovs to 2 and iov array to
164 * limits ioctl data transfers to well-formed ioctls and is the forced
170 struct fuse_file *ff = file->private_data; in fuse_do_ioctl()
171 struct fuse_mount *fm = ff->fm; in fuse_do_ioctl()
173 .fh = ff->fh, in fuse_do_ioctl()
203 err = -ENOMEM; in fuse_do_ioctl()
204 ap.pages = fuse_pages_alloc(fm->fc->max_pages, GFP_KERNEL, &ap.descs); in fuse_do_ioctl()
209 fuse_page_descs_length_init(ap.descs, 0, fm->fc->max_pages); in fuse_do_ioctl()
216 struct iovec *iov = iov_page; in fuse_do_ioctl() local
218 iov->iov_base = (void __user *)arg; in fuse_do_ioctl()
219 iov->iov_len = _IOC_SIZE(cmd); in fuse_do_ioctl()
222 in_iov = iov; in fuse_do_ioctl()
227 out_iov = iov; in fuse_do_ioctl()
244 err = -ENOMEM; in fuse_do_ioctl()
245 if (max_pages > fm->fc->max_pages) in fuse_do_ioctl()
257 ap.args.nodeid = ff->nodeid; in fuse_do_ioctl()
266 err = -EFAULT; in fuse_do_ioctl()
290 err = -EIO; in fuse_do_ioctl()
301 err = -ENOMEM; in fuse_do_ioctl()
308 err = fuse_copy_ioctl_iovec(fm->fc, iov_page, vaddr, in fuse_do_ioctl()
318 err = fuse_verify_ioctl_iov(fm->fc, in_iov, in_iovs); in fuse_do_ioctl()
322 err = fuse_verify_ioctl_iov(fm->fc, out_iov, out_iovs); in fuse_do_ioctl()
329 err = -EIO; in fuse_do_ioctl()
333 err = -EFAULT; in fuse_do_ioctl()
344 __free_page(ap.pages[--ap.num_pages]); in fuse_do_ioctl()
358 return -EACCES; in fuse_ioctl_common()
361 return -EIO; in fuse_ioctl_common()
380 struct fuse_mount *fm = ff->fm; in fuse_priv_ioctl()
387 inarg.fh = ff->fh; in fuse_priv_ioctl()
393 if (S_ISDIR(inode->i_mode)) in fuse_priv_ioctl()
402 args.nodeid = ff->nodeid; in fuse_priv_ioctl()
417 err = -EIO; in fuse_priv_ioctl()
425 bool isdir = S_ISDIR(inode->i_mode); in fuse_priv_ioctl_prepare()
427 if (!fuse_allow_current_process(fm->fc)) in fuse_priv_ioctl_prepare()
428 return ERR_PTR(-EACCES); in fuse_priv_ioctl_prepare()
431 return ERR_PTR(-EIO); in fuse_priv_ioctl_prepare()
433 if (!S_ISREG(inode->i_mode) && !isdir) in fuse_priv_ioctl_prepare()
434 return ERR_PTR(-ENOTTY); in fuse_priv_ioctl_prepare()
441 fuse_file_release(inode, ff, O_RDONLY, NULL, S_ISDIR(inode->i_mode)); in fuse_priv_ioctl_cleanup()
456 if (fa->flags_valid) { in fuse_fileattr_get()
470 fa->fsx_extsize = xfa.fsx_extsize; in fuse_fileattr_get()
471 fa->fsx_nextents = xfa.fsx_nextents; in fuse_fileattr_get()
472 fa->fsx_projid = xfa.fsx_projid; in fuse_fileattr_get()
473 fa->fsx_cowextsize = xfa.fsx_cowextsize; in fuse_fileattr_get()
486 unsigned int flags = fa->flags; in fuse_fileattr_set()
494 if (fa->flags_valid) { in fuse_fileattr_set()
501 xfa.fsx_xflags = fa->fsx_xflags; in fuse_fileattr_set()
502 xfa.fsx_extsize = fa->fsx_extsize; in fuse_fileattr_set()
503 xfa.fsx_nextents = fa->fsx_nextents; in fuse_fileattr_set()
504 xfa.fsx_projid = fa->fsx_projid; in fuse_fileattr_set()
505 xfa.fsx_cowextsize = fa->fsx_cowextsize; in fuse_fileattr_set()