Re: [RFC][PATCH] iov_iter: Add extraction functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:

> IDGI.  Essentially, you are passing a callback disguised as enum, only to
> lose any type safety.

Granted, but this is how struct iov_iter works.  I'm keeping the enum inside
the internal functions where it can't be got at by external code.

Now, I could just copy the code three times, once for iter=>bvec, once for
iter=>sg and once for iter=>rdma.  I can also grant that iter=>bvec is really
only needed for UBUF/IOVEC-class iterators; I think I can make the assumption
that kernel-supplied buffers are good for the lifetime of the operation.

> How is it better than "iov_iter_get_pages2() into a
> fixed-sized array and handle the result" done in a loop?

Note that iov_iter_get_pages2() doesn't handle KVEC-class iterators, which
this code does - for kmalloc'd, vmalloc'd and vmap'd memory and for global and
stack variables.  What I've written gets the physical addresses but
doesn't/can't pin it (which probably means I can't just move my code into
iov_iter_get_pages2()).

Further, my code also treats multipage folios as single units which
iov_iter_get_pages2() also doesn't - at least from XARRAY-class iterators.

The UBUF-/IOVEC-extraction code doesn't handle multipage folios because
get_user_pages_fast() doesn't - though perhaps it will need to at some point.

David




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux