Skip to content

Commit 7075279

Browse files
committed
/dev/null: add IORING_OP_URING_CMD support
This patch adds support for the io_uring command pass through, aka IORING_OP_URING_CMD, to the /dev/null driver. As with all of the /dev/null functionality, the implementation is just a simple sink where commands go to die, but it should be useful for developers who need a simple IORING_OP_URING_CMD test device that doesn't require any special hardware. Cc: Arnd Bergmann <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Acked-by: Jens Axboe <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent f4d653d commit 7075279

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/char/mem.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out,
480480
return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
481481
}
482482

483+
static int uring_cmd_null(struct io_uring_cmd *ioucmd, unsigned int issue_flags)
484+
{
485+
return 0;
486+
}
487+
483488
static ssize_t read_iter_zero(struct kiocb *iocb, struct iov_iter *iter)
484489
{
485490
size_t written = 0;
@@ -663,6 +668,7 @@ static const struct file_operations null_fops = {
663668
.read_iter = read_iter_null,
664669
.write_iter = write_iter_null,
665670
.splice_write = splice_write_null,
671+
.uring_cmd = uring_cmd_null,
666672
};
667673

668674
static const struct file_operations __maybe_unused port_fops = {

0 commit comments

Comments
 (0)