inodeno_t ino; // anchored ino
inodeno_t dirino;
std::string d_name;
- __u8 d_type;
- union {
- mutable int nref; // how many children
- mutable mds_rank_t auth; // auth hint
- };
+ __u8 d_type = 0;
- Anchor() : d_type(0), nref(0) {}
- Anchor(inodeno_t i, inodeno_t di, std::string_view str, __u8 tp, int nr) :
- ino(i), dirino(di), d_name(str), d_type(tp), nref(nr) { }
+ Anchor() {}
+ Anchor(inodeno_t i, inodeno_t di, std::string_view str, __u8 tp) :
+ ino(i), dirino(di), d_name(str), d_type(tp) {}
void encode(bufferlist &bl) const;
void decode(bufferlist::iterator &bl);
ostream& operator<<(ostream& out, const Anchor &a);
+class RecoveredAnchor : public Anchor {
+public:
+ RecoveredAnchor() {}
+
+ mds_rank_t auth = MDS_RANK_NONE; // auth hint
+};
+
+class OpenedAnchor : public Anchor {
+public:
+ OpenedAnchor(inodeno_t i, inodeno_t di, std::string_view str, __u8 tp, int nr) :
+ Anchor(i, di, str, tp),
+ nref(nr)
+ {}
+
+ mutable int nref = 0; // how many children
+};
+
#endif
std::piecewise_construct,
std::make_tuple(ino),
std::make_tuple());
- Anchor& anchor = it->second;
+ RecoveredAnchor& anchor = it->second;
decode(anchor, p);
assert(ino == anchor.ino);
anchor.auth = MDS_RANK_NONE;
version_t omap_version = 0;
- map<inodeno_t, Anchor> anchor_map;
+ map<inodeno_t, OpenedAnchor> anchor_map;
set<dirfrag_t> dirfrags;
std::map<inodeno_t, unsigned> dirty_items; // ino -> dirty state
void _commit_finish(int r, uint64_t log_seq, MDSInternalContextBase *fin);
std::map<std::string, bufferlist> loaded_journal;
- map<inodeno_t, Anchor> loaded_anchor_map;
+ map<inodeno_t, RecoveredAnchor> loaded_anchor_map;
set<dirfrag_t> loaded_dirfrags;
list<MDSInternalContextBase*> waiting_for_load;
bool load_done = false;