#pragma once #include #include #include #include #include #include class MkDirMsgEx : public MirroredMessage> { public: typedef ErrorAndEntryResponseState ResponseState; virtual bool processIncoming(ResponseContext& ctx) override; std::tuple lock(EntryLockStore& store) override; std::unique_ptr executeLocally(ResponseContext& ctx, bool isSecondary) override; bool isMirrored() override { return getParentInfo()->getIsBuddyMirrored(); } private: // Initial hard link count for a newly created directory (self and "." entry). // Note: ".." entry increments the parent's link count, not this directory's. static constexpr unsigned INITIAL_DIR_LINK_COUNT = 2; std::string entryID; std::unique_ptr mkDirPrimary(ResponseContext& ctx); std::unique_ptr mkDirSecondary(); FhgfsOpsErr mkDirDentry(DirInode& parentDir, const std::string& name, const EntryInfo* entryInfo, const bool isBuddyMirrored); FhgfsOpsErr mkRemoteDirInode(DirInode& parentDir, const std::string& name, EntryInfo* entryInfo, const CharVector& defaultACLXAttr, const CharVector& accessACLXAttr); FhgfsOpsErr mkRemoteDirCompensate(EntryInfo* entryInfo); void forwardToSecondary(ResponseContext& ctx) override; FhgfsOpsErr processSecondaryResponse(NetMessage& resp) override { return (FhgfsOpsErr) static_cast(resp).getResult(); } const char* mirrorLogContext() const override { return "MkDirMsgEx/forward"; } EntryInfo newEntryInfo; };