io/uring/Operation: add method GetUringData()

This commit is contained in:
Max Kellermann 2025-01-17 14:09:22 +01:00 committed by Max Kellermann
parent 0ba0c64093
commit 3f638bfa03

@ -4,6 +4,8 @@
#pragma once
#include <cassert>
namespace Uring {
class CancellableOperation;
@ -33,6 +35,16 @@ public:
return cancellable != nullptr;
}
/**
* Returns the data pointer that can be passed to
* io_uring_prep_cancel().
*/
void *GetUringData() const noexcept {
assert(IsUringPending());
return cancellable;
}
/**
* Cancel the operation. OnUringCompletion() will not be
* invoked. This is a no-op if none is pending.