diff options
author | Paul Moore <paul@paul-moore.com> | 2022-08-19 16:20:33 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2022-08-26 11:19:44 -0400 |
commit | 707527956d90ea4f304188555a97144183af1e49 (patch) | |
tree | 5a860333802cfad5088c30483a9e3e9672fafb64 /drivers/char | |
parent | f4d653dcaa4e4056e1630423e6a8ece4869b544f (diff) |
/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 <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mem.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 84ca98ed1dad..32a932a065a6 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -480,6 +480,11 @@ static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out, return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null); } +static int uring_cmd_null(struct io_uring_cmd *ioucmd, unsigned int issue_flags) +{ + return 0; +} + static ssize_t read_iter_zero(struct kiocb *iocb, struct iov_iter *iter) { size_t written = 0; @@ -663,6 +668,7 @@ static const struct file_operations null_fops = { .read_iter = read_iter_null, .write_iter = write_iter_null, .splice_write = splice_write_null, + .uring_cmd = uring_cmd_null, }; static const struct file_operations __maybe_unused port_fops = { |