Re: [PATCH v3 1/9] iov_iter: Add a function to extract an iter's buffers to a bvec iter

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

 



On Fri, May 27, 2022 at 11:44:02AM +0100, David Howells wrote:
> Copy cifs's setup_aio_ctx_iter() and to lib/iov_iter.c and generalise it as
> extract_iter_to_iter().  This allocates and sets up an array of bio_vecs
> for all the page fragments in an I/O iterator and sets a second supplied
> iterator to bvec-type pointing to the array.
> 
> This is can be used when setting up for a direct I/O or an asynchronous I/O
> to set up a record of the page fragments that are going to contribute to
> the buffer, paging them all in to prevent DIO->mmap loops and allowing the
> original iterator to be deallocated (it may be on the stack of the caller).
> 
> Note that extract_iter_to_iter() doesn't actually need to make a separate
> allocation for the page array.  It can place the page array at the end of
> the bvec array storage, provided it traverses both arrays from the 0th
> element forwards.

I really do not like this as a general purpose helper.  This is an odd
quirk that we really generally should not needed unless you have very
convoluted locking.  So please keep it inside of cifs.



[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