]>
git.proxmox.com Git - ceph.git/blob - ceph/src/osd/osd_op_util.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
9 #include "osd/OSDMap.h"
11 #include "messages/MOSDOp.h"
16 ClassInfo(std::string
&& class_name
, std::string
&& method_name
,
17 bool read
, bool write
, bool allowed
) :
18 class_name(std::move(class_name
)), method_name(std::move(method_name
)),
19 read(read
), write(write
), allowed(allowed
)
21 const std::string class_name
;
22 const std::string method_name
;
23 const bool read
, write
, allowed
;
27 uint64_t rmw_flags
= 0;
28 std::vector
<ClassInfo
> classes
;
30 void set_rmw_flags(int flags
);
32 void add_class(std::string
&& class_name
, std::string
&& method_name
,
33 bool read
, bool write
, bool allowed
) {
34 classes
.emplace_back(std::move(class_name
), std::move(method_name
),
35 read
, write
, allowed
);
44 uint64_t get_flags() const {
48 bool check_rmw(int flag
) const ;
49 bool may_read() const;
50 bool may_write() const;
51 bool may_cache() const;
52 bool rwordered_forced() const;
53 bool rwordered() const;
54 bool includes_pg_op() const;
55 bool need_read_cap() const;
56 bool need_write_cap() const;
57 bool need_promote() const;
58 bool need_skip_handle_cache() const;
59 bool need_skip_promote() const;
60 bool allows_returnvec() const;
65 void set_class_read();
66 void set_class_write();
69 void set_skip_handle_cache();
70 void set_skip_promote();
71 void set_force_rwordered();
76 const OSDMap
&osdmap
);
78 std::vector
<ClassInfo
> get_classes() const {
83 std::ostream
& operator<<(std::ostream
& out
, const OpInfo::ClassInfo
& i
);