#define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49)
// duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY
#define CEPH_FEATURE_OSD_DEGRADED_WRITES (1ULL<<49)
+#define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49) /* overlap w/ above */
#define CEPH_FEATURE_RESERVED2 (1ULL<<61) /* slow down, we are almost out... */
#define CEPH_FEATURE_RESERVED (1ULL<<62) /* DO NOT USE THIS ... last bit! */
class MOSDOp : public Message {
- static const int HEAD_VERSION = 4;
+ static const int HEAD_VERSION = 5;
static const int COMPAT_VERSION = 3;
private:
snapid_t snap_seq;
vector<snapid_t> snaps;
+ uint64_t features;
+
public:
friend class MOSDOpReply;
: Message(CEPH_MSG_OSD_OP, HEAD_VERSION, COMPAT_VERSION) { }
MOSDOp(int inc, long tid,
object_t& _oid, object_locator_t& _oloc, pg_t& _pgid, epoch_t _osdmap_epoch,
- int _flags)
+ int _flags, uint64_t feat)
: Message(CEPH_MSG_OSD_OP, HEAD_VERSION, COMPAT_VERSION),
client_inc(inc),
osdmap_epoch(_osdmap_epoch), flags(_flags), retry_attempt(-1),
- oid(_oid), oloc(_oloc), pgid(_pgid) {
+ oid(_oid), oloc(_oloc), pgid(_pgid),
+ features(feat) {
set_tid(tid);
}
private:
add_simple_op(CEPH_OSD_OP_STAT, 0, 0);
}
+ uint64_t get_features() const {
+ if (features)
+ return features;
+ return get_connection()->get_features();
+ }
+
// flags
int get_flags() const { return flags; }
::encode(snaps, payload);
::encode(retry_attempt, payload);
+ ::encode(features, payload);
}
}
oid.name.length()));
retry_attempt = -1;
+ features = 0;
} else {
// new decode
::decode(client_inc, p);
::decode(retry_attempt, p);
else
retry_attempt = -1;
+
+ if (header.version >= 5)
+ ::decode(features, p);
+ else
+ features = 0;
}
OSDOp::split_osd_op_vector_in_data(ops, data);
op_target_t target;
ConnectionRef con; // for rx buffer only
+ uint64_t features; // explicitly specified op features
vector<OSDOp> ops;
session(NULL), incarnation(0),
target(o, ol, f),
con(NULL),
+ features(CEPH_FEATURES_SUPPORTED_DEFAULT),
snapid(CEPH_NOSNAP),
outbl(NULL),
priority(0), onack(ac), oncommit(co),