1.iov_iter的定义 iov_iter结构体通常定义为: c复制代码 struct iov_iter { int type; /* Type of iter */ size_t pos; /* Offset to current iter */ size_t count; /* Count of bytes not yet iterated */ size_t nbytes; /* Total number of bytes in the iter */ union { struct { vo...
struct iov_iter *i); +int copy_struct_from_iter(void *dst, size_t ksize, struct iov_iter *i); size_t _copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i); size_t _copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); diff --git a/lib/iov_iter....
int);ssize_t(*read)(structfile*,char__user*,size_t,loff_t*);ssize_t(*write)(structfile*,constchar__user*,size_t,loff_t*);ssize_t(*read_iter)(structkiocb*,structiov_iter*);ssize_t(*write_iter)(structkiocb*,structiov_iter*);};...
staticinlinessize_tcall_write_iter(struct file *file, struct kiocb *kio,struct iov_iter *iter) { returnfile->f_op->write_iter(kio, iter);//调用socket文件函数表的aio_write函数 } 从以上__vfs_write分析,如果文件函数表结构提供了write接口函数则调用write函数,如果文件函数表结构没有提供write接口函...
int io_import_fixed(int ddir, struct iov_iter *iter, @@ -76,40 +76,36 @@ static inline struct io_rsrc_node *io_rsrc_node_lookup(struct io_rsrc_data *data return NULL; }static inline void io_put_rsrc_node(struct io_rsrc_node *node)...
Maybe this should be more than a recommendation, and just be inside copy_struct_from_iter(), because otherwise the "check_zeroed_user()" call might be quite the timesink for somebody who does something stupid. But otherwise this new version (still) looks fine to me. Linus Previous...
iov_iter.h iova.h iova_bitmap.h ip.h ipack.h ipc.h ipc_namespace.h ipmi.h ipmi_smi.h ipv6.h ipv6_route.h irq.h irq_poll.h irq_sim.h irq_work.h irqbypass.h irqchip.h irqdesc.h irqdomain.h irqdomain_defs.h irqflags.h irqflags_types.h irqhandler.h...
(structkiocb*,structiov_iter*);int(*iterate)(structfile*,structdir_context*);int(*iterate_shared)(structfile*,structdir_context*);unsignedint(*poll)(structfile*,structpoll_table_struct*);long(*unlocked_ioctl)(structfile*,unsignedint,unsignedlong);long(*compat_ioctl)(structfile*,unsignedint,...
staticinlinessize_tcall_write_iter(struct file *file, struct kiocb *kio,struct iov_iter *iter) { returnfile->f_op->write_iter(kio, iter);//调用socket文件函数表的aio_write函数 } 从以上__vfs_write分析,如果文件函数表结构提供了write接口函数则调用write函数,如果文件函数表结构没有提供write接口函...
copy_struct_from_iter(), but decided not to for consistency with copy_struct_from_user(). openat2() seems to be the only user of copy_struct_from_user() that doesn't limit to PAGE_SIZE, which is odd given that Aleksa wrote both ...