Re: [PATCH v14 02/17] splice: Add a func to do a splice from a buffered file without ITER_PIPE

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

 



Ming Lei <ming.lei@xxxxxxxxxx> wrote:

> > +	/* Work out how much data we can actually add into the pipe */
> > +	used = pipe_occupancy(pipe->head, pipe->tail);
> > +	npages = max_t(ssize_t, pipe->max_usage - used, 0);
> > +	len = min_t(size_t, len, npages * PAGE_SIZE);
> 
> Do we need to consider offset in 1st page here?

Well, it won't break since we check further on that we don't overrun the ring,
but it's probably a bit more efficient to subtract the offset into the page at
this point.

That said, we don't know how big the first folio is yet, though I'm not sure
if that matters.

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