Merge tag 'rust-6.9' of https://github.com/Rust-for-Linux/linux
[sfrench/cifs-2.6.git] / io_uring / cancel.h
index c0a8e7c520b6d65479b2874d1ec536f21450342a..76b32e65c03cd72452e37293bfcdc5b604e10267 100644 (file)
@@ -25,4 +25,14 @@ void init_hash_table(struct io_hash_table *table, unsigned size);
 int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg);
 bool io_cancel_req_match(struct io_kiocb *req, struct io_cancel_data *cd);
 
+static inline bool io_cancel_match_sequence(struct io_kiocb *req, int sequence)
+{
+       if ((req->flags & REQ_F_CANCEL_SEQ) && sequence == req->work.cancel_seq)
+               return true;
+
+       req->flags |= REQ_F_CANCEL_SEQ;
+       req->work.cancel_seq = sequence;
+       return false;
+}
+
 #endif