summaryrefslogtreecommitdiffstats
path: root/io_uring/refs.h
diff options
context:
space:
mode:
Diffstat (limited to 'io_uring/refs.h')
-rw-r--r--io_uring/refs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/io_uring/refs.h b/io_uring/refs.h
index 1336de3f2a..63982ead9f 100644
--- a/io_uring/refs.h
+++ b/io_uring/refs.h
@@ -33,6 +33,13 @@ static inline void req_ref_get(struct io_kiocb *req)
atomic_inc(&req->refs);
}
+static inline void req_ref_put(struct io_kiocb *req)
+{
+ WARN_ON_ONCE(!(req->flags & REQ_F_REFCOUNT));
+ WARN_ON_ONCE(req_ref_zero_or_close_to_overflow(req));
+ atomic_dec(&req->refs);
+}
+
static inline void __io_req_set_refcount(struct io_kiocb *req, int nr)
{
if (!(req->flags & REQ_F_REFCOUNT)) {