Re: [PATCH 2/2] file-posix: add statx(STATX_DIOALIGN) support

2022-11-02 Thread Stefan Hajnoczi
On Tue, Nov 01, 2022 at 08:32:30PM -0700, Eric Biggers wrote: > On Tue, Nov 01, 2022 at 03:00:31PM -0400, Stefan Hajnoczi wrote: > > /* Let's try to use the logical blocksize for the alignment. */ > > -if (probe_logical_blocksize(fd, &bs->bl.request_alignment) < 0) { > > -bs->bl.re

Re: [PATCH 2/2] file-posix: add statx(STATX_DIOALIGN) support

2022-11-01 Thread Eric Biggers
On Tue, Nov 01, 2022 at 03:00:31PM -0400, Stefan Hajnoczi wrote: > /* Let's try to use the logical blocksize for the alignment. */ > -if (probe_logical_blocksize(fd, &bs->bl.request_alignment) < 0) { > -bs->bl.request_alignment = 0; > +if (!bs->bl.request_alignment) { > +

[PATCH 2/2] file-posix: add statx(STATX_DIOALIGN) support

2022-11-01 Thread Stefan Hajnoczi
Linux commit 825cf206ed51 ("statx: add direct I/O alignment information") added an interface to fetch O_DIRECT alignment values for block devices and file systems. Prefer STATX_DIOALIGN to older interfaces and probing, but keep them as fallbacks in case STATX_DIOALIGN cannot provide the informatio