diff options
| author | John Garry <[email protected]> | 2024-06-20 12:53:56 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2024-06-20 21:19:17 +0000 |
| commit | caf336f81b3a3ca744e335972e86ec7244512d4a (patch) | |
| tree | dc5bf0641a35c57fd39f279f1d8343dee3ce26ef /drivers/scsi/scsi_debug.c | |
| parent | block: Add atomic write support for statx (diff) | |
| download | kernel-caf336f81b3a3ca744e335972e86ec7244512d4a.tar.gz kernel-caf336f81b3a3ca744e335972e86ec7244512d4a.zip | |
block: Add fops atomic write support
Support atomic writes by submitting a single BIO with the REQ_ATOMIC set.
It must be ensured that the atomic write adheres to its rules, like
naturally aligned offset, so call blkdev_dio_invalid() ->
blkdev_atomic_write_valid() [with renaming blkdev_dio_unaligned() to
blkdev_dio_invalid()] for this purpose. The BIO submission path currently
checks for atomic writes which are too large, so no need to check here.
In blkdev_direct_IO(), if the nr_pages exceeds BIO_MAX_VECS, then we cannot
produce a single BIO, so error in this case.
Finally set FMODE_CAN_ATOMIC_WRITE when the bdev can support atomic writes
and the associated file flag is for O_DIRECT.
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: John Garry <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
Acked-by: Darrick J. Wong <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
0 files changed, 0 insertions, 0 deletions
