Re: [PATCH v6 02/34] iov_iter: Use IOCB/IOMAP_WRITE/op_is_write rather than iterator direction

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

 



On Mon, Jan 16, 2023 at 11:55:08PM -0800, Christoph Hellwig wrote:
> On Mon, Jan 16, 2023 at 11:08:17PM +0000, David Howells wrote:
> > Use information other than the iterator direction to determine the
> > direction of the I/O:
> > 
> >  (*) If a kiocb is available, use the IOCB_WRITE flag.
> > 
> >  (*) If an iomap_iter is available, use the IOMAP_WRITE flag.
> > 
> >  (*) If a request is available, use op_is_write().
> 
> The really should be three independent patches.  Plus another one
> to drop the debug checks in cifs.
> 
> The changes themselves look good to me.
> 
> >  
> > +static unsigned char iov_iter_rw(const struct iov_iter *i)
> > +{
> > +	return i->data_source ? WRITE : READ;
> > +}
> 
> It might as well make sense to just open code this in the only
> caller as well (yet another patch).

Especially since
		/* if it's a destination, tell g-u-p we want them writable */
                if (!i->data_source)
			gup_flags |= FOLL_WRITE;
is less confusing than the current
                if (iov_iter_rw(i) != WRITE)
			gup_flags |= FOLL_WRITE;




[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