New upstream version 8.1.0

This commit is contained in:
geos_one
2025-08-10 01:34:16 +02:00
commit c891bb7105
4398 changed files with 838833 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#include "GetFileVersionMsgEx.h"
#include <program/Program.h>
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<MirroredMessageResponseState> 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<ResponseState>(std::move(resp));
}
resp.setGetFileVersionResult(FhgfsOpsErr_SUCCESS);
resp.setFileVersion(inode->getFileVersion());
metaStore.releaseFile(getEntryInfo().getParentEntryID(), inode);
return boost::make_unique<ResponseState>(std::move(resp));
}