Skip to content

Commit b09efad

Browse files
joannekoongaxboe
authored andcommitted
io_uring/rsrc: rename and export IO_IMU_DEST / IO_IMU_SOURCE
Rename IO_IMU_DEST and IO_IMU_SOURCE to IO_BUF_DEST and IO_BUF_SOURCE and export it so subsystems may use it. This is needed by the io_buffer_register_bvec() path for callers who may need the buffer to be both readable and writable. Signed-off-by: Joanne Koong <joannelkoong@gmail.com> Link: https://patch.msgid.link/20260403174139.3634824-5-joannelkoong@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 33ee911 commit b09efad

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

include/linux/io_uring_types.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ enum io_uring_cmd_flags {
4444
IO_URING_F_COMPAT = (1 << 12),
4545
};
4646

47+
enum {
48+
IO_BUF_DEST = 1 << ITER_DEST,
49+
IO_BUF_SOURCE = 1 << ITER_SOURCE,
50+
};
51+
4752
struct iou_loop_params;
4853

4954
struct io_wq_work_node {

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3215,7 +3215,7 @@ static int __init io_uring_init(void)
32153215
io_uring_optable_init();
32163216

32173217
/* imu->dir is u8 */
3218-
BUILD_BUG_ON((IO_IMU_DEST | IO_IMU_SOURCE) > U8_MAX);
3218+
BUILD_BUG_ON((IO_BUF_DEST | IO_BUF_SOURCE) > U8_MAX);
32193219

32203220
/*
32213221
* Allow user copy in the per-command field, which starts after the

io_uring/rsrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ static struct io_rsrc_node *io_sqe_buffer_register(struct io_ring_ctx *ctx,
820820
imu->release = io_release_ubuf;
821821
imu->priv = imu;
822822
imu->flags = 0;
823-
imu->dir = IO_IMU_DEST | IO_IMU_SOURCE;
823+
imu->dir = IO_BUF_DEST | IO_BUF_SOURCE;
824824
if (coalesced)
825825
imu->folio_shift = data.folio_shift;
826826
refcount_set(&imu->refs, 1);

io_uring/rsrc.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ struct io_rsrc_node {
2323
};
2424
};
2525

26-
enum {
27-
IO_IMU_DEST = 1 << ITER_DEST,
28-
IO_IMU_SOURCE = 1 << ITER_SOURCE,
29-
};
30-
3126
enum {
3227
IO_REGBUF_F_KBUF = 1,
3328
};

0 commit comments

Comments
 (0)