24#include <seastar/core/internal/io_intent.hh>
25#include <seastar/core/io_priority_class.hh>
26#include <seastar/util/modules.hh>
28#include <boost/container/small_vector.hpp>
45 struct intents_for_queue {
47 io_priority_class_id qid;
48 internal::cancellable_queue cq;
50 intents_for_queue(dev_t dev_, io_priority_class_id qid_) noexcept
51 : dev(dev_), qid(qid_), cq() {}
53 intents_for_queue(intents_for_queue&&)
noexcept =
default;
54 intents_for_queue& operator=(intents_for_queue&&)
noexcept =
default;
58 internal::intent_reference::container_type list;
60 references(references&& o) noexcept : list(std::move(o.list)) {}
61 references() noexcept : list() {}
62 ~references() { clear(); }
65 list.clear_and_dispose([] (internal::intent_reference* r) { r->on_cancel(); });
68 void bind(internal::intent_reference& iref)
noexcept {
73 boost::container::small_vector<intents_for_queue, 1> _intents;
75 friend internal::intent_reference::intent_reference(
io_intent*)
noexcept;
84 io_intent(
io_intent&& o) noexcept : _intents(std::move(o._intents)), _refs(std::move(o._refs)) {
85 for (
auto&& r : _refs.list) {
99 internal::cancellable_queue& find_or_create_cancellable_queue(dev_t dev, io_priority_class_id qid) {
100 for (
auto&& i : _intents) {
101 if (i.dev == dev && i.qid == qid) {
106 _intents.emplace_back(dev, qid);
107 return _intents.back().cq;
Definition: io_intent.hh:44
void cancel() noexcept
Definition: io_intent.hh:93
Seastar API namespace.
Definition: abort_on_ebadf.hh:26