void CInode::encode_export(bufferlist& bl)
{
- ENCODE_START(4, 4, bl)
+ ENCODE_START(5, 4, bl)
_encode_base(bl);
::encode(state, bl);
::encode(bounding, bl);
_encode_locks_full(bl);
- get(PIN_TEMPEXPORTING);
+
+ ::encode(fcntl_locks, bl);
+ ::encode(flock_locks, bl);
ENCODE_FINISH(bl);
+
+ get(PIN_TEMPEXPORTING);
}
void CInode::finish_export(utime_t now)
void CInode::decode_import(bufferlist::iterator& p,
LogSegment *ls)
{
- DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, p);
+ DECODE_START_LEGACY_COMPAT_LEN(5, 4, 4, p);
_decode_base(p);
}
_decode_locks_full(p);
+
+ if (struct_v >= 5) {
+ ::decode(fcntl_locks, p);
+ ::decode(flock_locks, p);
+ }
+
DECODE_FINISH(p);
}
ceph_lock_state_t fcntl_locks;
ceph_lock_state_t flock_locks;
+ void clear_file_locks() {
+ fcntl_locks.clear();
+ flock_locks.clear();
+ }
+
// LogSegment dlists i (may) belong to
public:
elist<CInode*>::item item_dirty;
in->clear_dirty_parent();
+ in->clear_file_locks();
+
// waiters
in->take_waiting(CInode::WAIT_ANY_MASK, finished);
in->dirfragtreelock.clear_gather();
in->filelock.clear_gather();
+ in->clear_file_locks();
+
// non-bounding dir?
list<CDir*> dfs;
in->get_dirfrags(dfs);
void encode(bufferlist& bl) const {
::encode(held_locks, bl);
::encode(waiting_locks, bl);
+ ::encode(client_held_lock_counts, bl);
+ ::encode(client_waiting_lock_counts, bl);
}
void decode(bufferlist::iterator& bl) {
::decode(held_locks, bl);
::decode(waiting_locks, bl);
+ ::decode(client_held_lock_counts, bl);
+ ::decode(client_waiting_lock_counts, bl);
+ }
+ void clear() {
+ held_locks.clear();
+ waiting_locks.clear();
+ client_held_lock_counts.clear();
+ client_waiting_lock_counts.clear();
}
};
WRITE_CLASS_ENCODER(ceph_lock_state_t)