aboutsummaryrefslogtreecommitdiff
path: root/io_uring/rsrc.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-09-11 13:54:32 -0600
committerJens Axboe <axboe@kernel.dk>2024-09-11 13:54:32 -0600
commitbfc0aa7a512f9a4462a88ca7352b00b83f8d68fd (patch)
tree24b4a25e54a354cdc67a9827f6c8e0d72534c08c /io_uring/rsrc.h
parent021b153f7d4115d99efa0d57ae2da6de1228295d (diff)
io_uring/rsrc: add reference count to struct io_mapped_ubuf
Currently there's a single ring owner of a mapped buffer, and hence the reference count will always be 1 when it's torn down and freed. However, in preparation for being able to link io_mapped_ubuf to different spots, add a reference count to manage the lifetime of it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/rsrc.h')
-rw-r--r--io_uring/rsrc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/io_uring/rsrc.h b/io_uring/rsrc.h
index 3d0dda3556e6..98a253172c27 100644
--- a/io_uring/rsrc.h
+++ b/io_uring/rsrc.h
@@ -47,6 +47,7 @@ struct io_mapped_ubuf {
unsigned int folio_shift;
unsigned long acct_pages;
unsigned long folio_mask;
+ refcount_t refs;
struct bio_vec bvec[] __counted_by(nr_bvecs);
};