Re: [PATCH 2/2] iomap: zero cached pages over unwritten extents on zero range

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

 



On Thu, Oct 15, 2020 at 10:49:01AM +0100, Christoph Hellwig wrote:
> > +iomap_zero_range_skip_uncached(struct inode *inode, loff_t *pos,
> > +		loff_t *count, loff_t *written)
> > +{
> > +	unsigned dirty_offset, bytes = 0;
> > +
> > +	dirty_offset = page_cache_seek_hole_data(inode, *pos, *count,
> > +				SEEK_DATA);
> > +	if (dirty_offset == -ENOENT)
> > +		bytes = *count;
> > +	else if (dirty_offset > *pos)
> > +		bytes = dirty_offset - *pos;
> > +
> > +	if (bytes) {
> > +		*pos += bytes;
> > +		*count -= bytes;
> > +		*written += bytes;
> > +	}
> 
> I find the calling conventions weird.  why not return bytes and
> keep the increments/decrements of the three variables in the caller?
> 

No particular reason. IIRC I had it both ways and just landed on this.
I'd change it, but as mentioned in the patch 1 thread I don't think this
patch is sufficient (with or without patch 1) anyways because the page
can also have been reclaimed before we get here.

Brian




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

  Powered by Linux