Mutation.h and SimpleLock.h have a circular dependency and we have to
resolve it using forward-declarations. To make that possible, move
print() to Mutation.cc.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
#include "Mutation.h"
#include "ScatterLock.h"
+#include "SimpleLock.h"
#include "BatchOp.h"
#include "CDentry.h"
#include "CInode.h"
return false;
}
+void MutationImpl::LockOp::print(std::ostream& out) const {
+ CachedStackStringStream css;
+ *css << "0x" << std::hex << flags;
+ out << "LockOp(l=" << *lock << ",f=" << css->strv();
+ if (wrlock_target != MDS_RANK_NONE) {
+ out << ",wt=" << wrlock_target;
+ }
+ out << ")";
+}
+
void MutationImpl::LockOpVec::erase_rdlock(SimpleLock* lock)
{
for (int i = size() - 1; i >= 0; --i) {
#include "MDSContext.h"
-#include "SimpleLock.h"
#include "Capability.h"
#include "common/StackStringStream.h"
class MDSCacheObject;
class Session;
class ScatterLock;
+class SimpleLock;
struct sr_t;
struct MDLockCache;
return lock < r.lock;
}
- void print(std::ostream& out) const {
- CachedStackStringStream css;
- *css << "0x" << std::hex << flags;
- out << "LockOp(l=" << *lock << ",f=" << css->strv();
- if (wrlock_target != MDS_RANK_NONE) {
- out << ",wt=" << wrlock_target;
- }
- out << ")";
- }
+ void print(std::ostream& out) const;
SimpleLock* lock;
mutable unsigned flags;