Re: [PATCH 09/10] iomap: add a IOMAP_DIO_NOALLOC flag
From: Christoph Hellwig <hch@lst.de>
Date: 2021-01-14 17:27:37
Also in:
linux-fsdevel
On Wed, Jan 13, 2021 at 10:29:23AM +1100, Dave Chinner wrote:
On Tue, Jan 12, 2021 at 05:26:15PM +0100, Christoph Hellwig wrote:quoted
Add a flag to request that the iomap instances do not allocate blocks by translating it to another new IOMAP_NOALLOC flag.Except "no allocation" that is not what XFS needs for concurrent sub-block DIO.
Well, this is just a quick draft. I could not come up with a better name, so I picked on that explains most but not all of what is going on.
If we're going to use a flag for this specific functionality, let's call it what it is: IOMAP_DIO_UNALIGNED/IOMAP_UNALIGNED and do two things with it.
Sounds fine with me.
1. Make unaligned IO a formal part of the iomap_dio_rw() behaviour so it can do the common checks to for things that need exclusive serialisation for unaligned IO (i.e. avoid IO spanning EOF, abort if there are cached pages over the range, etc).
Note that these all writes already fall back to buffered I/O if invalidate_inode_pages2_range fails, so there must never be cached pages for direct I/O these days. This is different from NOWAIT I/O where we simply give up if there are any cached pages and don't even try to invalidate them.
2. require the filesystem mapping callback do only allow unaligned IO into ranges that are contiguous and don't require mapping state changes or sub-block zeroing to be performed during the sub-block IO.
Yeah.