From 653cf02ad8666d96f448bcff8707d4145c8140a4 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Tue, 3 Sep 2024 15:52:26 +0100 Subject: [PATCH] draft man for bdev discard Just a draft, clearly not in the right place. Signed-off-by: Pavel Begunkov --- man/io_uring_enter.2 | 63 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2 index 8c797716e..80a39f7f3 100644 --- a/man/io_uring_enter.2 +++ b/man/io_uring_enter.2 @@ -1262,6 +1262,69 @@ is a pointer to siginfo_t, if any, being filled in. See also .BR waitid(2) for the general description of the related system call. Available since 6.5. +.TP +.B BLOCK_URING_CMD_DISCARD +Issue a discard command to the block device file. +.I fd +should point to a block device file, +.I addr +is the offset in bytes to start the operation from, and +.I addr3 +should be set to the length of the operation in bytes. +It is an asynchronous equivalent of +.B BLOCK_URING_CMD_DISCARD. +It allows multiple parallel discards as well as other operations, +as a result it may result in races for the data on the disk, and it's the user's +responsibility to take care of it. Furthermore, we only do the best effort page +cache invalidation, the user has to make sure there are no other inflight +requests modifying or reading the range, otherwise it might lead to stale +page cache and data inconsistencies. + +Available since 6.1*. + +.TP +.B BLOCK_URING_CMD_WRITE_ZEROES +Issue a write zeroes command to the block device file. +.I fd +should point to a block device file, +.I addr +is the offset in bytes to start the operation from, and +.I addr3 +should be set to the length of the operation in bytes. +It is an asynchronous equivalent of +.B BLKZEROOUT. +It allows issuing multiple parallel operations, as a result it may result in +races for the data on the disk, and it's the user's responsibility to take care +of it. Furthermore, we only do the best effort page cache invalidation, the +user has to make sure there are no other inflight requests modifying or +reading the range, otherwise it might lead to stale page cache and data +inconsistencies. + +Available since 6.1*. + +.TP +.B BLOCK_URING_CMD_WRITE_ZERO_PAGE +Issue a write request with the payload consisting of zeroes to the block +device file. +.I fd +should point to a block device file, +.I addr +is the offset in bytes within the disk to start the operation from, and +.I addr3 +should be set to the length of the operation in bytes. +It is an equivalent of +.B BLOCK_URING_CMD_WRITE_ZEROES +but doesn't require hardware support and could be less efficient. +It allows issuing multiple parallel operations, as a result it may result in +races for the data on the disk, and it's the user's responsibility to take care +of it. Furthermore, we only do the best effort page cache invalidation, the +user has to make sure there are no other inflight requests modifying or +reading the range, otherwise it might lead to stale page cache and data +inconsistencies. + +Available since 6.1*. + + .PP The .I flags