#include "include/elist.h"
#include "include/filepath.h"
+#include "BatchOp.h"
#include "MDSCacheObject.h"
#include "MDSContext.h"
#include "SimpleLock.h"
class Session;
-
-
// define an ordering
bool operator<(const CDentry& l, const CDentry& r);
linkage.remote_d_type = dt;
}
+ ~CDentry() override {
+ ceph_assert(batch_ops.empty());
+ }
+
std::string_view pin_name(int p) const override {
switch (p) {
case PIN_INODEPIN: return "inodepin";
bool is_new() const { return state_test(STATE_NEW); }
void clear_new() { state_clear(STATE_NEW); }
- // -- replication
- void encode_replica(mds_rank_t mds, bufferlist& bl, bool need_recover) {
- __u32 nonce = add_replica(mds);
- encode(nonce, bl);
- encode(first, bl);
- encode(linkage.remote_ino, bl);
- encode(linkage.remote_d_type, bl);
- lock.encode_state_for_replica(bl);
- encode(need_recover, bl);
- }
- void decode_replica(bufferlist::const_iterator& p, bool is_new);
-
// -- exporting
// note: this assumes the dentry already exists.
// i.e., the name is already extracted... so we just need the other state.
void encode_export(bufferlist& bl) {
+ ENCODE_START(1, 1, bl);
encode(first, bl);
encode(state, bl);
encode(version, bl);
encode(lock, bl);
encode(get_replicas(), bl);
get(PIN_TEMPEXPORTING);
+ ENCODE_FINISH(bl);
}
void finish_export() {
// twiddle
put(PIN_TEMPEXPORTING);
}
void decode_import(bufferlist::const_iterator& blp, LogSegment *ls) {
+ DECODE_START(1, blp);
decode(first, blp);
__u32 nstate;
decode(nstate, blp);
if (is_replicated())
get(PIN_REPLICATED);
replica_nonce = 0;
+ DECODE_FINISH(blp);
}
// -- locking --
LocalLock versionlock; // FIXME referenced containers not in mempool
mempool::mds_co::map<client_t,ClientLease*> client_lease_map;
+ std::map<int, std::unique_ptr<BatchOp>> batch_ops;
protected: