Skip to content

Commit 155fb39

Browse files
committed
Revert "[ntpl] Allow XRootD redirection with EOS files"
This reverts commit 235a67a.
1 parent 235a67a commit 155fb39

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

io/io/src/RRawFile.cxx

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,6 @@
2121
#include "TPluginManager.h"
2222
#include "TROOT.h"
2323

24-
// XRootD protocol redirection
25-
#ifdef R__UNIX
26-
27-
#ifdef R__FBSD
28-
#include <sys/extattr.h>
29-
#else
30-
#include <sys/xattr.h>
31-
#endif
32-
33-
#ifdef R__MACOSX
34-
/* On macOS getxattr takes two extra arguments that should be set to 0 */
35-
#define getxattr(path, name, value, size) getxattr(path, name, value, size, 0u, 0)
36-
#endif
37-
38-
#ifdef R__FBSD
39-
#define getxattr(path, name, value, size) extattr_get_file(path, EXTATTR_NAMESPACE_USER, name, value, size)
40-
#endif
41-
42-
#include "TEnv.h"
43-
44-
#endif
45-
4624
#include <algorithm>
4725
#include <cctype> // for towlower
4826
#include <cerrno>
@@ -90,23 +68,6 @@ ROOT::Internal::RRawFile::Create(std::string_view url, ROptions options)
9068
#ifdef _WIN32
9169
return std::unique_ptr<RRawFile>(new RRawFileWin(url, options));
9270
#else
93-
// If URL is a file on an EOS FUSE mount, attempt redirection to XRootD protocol.
94-
if (gEnv->GetValue("TFile.CrossProtocolRedirects", 1) == 1) {
95-
// At the moment the url parameter can only be the file name
96-
ssize_t len = getxattr(url.data(), "eos.url.xroot", nullptr, 0);
97-
if (len > 0) {
98-
std::string xurl(len, 0);
99-
std::string fileNameFromUrl{url.data()};
100-
if (getxattr(fileNameFromUrl.c_str(), "eos.url.xroot", &xurl[0], len) == len) {
101-
// Sometimes the `getxattr` call may return an invalid URL due
102-
// to the POSIX attribute not being yet completely filled by EOS.
103-
if (auto baseName = fileNameFromUrl.substr(fileNameFromUrl.find_last_of("/") + 1);
104-
std::equal(baseName.crbegin(), baseName.crend(), xurl.crbegin())) {
105-
return Create(xurl, options);
106-
}
107-
}
108-
}
109-
}
11071
return std::unique_ptr<RRawFile>(new RRawFileUnix(url, options));
11172
#endif
11273
}

0 commit comments

Comments
 (0)