Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/rsrc: remove '->ctx_ptr' of 'struct io_rsrc_node'

Remove '->ctx_ptr' of 'struct io_rsrc_node', and add 'type' field,
meantime remove io_rsrc_node_type().

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241107110149.890530-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
4f219fcc 0d98c509

+3 -10
+2 -2
io_uring/rsrc.c
··· 124 124 125 125 node = kzalloc(sizeof(*node), GFP_KERNEL); 126 126 if (node) { 127 - node->ctx_ptr = (unsigned long) ctx | type; 127 + node->type = type; 128 128 node->refs = 1; 129 129 } 130 130 return node; ··· 449 449 if (node->tag) 450 450 io_post_aux_cqe(ctx, node->tag, 0, 0); 451 451 452 - switch (io_rsrc_node_type(node)) { 452 + switch (node->type) { 453 453 case IORING_RSRC_FILE: 454 454 if (io_slot_file(node)) 455 455 fput(io_slot_file(node));
+1 -8
io_uring/rsrc.h
··· 11 11 enum { 12 12 IORING_RSRC_FILE = 0, 13 13 IORING_RSRC_BUFFER = 1, 14 - 15 - IORING_RSRC_TYPE_MASK = 0x3UL, 16 14 }; 17 15 18 16 struct io_rsrc_node { 19 - unsigned long ctx_ptr; 17 + unsigned char type; 20 18 int refs; 21 19 22 20 u64 tag; ··· 102 104 io_put_rsrc_node(req->ctx, req->buf_node); 103 105 req->buf_node = NULL; 104 106 } 105 - } 106 - 107 - static inline int io_rsrc_node_type(struct io_rsrc_node *node) 108 - { 109 - return node->ctx_ptr & IORING_RSRC_TYPE_MASK; 110 107 } 111 108 112 109 static inline void io_req_assign_rsrc_node(struct io_rsrc_node **dst_node,