Re: [PATCH v2 1/9] vfs: add copy_file_range syscall and vfs helper
From: Anna Schumaker <hidden>
Date: 2015-09-22 18:27:51
Also in:
linux-btrfs, linux-fsdevel, linux-nfs
On 09/22/2015 07:44 AM, David Sterba wrote:
On Fri, Sep 11, 2015 at 04:30:14PM -0400, Anna Schumaker wrote:quoted
From: Zach Brown <redacted> +/* + * copy_file_range() differs from regular file read and write in that it + * specifically allows return partial success. When it does so is up to + * the copy_file_range method. + */ +ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in, + struct file *file_out, loff_t pos_out, + size_t len, int flags)Is the signed type for flags correct? I had the impression that it's usually good to have unsigned int/long for flags, this can be seen frequently in the vfs/fs code. Mainly for consistency.
I'm all for consistency! I'll change the function to take an unsigned int. Thanks, Anna
quoted
+ ret = file_in->f_op->copy_file_range(file_in, pos_in, file_out, pos_out, + len, flags);int -> unsigned intquoted
+} +EXPORT_SYMBOL(vfs_copy_file_range); + +SYSCALL_DEFINE6(copy_file_range, int, fd_in, loff_t __user *, off_in, + int, fd_out, loff_t __user *, off_out, + size_t, len, unsigned int, flags)the syscal takes unsigned intquoted
--- a/include/linux/fs.h +++ b/include/linux/fs.h@@ -1642,6 +1642,7 @@ struct file_operations { #ifndef CONFIG_MMU unsigned (*mmap_capabilities)(struct file *); #endif + ssize_t (*copy_file_range)(struct file *, loff_t, struct file *, loff_t, size_t, int);switch to unsignedquoted
+extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *, + loff_t, size_t, int);and here
-- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html