#include "GetFileVersionMsgEx.h" #include bool GetFileVersionMsgEx::processIncoming(ResponseContext& ctx) { LOG_DBG(SESSIONS, DEBUG, "", getEntryInfo().getEntryID(), getEntryInfo().getIsBuddyMirrored()); return BaseType::processIncoming(ctx); } FileIDLock GetFileVersionMsgEx::lock(EntryLockStore& store) { return {&store, getEntryInfo().getEntryID(), false}; } std::unique_ptr GetFileVersionMsgEx::executeLocally(ResponseContext& ctx, bool isSecondary) { GetFileVersionMsgResponseState resp; auto& metaStore = *Program::getApp()->getMetaStore(); auto [inode, referenceRes] = metaStore.referenceFile(&getEntryInfo()); if (!inode) { // The GetFileVersionMsgResponseState constructor sets default values for 'result' and // 'version', indicating an error condition, eliminating the need to specify them // separately. Hence, returning a ResponseState with the moved 'resp'. return boost::make_unique(std::move(resp)); } resp.setGetFileVersionResult(FhgfsOpsErr_SUCCESS); resp.setFileVersion(inode->getFileVersion()); metaStore.releaseFile(getEntryInfo().getParentEntryID(), inode); return boost::make_unique(std::move(resp)); }