Re: [PATCH 2/4] fs: add STATX_DIO_READ_ALIGN

Christoph Hellwig
2025-01-06T16:40:12Z

On Mon, Jan 06, 2025 at 05:32:14PM +0100, Jan Kara wrote:
> > Add a separate dio read align field, as many out of place write
> > file systems can easily do reads aligned to the device sector size,
> > but require bigger alignment for writes.
> >
> > This is usually papered over by falling back to buffered I/O for smaller
> > writes and doing read-modify-write cycles, but performance for this
> > sucks, so applications benefit from knowing the actual write alignment.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > Reviewed-by: Darrick J. Wong <djwong@kernel.org>
>
> So if I understand right dio_offset_align is guaranteed to work for all DIO
> (i.e., maximum of all possible alignments), dio_read_offset_align is
> possibly lower and works only for reads.

Yes. If you think this needs to be made more clear I'm open to
suggestions to improve the wording.