Commit 8a2487d2 authored by Jozsef Makai's avatar Jozsef Makai

MGM,FST: fixing compilation problem

parent 73bc0b60
......@@ -24,13 +24,11 @@
#pragma once
#include "mgm/Namespace.hh"
#include "mgm/XrdMgmOfs.hh"
#include "namespace/interface/IView.hh"
#include "common/Namespace.hh"
EOSMGMNAMESPACE_BEGIN
EOSCOMMONNAMESPACE_BEGIN
static constexpr decltype(gOFS->eosFileService->getFileMD(0)->getLocation(0)) TAPE_FS_ID = 65535;
static constexpr auto TAPE_FS_ID = 65535u;
static constexpr auto RETRIEVES_ATTR_NAME = "sys.retrieves";
static constexpr auto RETRIEVES_ERROR_ATTR_NAME = "sys.retrieve.error";
static constexpr auto ARCHIVE_ERROR_ATTR_NAME = "sys.archive.error";
......@@ -38,4 +36,4 @@ static constexpr auto RETRIEVE_WRITTEN_WORKFLOW_NAME = "retrieve_written";
static constexpr auto RETRIEVE_FAILED_WORKFLOW_NAME = "retrieve_failed";
static constexpr auto ARCHIVE_FAILED_WORKFLOW_NAME = "archive_failed";
EOSMGMNAMESPACE_END
\ No newline at end of file
EOSCOMMONNAMESPACE_END
\ No newline at end of file
......@@ -1572,6 +1572,8 @@ int
XrdFstOfs::CallSynchronousClosew(const Fmd& fmd, const string& ownerName,
const string& ownerGroupName, const string& instanceName,
const string& fullPath, const std::map<std::string, std::string>& xattrs) {
using namespace eos::common;
cta::xrd::Request request;
auto notification = request.mutable_notification();
notification->mutable_file()->mutable_owner()->set_username(ownerName);
......
......@@ -32,6 +32,7 @@
#include "mgm/WFE.hh"
#include "mgm/Stat.hh"
#include "mgm/XrdMgmOfsDirectory.hh"
#include "mgm/XrdMgmOfs.hh"
#include "mgm/Master.hh"
#include "namespace/interface/IView.hh"
#include "Xrd/XrdScheduler.hh"
......@@ -1690,30 +1691,8 @@ WFE::Job::DoIt(bool issync)
cta::xrd::Request request;
auto notification = request.mutable_notification();
static auto getUserName = [] (uid_t uid) {
int errc = 0;
auto user_name = Mapping::UidToUserName(uid, errc);
if (errc) {
user_name = "nobody";
}
return user_name;
};
static auto getGroupName = [] (gid_t gid) {
int errc = 0;
auto group_name = Mapping::GidToGroupName(gid, errc);
if (errc) {
group_name = "nobody";
}
return group_name;
};
notification->mutable_cli()->mutable_user()->set_username(getUserName(mVid.uid));
notification->mutable_cli()->mutable_user()->set_groupname(getGroupName(mVid.gid));
notification->mutable_cli()->mutable_user()->set_username(GetUserName(mVid.uid));
notification->mutable_cli()->mutable_user()->set_groupname(GetGroupName(mVid.gid));
auto collectAttributes = [&notification, &fullPath] {
eos::common::Mapping::VirtualIdentity rootvid;
......@@ -1824,8 +1803,8 @@ WFE::Job::DoIt(bool issync)
{
eos::common::RWMutexReadLock rlock(gOFS->eosViewRWMutex);
notification->mutable_file()->mutable_owner()->set_username(getUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(getGroupName(fmd->getCGid()));
notification->mutable_file()->mutable_owner()->set_username(GetUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(GetGroupName(fmd->getCGid()));
}
notification->mutable_wf()->set_event(cta::eos::Workflow::PREPARE);
......@@ -1917,8 +1896,8 @@ WFE::Job::DoIt(bool issync)
{
eos::common::RWMutexReadLock rlock(gOFS->eosViewRWMutex);
notification->mutable_file()->mutable_owner()->set_username(getUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(getGroupName(fmd->getCGid()));
notification->mutable_file()->mutable_owner()->set_username(GetUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(GetGroupName(fmd->getCGid()));
}
notification->mutable_wf()->set_event(cta::eos::Workflow::ABORT_PREPARE);
......@@ -1938,8 +1917,8 @@ WFE::Job::DoIt(bool issync)
{
eos::common::RWMutexReadLock rlock(gOFS->eosViewRWMutex);
notification->mutable_file()->mutable_owner()->set_username(getUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(getGroupName(fmd->getCGid()));
notification->mutable_file()->mutable_owner()->set_username(GetUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(GetGroupName(fmd->getCGid()));
}
notification->mutable_wf()->set_event(cta::eos::Workflow::OPENW);
......@@ -1954,8 +1933,8 @@ WFE::Job::DoIt(bool issync)
{
eos::common::RWMutexReadLock rlock(gOFS->eosViewRWMutex);
notification->mutable_file()->mutable_owner()->set_username(getUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(getGroupName(fmd->getCGid()));
notification->mutable_file()->mutable_owner()->set_username(GetUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(GetGroupName(fmd->getCGid()));
}
notification->mutable_wf()->set_event(cta::eos::Workflow::CREATE);
......@@ -2000,8 +1979,8 @@ WFE::Job::DoIt(bool issync)
std::ostringstream checksum;
{
eos::common::RWMutexReadLock rlock(gOFS->eosViewRWMutex);
notification->mutable_file()->mutable_owner()->set_username(getUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(getGroupName(fmd->getCGid()));
notification->mutable_file()->mutable_owner()->set_username(GetUserName(fmd->getCUid()));
notification->mutable_file()->mutable_owner()->set_groupname(GetGroupName(fmd->getCGid()));
notification->mutable_file()->set_size(fmd->getSize());
notification->mutable_file()->mutable_cks()->set_type(
......
......@@ -48,7 +48,7 @@ Workflow::Trigger(const std::string& event, std::string workflow,
return 0;
}
if ((workflow == RETRIEVE_WRITTEN_WORKFLOW_NAME && vid.prot != "sss")
if ((workflow == eos::common::RETRIEVE_WRITTEN_WORKFLOW_NAME && vid.prot != "sss")
|| (workflow == "none" && !vid.sudoer)) {
workflow = "default";
}
......
......@@ -322,12 +322,12 @@ XrdMgmOfs::_dropallstripes(const char* path,
fmd = gOFS->eosView->getFile(path);
// only on tape, we don't touch this file here
if (fmd->getLocations().size() == 1 && fmd->hasLocation(TAPE_FS_ID)) {
if (fmd->getLocations().size() == 1 && fmd->hasLocation(eos::common::TAPE_FS_ID)) {
return SFS_OK;
}
for (auto location : fmd->getLocations()) {
if (location == TAPE_FS_ID) {
if (location == eos::common::TAPE_FS_ID) {
continue;
}
......
......@@ -1205,7 +1205,7 @@ XrdMgmOfsFile::open(const char* inpath,
for (unsigned int i = 0; i < fmd->getNumLocation(); i++) {
auto loc = fmd->getLocation(i);
if (loc != 0 && loc != eos::mgm::TAPE_FS_ID) {
if (loc != 0 && loc != eos::common::TAPE_FS_ID) {
selectedfs.push_back(loc);
}
}
......
......@@ -99,11 +99,11 @@ eos::mgm::StagerRmCmd::ProcessRequest() {
eos::common::RWMutexWriteLock lock(gOFS->eosViewRWMutex);
try {
auto fmd = gOFS->eosView->getFile(path);
fmd->setAttribute(RETRIEVES_ATTR_NAME, "0");
fmd->setAttribute(eos::common::RETRIEVES_ATTR_NAME, "0");
gOFS->eosView->updateFileStore(fmd.get());
} catch (eos::MDException& ex) {
eos_static_err("Could not reset retrieves counter for file %s. Try setting the %s attribute to 0.",
path.c_str(), RETRIEVES_ATTR_NAME);
path.c_str(), eos::common::RETRIEVES_ATTR_NAME);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment