[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211124065050.GB7075@lst.de>
Date: Wed, 24 Nov 2021 07:50:50 +0100
From: Christoph Hellwig <hch@....de>
To: Dan Williams <dan.j.williams@...el.com>
Cc: Christoph Hellwig <hch@....de>, Mike Snitzer <snitzer@...hat.com>,
Ira Weiny <ira.weiny@...el.com>,
device-mapper development <dm-devel@...hat.com>,
linux-xfs <linux-xfs@...r.kernel.org>,
Linux NVDIMM <nvdimm@...ts.linux.dev>,
linux-s390 <linux-s390@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-erofs@...ts.ozlabs.org,
linux-ext4 <linux-ext4@...r.kernel.org>,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH 18/29] fsdax: decouple zeroing from the iomap buffered
I/O code
On Tue, Nov 23, 2021 at 01:46:35PM -0800, Dan Williams wrote:
> > + const struct iomap_ops *ops)
> > +{
> > + unsigned int blocksize = i_blocksize(inode);
> > + unsigned int off = pos & (blocksize - 1);
> > +
> > + /* Block boundary? Nothing to do */
> > + if (!off)
> > + return 0;
>
> It took me a moment to figure out why this was correct. I see it was
> also copied from iomap_truncate_page(). It makes sense for DAX where
> blocksize >= PAGE_SIZE so it's always the case that the amount of
> capacity to zero relative to a page is from @pos to the end of the
> block. Is there something else that protects the blocksize < PAGE_SIZE
> case outside of DAX?
>
> Nothing to change for this patch, just a question I had while reviewing.
This is a helper for truncate ->setattr, where everything outside the
block is deallocated. So zeroing is only needed inside the block.
Powered by blists - more mailing lists