25 #define ENOATTR ENODATA
27 #ifndef __STDC_FORMAT_MACROS
28 #define __STDC_FORMAT_MACROS
32 #include <sys/xattr.h>
34 #include "cvmfs_config.h"
40 #include <google/dense_hash_map>
42 #include <openssl/crypto.h>
46 #include <sys/errno.h>
48 #include <sys/mount.h>
49 #include <sys/resource.h>
52 #include <sys/types.h>
190 return "init-catalog-revision: " +
192 "current-catalog-revision: " +
205 "properties", mreq.c_str());
235 *dirent = dirent_negative;
262 "GetDirentForInode inode lookup failure %" PRId64, ino);
263 *dirent = dirent_negative;
282 uint64_t live_inode = 0;
348 const std::string &msg)
354 "Tracing: Could not find path for inode %" PRIu64, uint64_t(ino));
363 const std::string &msg)
373 static void cvmfs_lookup(fuse_req_t req, fuse_ino_t parent,
const char *name) {
377 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
378 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
384 fuse_ino_t parent_fuse = parent;
387 "cvmfs_lookup in parent inode: %" PRIu64
" for name: %s",
388 uint64_t(parent), name);
393 struct fuse_entry_param result;
395 memset(&result, 0,
sizeof(result));
397 result.attr_timeout = timeout;
398 result.entry_timeout = timeout;
401 if ((strcmp(name,
".") == 0) || (strcmp(name,
"..") == 0)) {
403 if (strcmp(name,
".") == 0) {
404 goto lookup_reply_positive;
409 goto lookup_reply_positive;
412 goto lookup_reply_negative;
414 goto lookup_reply_positive;
419 goto lookup_reply_negative;
421 goto lookup_reply_error;
427 goto lookup_reply_negative;
432 path.
Append(name, strlen(name));
436 goto lookup_reply_negative;
438 goto lookup_reply_error;
441 lookup_reply_positive:
445 result.ino = dirent.
inode();
447 fuse_reply_entry(req, &result);
450 lookup_reply_negative:
456 fuse_reply_entry(req, &result);
461 fuse_reply_err(req, EIO);
471 #
if CVMFS_USE_LIBFUSE == 2
472 unsigned long nlookup
482 if (ino == FUSE_ROOT_ID) {
483 fuse_reply_none(req);
491 #if CVMFS_USE_LIBCVMFS == 2
493 uint64_t(ino), nlookup);
496 uint64_t(ino), nlookup);
505 fuse_reply_none(req);
509 #if (FUSE_VERSION >= 29)
510 static void cvmfs_forget_multi(
513 struct fuse_forget_data *forgets
519 fuse_reply_none(req);
529 for (
size_t i = 0; i < count; ++i) {
530 if (forgets[i].ino == FUSE_ROOT_ID) {
536 ino, forgets[i].nlookup);
538 bool removed = vfs_put_raii.
VfsPut(ino, forgets[i].nlookup);
540 evict_raii.
Evict(ino);
545 fuse_reply_none(req);
547 #endif // FUSE_VERSION >= 29
560 fuse_reply_err(req, ENOENT);
562 fuse_reply_err(req, EIO);
570 struct fuse_file_info *fi)
575 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
576 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
586 fuse_reply_err(req, EACCES);
612 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
613 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
631 fuse_reply_err(req, EINVAL);
640 const char *name,
const struct stat *stat_info,
644 name, uint64_t(stat_info->st_ino));
645 size_t remaining_size = listing->
capacity() - listing->
size();
646 const size_t entry_size = fuse_add_direntry(req, NULL, 0, name, stat_info, 0);
648 while (entry_size > remaining_size) {
656 fuse_add_direntry(req, buffer + listing->
size(),
657 remaining_size, name, stat_info,
658 listing->
size() + entry_size);
667 struct fuse_file_info *fi)
671 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
672 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
682 fuse_reply_err(req, EACCES);
692 fuse_reply_err(req, ENOENT);
704 fuse_reply_err(req, ENOTDIR);
709 uint64_t(ino), path.
c_str());
730 bool retval = catalog_mgr->
ListingStat(path, &listing_from_catalog);
734 fuse_listing.Clear();
735 fuse_reply_err(req, EIO);
738 for (
unsigned i = 0; i < listing_from_catalog.
size(); ++i) {
742 entry_path.
Append(
"/", 1);
743 entry_path.
Append(listing_from_catalog.
AtPtr(i)->name.GetChars(),
744 listing_from_catalog.
AtPtr(i)->name.GetLength());
753 struct stat fixed_info = listing_from_catalog.
AtPtr(i)->info;
754 fixed_info.st_ino = entry_dirent.
inode();
756 &fixed_info, &fuse_listing);
761 stream_listing.
size = fuse_listing.size();
762 stream_listing.
capacity = fuse_listing.capacity();
764 fuse_listing.ShareBuffer(&stream_listing.
buffer, &large_alloc);
772 "linking directory handle %d to dir inode: %" PRIu64,
781 #if (FUSE_VERSION >= 30)
782 #ifdef CVMFS_ENABLE_FUSE3_CACHE_READDIR
786 fi->cache_readdir = 1;
789 fuse_reply_open(req, fi);
797 struct fuse_file_info *fi)
803 ", handle %d", uint64_t(ino), fi->fh);
811 if (iter_handle->second.capacity == 0)
812 smunmap(iter_handle->second.buffer);
814 free(iter_handle->second.buffer);
822 fuse_reply_err(req, reply);
830 const size_t buffer_size,
const off_t offset,
831 const size_t max_size)
833 if (offset < static_cast<int>(buffer_size)) {
834 fuse_reply_buf(req, buffer + offset,
835 std::min(static_cast<size_t>(buffer_size - offset), max_size));
837 fuse_reply_buf(req, NULL, 0);
846 off_t off,
struct fuse_file_info *fi)
851 "cvmfs_readdir on inode %" PRIu64
" reading %d bytes from offset %d",
857 DirectoryHandles::const_iterator iter_handle =
860 listing = iter_handle->second;
866 fuse_reply_err(req, EINVAL);
870 struct fuse_file_info *fi)
887 struct fuse_file_info *fi)
891 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
892 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
906 fuse_reply_err(req, ENOENT);
918 fuse_reply_err(req, EACCES);
930 if ((fi->flags & O_SHLOCK) || (fi->flags & O_EXLOCK)) {
932 fuse_reply_err(req, EOPNOTSUPP);
936 if (fi->flags & O_EXCL) {
938 fuse_reply_err(req, EEXIST);
955 "chunked file %s opened (download delayed to read() call)",
964 fuse_reply_err(req, EMFILE);
973 "chunked file %s vanished unexpectedly", path.
c_str());
974 fuse_reply_err(req, ENOENT);
977 const uint64_t unique_inode = dirent_origin.
inode();
980 chunk_tables->
Lock();
992 "'chunked', but no chunks found.", path.
c_str());
993 fuse_reply_err(req, EIO);
998 chunk_tables->
Lock();
1024 "linking chunk handle %d to unique inode: %" PRIu64,
1025 chunk_tables->
next_handle, uint64_t(unique_inode));
1045 fi->fh =
static_cast<uint64_t
>(-
static_cast<int64_t
>(fi->fh));
1049 fuse_reply_open(req, fi);
1056 fd = this_fetcher->
Fetch(
1072 fuse_reply_open(req, fi);
1078 fuse_reply_err(req, EMFILE);
1086 "failed to open inode: %" PRIu64
", CAS key %s, error code %d",
1088 if (errno == EMFILE) {
1089 fuse_reply_err(req, EMFILE);
1096 fuse_reply_err(req, -fd);
1104 struct fuse_file_info *fi)
1109 "cvmfs_read inode: %" PRIu64
" reading %d bytes from offset %d "
1115 char *data =
static_cast<char *
>(alloca(size));
1116 unsigned int overall_bytes_fetched = 0;
1118 int64_t fd =
static_cast<int64_t
>(fi->fh);
1119 uint64_t abs_fd = (fd < 0) ? -fd : fd;
1124 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1125 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
1127 const uint64_t chunk_handle = abs_fd;
1128 uint64_t unique_inode;
1135 chunk_tables->
Lock();
1148 pthread_mutex_t *handle_lock = chunk_tables->
Handle2Lock(chunk_handle);
1150 chunk_tables->
Lock();
1156 off_t offset_in_chunk = off - chunks.
list->
AtPtr(chunk_idx)->
offset();
1159 if ((chunk_fd.
fd == -1) || (chunk_fd.
chunk_idx != chunk_idx)) {
1161 string verbose_path =
"Part of " + chunks.
path.
ToString();
1183 if (chunk_fd.
fd < 0) {
1185 chunk_tables->
Lock();
1188 fuse_reply_err(req, EIO);
1197 const size_t bytes_to_read = size - overall_bytes_fetched;
1198 const size_t remaining_bytes_in_chunk =
1200 size_t bytes_to_read_in_chunk =
1201 std::min(bytes_to_read, remaining_bytes_in_chunk);
1204 data + overall_bytes_fetched,
1205 bytes_to_read_in_chunk,
1208 if (bytes_fetched < 0) {
1211 chunk_tables->
Lock();
1214 fuse_reply_err(req, -bytes_fetched);
1217 overall_bytes_fetched += bytes_fetched;
1221 offset_in_chunk = 0;
1222 }
while ((overall_bytes_fetched < size) &&
1223 (chunk_idx < chunks.list->
size()));
1226 chunk_tables->
Lock();
1234 fuse_reply_err(req, -nbytes);
1237 overall_bytes_fetched = nbytes;
1241 fuse_reply_buf(req, data, overall_bytes_fetched);
1243 overall_bytes_fetched);
1251 struct fuse_file_info *fi)
1258 int64_t fd =
static_cast<int64_t
>(fi->fh);
1259 uint64_t abs_fd = (fd < 0) ? -fd : fd;
1266 const uint64_t chunk_handle = abs_fd;
1269 uint64_t unique_inode;
1276 chunk_tables->
Lock();
1293 uint64_t(unique_inode));
1299 delete to_delete.
list;
1305 if (chunk_fd.
fd != -1)
1313 fuse_reply_err(req, 0);
1323 struct statvfs info;
1324 memset(&info, 0,
sizeof(info));
1332 fuse_reply_statfs(req, &info);
1336 uint64_t available = 0;
1340 info.f_bsize = info.f_frsize = 512;
1342 if (capacity == (uint64_t)(-1)) {
1344 info.f_blocks = size / info.f_bsize;
1347 info.f_blocks = capacity / info.f_bsize;
1348 available = capacity -
size;
1351 info.f_bfree = info.f_bavail = available / info.f_bsize;
1357 info.f_files = all_inodes;
1358 info.f_ffree = info.f_favail = all_inodes - loaded_inode;
1361 fuse_reply_statfs(req, &info);
1365 static void cvmfs_getxattr(fuse_req_t req, fuse_ino_t ino,
const char *name,
1366 size_t size, uint32_t position)
1372 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1373 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
1379 "cvmfs_getxattr on inode: %" PRIu64
" for xattr: %s",
1380 uint64_t(ino), name);
1383 fuse_reply_err(req, EACCES);
1388 const string attr = name;
1401 retval = catalog_mgr->
LookupPath(path, lookup_options, &raw_symlink);
1410 bool magic_xattr_success =
true;
1413 if (!magic_xattr.IsNull()) {
1424 if (!magic_xattr_success) {
1429 string attribute_value;
1431 if (!magic_xattr.IsNull()) {
1432 attribute_value = magic_xattr->GetValue();
1434 if (!xattrs.
Get(attr, &attribute_value)) {
1441 fuse_reply_xattr(req, attribute_value.length());
1442 }
else if (size >= attribute_value.length()) {
1443 fuse_reply_buf(req, &attribute_value[0], attribute_value.length());
1445 fuse_reply_err(req, ERANGE);
1451 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1452 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid);
1459 "cvmfs_listxattr on inode: %" PRIu64
", size %u [visibility %d]",
1460 uint64_t(ino), size,
1466 if (d.HasXattrs()) {
1480 string attribute_list;
1485 fuse_reply_xattr(req, attribute_list.length());
1486 }
else if (size >= attribute_list.length()) {
1487 if (attribute_list.empty())
1488 fuse_reply_buf(req, NULL, 0);
1490 fuse_reply_buf(req, &attribute_list[0], attribute_list.length());
1492 fuse_reply_err(req, ERANGE);
1510 bool Pin(
const string &path) {
1526 for (
unsigned i = 0; i < chunks.
size(); ++i) {
1568 int fd = this_fetcher->
Fetch(
1582 static void cvmfs_init(
void *userdata,
struct fuse_conn_info *conn) {
1586 #ifdef CVMFS_NFS_SUPPORT
1587 conn->want |= FUSE_CAP_EXPORT_SUPPORT;
1591 #ifdef FUSE_CAP_POSIX_ACL
1592 if ((conn->capable & FUSE_CAP_POSIX_ACL) == 0) {
1594 "ACL support requested but missing fuse kernel support, "
1597 conn->want |= FUSE_CAP_POSIX_ACL;
1601 "ACL support requested but not available in this version of "
1602 "libfuse, aborting");
1616 memset(cvmfs_operations, 0,
sizeof(*cvmfs_operations));
1635 #if (FUSE_VERSION >= 29)
1636 cvmfs_operations->forget_multi = cvmfs_forget_multi;
1654 #if (FUSE_VERSION >= 30)
1655 fuse_fd = fuse_session_fd(*reinterpret_cast<struct fuse_session**>(
1658 fuse_fd = fuse_chan_fd(*reinterpret_cast<struct fuse_chan**>(
1665 socket_path.c_str(), errno);
1679 loader::CvmfsExports *g_cvmfs_exports = NULL;
1695 return "never (fixed root catalog)";
1697 time_t now = time(NULL);
1698 return StringifyInt( (catalogs_valid_until_ - now) / 60);
1723 time_t now = time(NULL);
1747 const string &mount_path,
1755 string fqrn_from_xattr;
1764 if (fqrn_from_xattr == fqrn) {
1766 "repository already mounted on %s", mount_path.c_str());
1770 "CernVM-FS repository %s already mounted on %s",
1771 fqrn.c_str(), mount_path.c_str());
1792 for (
unsigned i = 0, s = tokens.size(); i < s; ++i) {
1835 sizeof(fuse_ino_t) * 8);
1844 void **channel_or_session = NULL;
1845 if (loader_exports->
version >= 4) {
1849 bool fuse_notify_invalidation =
true;
1854 fuse_notify_invalidation =
false;
1860 channel_or_session, fuse_notify_invalidation);
1886 *
g_boot_error = std::string(
"failed to set talk socket ownership - ")
1901 if (options->
IsDefined(
"CVMFS_NOTIFICATION_SERVER")) {
1903 options->
GetValue(
"CVMFS_NOTIFICATION_SERVER", &config);
2025 if (strcmp(argv[1],
"__cachemgr__") == 0) {
2028 if (strcmp(argv[1],
"__wpad__") == 0) {
2037 string msg_progress =
"Draining out kernel caches (";
2039 msg_progress +=
"up to ";
2050 string msg_progress;
2053 if (num_open_dirs != 0) {
2055 for (cvmfs::DirectoryHandles::iterator i =
2063 msg_progress =
"Saving open directory handles (" +
2072 save_open_dirs->
state = saved_handles;
2073 saved_states->push_back(save_open_dirs);
2077 msg_progress =
"Saving inode tracker\n";
2083 state_glue_buffer->
state = saved_inode_tracker;
2084 saved_states->push_back(state_glue_buffer);
2087 msg_progress =
"Saving negative entry cache\n";
2093 state_nentry_tracker->
state = saved_nentry_cache;
2094 saved_states->push_back(state_nentry_tracker);
2096 msg_progress =
"Saving page cache entry tracker\n";
2102 state_page_cache_tracker->
state = saved_page_cache_tracker;
2103 saved_states->push_back(state_page_cache_tracker);
2105 msg_progress =
"Saving chunk tables\n";
2111 state_chunk_tables->
state = saved_chunk_tables;
2112 saved_states->push_back(state_chunk_tables);
2114 msg_progress =
"Saving inode generation\n";
2122 state_inode_generation->
state = saved_inode_generation;
2123 saved_states->push_back(state_inode_generation);
2130 state_cache_mgr->
state =
2132 saved_states->push_back(state_cache_mgr);
2134 msg_progress =
"Saving open files counter\n";
2135 uint32_t *saved_num_fd =
2139 state_num_fd->
state = saved_num_fd;
2140 saved_states->push_back(state_num_fd);
2154 for (
unsigned i = 0, l = saved_states.size(); i < l; ++i) {
2156 SendMsg2Socket(fd_progress,
"Restoring open directory handles... ");
2163 cvmfs::DirectoryHandles::const_iterator i =
2175 SendMsg2Socket(fd_progress,
"Migrating inode tracker (v1 to v4)... ");
2184 SendMsg2Socket(fd_progress,
"Migrating inode tracker (v2 to v4)... ");
2193 SendMsg2Socket(fd_progress,
"Migrating inode tracker (v3 to v4)... ");
2212 SendMsg2Socket(fd_progress,
"Restoring negative entry cache... ");
2222 SendMsg2Socket(fd_progress,
"Restoring page cache entry tracker... ");
2234 SendMsg2Socket(fd_progress,
"Migrating chunk tables (v1 to v4)... ");
2243 SendMsg2Socket(fd_progress,
"Migrating chunk tables (v2 to v4)... ");
2252 SendMsg2Socket(fd_progress,
"Migrating chunk tables (v3 to v4)... ");
2264 saved_states[i]->state);
2265 new (chunk_tables)
ChunkTables(*saved_chunk_tables);
2290 saved_states[i]->state)));
2296 fd_progress, saved_states[i]->state);
2299 if (new_root_fd >= 0) {
2316 for (
unsigned i = 0, l = saved_states.size(); i < l; ++i) {
2317 switch (saved_states[i]->state_id) {
2319 SendMsg2Socket(fd_progress,
"Releasing saved open directory handles\n");
2324 fd_progress,
"Releasing saved glue buffer (version 1)\n");
2326 saved_states[i]->state);
2330 fd_progress,
"Releasing saved glue buffer (version 2)\n");
2332 saved_states[i]->state);
2336 fd_progress,
"Releasing saved glue buffer (version 3)\n");
2338 saved_states[i]->state);
2345 SendMsg2Socket(fd_progress,
"Releasing saved negative entry cache\n");
2349 SendMsg2Socket(fd_progress,
"Releasing saved page cache entry cache\n");
2353 SendMsg2Socket(fd_progress,
"Releasing chunk tables (version 1)\n");
2355 saved_states[i]->state);
2358 SendMsg2Socket(fd_progress,
"Releasing chunk tables (version 2)\n");
2360 saved_states[i]->state);
2363 SendMsg2Socket(fd_progress,
"Releasing chunk tables (version 3)\n");
2365 saved_states[i]->state);
2369 delete static_cast<ChunkTables *
>(saved_states[i]->state);
2372 SendMsg2Socket(fd_progress,
"Releasing saved inode generation info\n");
2374 saved_states[i]->state);
2378 fd_progress, saved_states[i]->state);
2382 delete static_cast<uint32_t *
>(saved_states[i]->state);
2393 g_cvmfs_exports->so_version = PACKAGE_VERSION;
2395 g_cvmfs_exports->fnInit =
Init;
2396 g_cvmfs_exports->fnSpawn =
Spawn;
2397 g_cvmfs_exports->fnFini =
Fini;
2400 g_cvmfs_exports->fnSaveState =
SaveState;
2408 delete g_cvmfs_exports;
2409 g_cvmfs_exports = NULL;
VfsPutRaii GetVfsPutRaii()
std::string repository_name
OptionsManager * options_mgr()
#define LogCvmfs(source, mask,...)
void Dec(class Counter *counter)
bool IsExternalFile() const
void UnregisterQuotaListener()
static const time_t kIndefiniteDeadline
virtual std::string GetValue()
int64_t Xadd(class Counter *counter, const int64_t delta)
static void cvmfs_getattr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
std::string ListKeysPosix(const std::string &merge_with) const
FileSystem * file_system()
void TryFinish(const shash::Any &root_hash=shash::Any())
bool InsertNegative(const shash::Md5 &hash)
Log2Histogram * hist_fs_opendir()
time_t catalogs_valid_until_
virtual void ParsePath(const std::string &config_file, const bool external)=0
static void cvmfs_read(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi)
static double GetKcacheTimeout()
void SpawnCleaner(unsigned interval_s)
void EnterMaintenanceMode()
void set_inode(const inode_t inode)
InodeGenerationInfo inode_generation_info_
loader::Failures boot_status()
static void FreeSavedState(const int fd_progress, const loader::StateList &saved_states)
static void cvmfs_statfs(fuse_req_t req, fuse_ino_t ino)
void set_boot_status(loader::Failures code)
static void DoTraceInode(const int event, fuse_ino_t ino, const std::string &msg)
cvmfs::Fetcher * fetcher()
void Migrate(ChunkTables *old_tables,::ChunkTables *new_tables)
void ShareBuffer(Item **duplicate, bool *large_alloc)
static void cvmfs_releasedir(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
bool IsChunkedFile() const
FuseRemounter * fuse_remounter_
static Watchdog * Create(const std::string &crash_dump_path)
vector< string > SplitString(const string &str, const char delim, const unsigned max_chunks)
int RestoreState(const int fd_progress, void *state)
void Register(const std::string &name, BaseMagicXattr *magic_xattr)
bool volatile_flag() const
SmallHashDynamic< uint64_t, uint64_t > handle2uniqino
bool Insert(const fuse_ino_t &inode, const catalog::DirectoryEntry &dirent)
google::dense_hash_map< uint64_t, DirectoryListing, hash_murmur< uint64_t > > DirectoryHandles
SpecialDirents GetSpecial() const
static int AltProcessFlavor(int argc, char **argv)
std::string ToString(const bool with_suffix=false) const
double kcache_timeout_sec()
void Assign(const char *chars, const unsigned length)
static void cvmfs_forget(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
std::string PrintInodeGeneration()
zlib::Algorithms compression_alg
int MainResolveProxyDescription(int argc, char **argv)
perf::Counter * n_fs_readlink()
void SetMountpoint(const string &mountpoint)
void set_symlink(const LinkString &symlink)
static void cvmfs_release(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
BaseMagicXattr * GetLocked(const std::string &name, PathString path, catalog::DirectoryEntry *d)
bool Lookup(const shash::Md5 &hash, catalog::DirectoryEntry *dirent, bool update_lru=true)
lru::InodeCache * inode_cache()
NotificationClient * notification_client_
void * SaveState(const int fd_progress)
DirectoryHandles * directory_handles_
const shash::Any & content_hash() const
time_t catalogs_valid_until()
static bool SaveState(const int fd_progress, loader::StateList *saved_states)
void SendMsg2Socket(const int fd, const std::string &msg)
bool ListingStat(const PathString &path, StatEntryList *listing)
assert((mem||(size==0))&&"Out Of Memory")
void ** fuse_channel_or_session
MountPoint * mount_point_
MagicXattrManager * magic_xattr_mgr()
Log2Histogram * hist_fs_read()
bool SendFd2Socket(int socket_fd, int passing_fd)
bool LookupPath(const PathString &path, const LookupOptions options, DirectoryEntry *entry)
std::string GetParentPath(const std::string &path)
static bool RestoreState(const int fd_progress, const loader::StateList &saved_states)
virtual uint64_t GetSize()=0
perf::Counter * n_fs_read()
bool Lookup(const fuse_ino_t &inode, catalog::DirectoryEntry *dirent, bool update_lru=true)
lru::Md5PathCache * md5path_cache()
shash::Any checksum() const
void ParseDefault(const std::string &fqrn)
SmallHashDynamic< uint64_t, ChunkFd > handle2fd
bool VfsPut(const uint64_t inode, const uint32_t by)
static bool GetDirentForPath(const PathString &path, catalog::DirectoryEntry *dirent)
void Migrate(InodeTracker *old_tracker, glue::InodeTracker *new_tracker)
bool has_membership_req()
virtual bool PrepareValueFenced()
virtual std::string GetValue()
struct cvmcache_object_info __attribute__
void RemapCatalogFd(int from, int to)
bool Pin(const string &path)
static void cvmfs_destroy(void *unused __attribute__((unused)))
static TalkManager * Create(const std::string &socket_path, MountPoint *mount_point, FuseRemounter *remounter)
static bool HasFuseNotifyInval()
perf::Counter * n_fs_open()
static void cvmfs_init(void *userdata, struct fuse_conn_info *conn)
virtual uint64_t GetCapacity()=0
std::string membership_req()
std::string GetListString(catalog::DirectoryEntry *dirent)
bool Lookup(const fuse_ino_t &inode, PathString *path, bool update_lru=true)
uint64_t next_directory_handle_
static void InitOptionsMgr(const loader::LoaderExports *loader_exports)
OpenDirectives Open(uint64_t inode, const shash::Any &hash)
static bool GetDirentForInode(const fuse_ino_t ino, catalog::DirectoryEntry *dirent)
glue::PageCacheTracker * page_cache_tracker()
void SetBit(unsigned int bit, T *field)
BigVector< FileChunk > FileChunkList
virtual std::string GetValue()
static void TraceInode(const int event, fuse_ino_t ino, const std::string &msg)
bool Get(const std::string &key, std::string *value) const
catalog::ClientCatalogManager * catalog_mgr()
void Set(const int64_t val)
Log2Histogram * hist_fs_forget_multi()
static void cvmfs_listxattr(fuse_req_t req, fuse_ino_t ino, size_t size)
void ClearBit(unsigned int bit, T *field)
Log2Histogram * hist_fs_release()
pthread_mutex_t * Handle2Lock(const uint64_t handle) const
uint64_t FindInode(const PathString &path)
ListenerHandle * RegisterWatchdogListener(QuotaManager *quota_manager, const string &repository_name)
const loader::LoaderExports * loader_exports_
virtual inode_t GetGeneration()=0
perf::Counter * no_open_dirs()
catalog::InodeAnnotation * inode_annotation()
Log2Histogram * hist_fs_releasedir()
quota::ListenerHandle * watchdog_listener_
void SetSize(const size_t new_size)
lru::PathCache * path_cache()
glue::NentryTracker * nentry_tracker()
virtual std::string GetValue()
static void cvmfs_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
zlib::Algorithms compression_algorithm() const
unsigned GetMaxOpenFiles()
CacheManager * cache_mgr()
const signature::SignatureManager * signature_mgr() const
file_watcher::FileWatcher * resolv_conf_watcher()
virtual bool Pin(const shash::Any &hash, const uint64_t size, const std::string &description, const bool is_catalog)=0
bool IsMemberOf(const pid_t pid, const std::string &membership)
virtual std::string GetValue()
void Migrate(InodeTracker *old_tracker, glue::InodeTracker *new_tracker)
static void ShutdownMountpoint()
unsigned FindChunkIdx(const uint64_t offset)
bool SendFuseFd(const std::string &socket_path)
perf::Counter * no_open_files()
AuthzSessionManager * authz_session_mgr()
LinkString symlink() const
void Insert(const Key &key, const Value &value)
IoErrorInfo * io_error_info()
download::DownloadManager * download_mgr()
static void SetCvmfsOperations(struct fuse_lowlevel_ops *cvmfs_operations)
bool simple_options_parsing
perf::Counter * n_fs_forget()
Log2Histogram * hist_fs_readlink()
static int Init(const loader::LoaderExports *loader_exports)
void Append(const char *chars, const unsigned length)
ListenerHandle * RegisterUnpinListener(QuotaManager *quota_manager, CatalogManager *catalog_manager, const string &repository_name)
string StringifyInt(const int64_t value)
SmallHashDynamic< uint64_t, uint32_t > inode2references
static void cvmfs_readlink(fuse_req_t req, fuse_ino_t ino)
static void ReplyNegative(const catalog::DirectoryEntry &dirent, fuse_req_t req)
void Inc(class Counter *counter)
virtual int Close(int fd)=0
bool GetValue(const std::string &key, std::string *value) const
static void cvmfs_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi)
uint64_t initial_revision
ChunkTables * chunk_tables()
pthread_mutex_t lock_directory_handles_
static void cvmfs_opendir(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
OptionsManager * options_mgr_
virtual bool GetPath(const uint64_t inode, PathString *path)=0
shash::Algorithms hash_algorithm() const
static int MainCacheManager(int argc, char **argv)
perf::Counter * n_fs_dir_open()
Log2Histogram * hist_fs_readdir()
cvmfs::Fetcher * external_fetcher()
bool IsInMaintenanceMode()
static bool CheckVoms(const fuse_ctx &fctx)
static void FillOpenFlags(const glue::PageCacheTracker::OpenDirectives od, struct fuse_file_info *fi)
void FreeState(const int fd_progress, void *state)
static FileSystem * Create(const FileSystemInfo &fs_info)
bool Contains(const Key &key) const
Log2Histogram * hist_fs_open()
void Add(const uint64_t inode_parent, const char *name, uint64_t timeout_s)
bool FindPath(const uint64_t inode, PathString *path)
std::string ToString() const
QuotaManager * quota_mgr()
static string GetErrorMsg()
uint64_t GetRevision() const
int ConnectSocket(const std::string &path)
void Migrate(ChunkTables *old_tables,::ChunkTables *new_tables)
void Evict(uint64_t inode)
void RegisterOnCrash(void(*CleanupOnCrash)(void))
Log2Histogram * hist_fs_lookup()
bool TestBit(unsigned int bit, const T field)
void Close(uint64_t inode)
bool ListFileChunks(const PathString &path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks)
perf::Counter * n_fs_lookup()
static bool UseWatchdog()
void Migrate(InodeTracker *old_tracker, glue::InodeTracker *new_tracker)
OpenDirectives OpenDirect()
ShortString< kDefaultMaxPath, 0 > PathString
shash::Any HashChunkList()
void UnregisterListener(ListenerHandle *handle)
bool Evict(const string &path)
std::vector< SavedState * > StateList
FileSystem * file_system_
virtual bool PrepareValueFenced()
void GetReloadStatus(bool *drainout_mode, bool *maintenance_mode)
bool Erase(const Key &key)
bool LookupXattrs(const PathString &path, XattrList *xattrs)
perf::Counter * n_fs_lookup_negative()
uint64_t all_inodes() const
virtual uint64_t GetInode(const PathString &path)=0
Log2Histogram * hist_fs_forget()
static void ReplyBufferSlice(const fuse_req_t req, const char *buffer, const size_t buffer_size, const off_t offset, const size_t max_size)
inode_t GetRootInode() const
void VfsGet(const uint64_t inode, const PathString &path)
unsigned GetLength() const
virtual void IncGeneration(const uint64_t by)=0
bool Lookup(const Key &key, Value *value) const
inode_t MangleInode(const inode_t inode) const
uint64_t inode_generation
bool Insert(const fuse_ino_t &inode, const PathString &path)
BackoffThrottle * backoff_throttle()
Log2Histogram * hist_fs_getattr()
const char * c_str() const
static bool GetPathForInode(const fuse_ino_t ino, PathString *path)
static const unsigned int kBitDirectIo
const char * GetChars() const
static void RegisterMagicXattrs()
bool IsDefined(const std::string &key)
virtual void Remove(const shash::Any &file)=0
glue::InodeTracker * inode_tracker()
bool Insert(const shash::Md5 &hash, const catalog::DirectoryEntry &dirent)
perf::Counter * n_fs_stat()
static void cvmfs_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
virtual int64_t Pread(int fd, void *buf, uint64_t size, uint64_t offset)=0
SmallHashDynamic< uint64_t, FileChunkReflist > inode2chunks
static bool MaintenanceMode(const int fd_progress)
uint64_t loaded_inodes() const
void Migrate(ChunkTables *old_tables,::ChunkTables *new_tables)
static FileSystem * InitSystemFs(const string &mount_path, const string &fqrn, FileSystem::FileSystemInfo fs_info)
const Item * AtPtr(const size_t index) const
static void cvmfs_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name, size_t size)
struct stat GetStatStructure() const
virtual bool HasCapability(Capabilities capability)=0
static void AddToDirListing(const fuse_req_t req, const char *name, const struct stat *stat_info, BigVector< char > *listing)
download::DownloadManager * external_download_mgr()
int Fetch(const shash::Any &id, const uint64_t size, const std::string &name, const zlib::Algorithms compression_algorithm, const CacheManager::ObjectType object_type, const std::string &alt_url="", off_t range_offset=-1)
quota::ListenerHandle * unpin_listener_
static MountPoint * Create(const std::string &fqrn, FileSystem *file_system, OptionsManager *options_mgr=NULL)
OptionsManager * options_mgr