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>
45 #include <sys/errno.h>
47 #include <sys/mount.h>
48 #include <sys/resource.h>
51 #include <sys/types.h>
176 virtual bool IsCanceled() {
return fuse_req_interrupted(*req_ptr_); }
206 return "init-catalog-revision: " +
208 "current-catalog-revision: " +
221 "properties", mreq.c_str());
237 const struct stat &info)
267 dirent->
inode(), &hash_open, &info);
302 *dirent = dirent_negative;
321 "GetDirentForInode: Race condition? Not found dirent %s",
337 "GetDirentForInode inode lookup failure %" PRId64, ino);
338 *dirent = dirent_negative;
347 "Warning: inode %" PRId64
" (%s) changed file type",
375 uint64_t live_inode = 0;
399 }
else if (live_inode != 0) {
403 "content of %s change, replacing inode %" PRIu64
" --> %" PRIu64,
446 "GetPathForInode: Race condition? "
447 "Inode not found in inode tracker at path %s",
459 const std::string &msg)
465 "Tracing: Could not find path for inode %" PRIu64, uint64_t(ino));
474 const std::string &msg)
484 static void cvmfs_lookup(fuse_req_t req, fuse_ino_t parent,
const char *name) {
488 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
490 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
496 fuse_ino_t parent_fuse = parent;
499 "cvmfs_lookup in parent inode: %" PRIu64
" for name: %s",
500 uint64_t(parent), name);
504 uint64_t live_inode = 0;
506 struct fuse_entry_param result;
508 memset(&result, 0,
sizeof(result));
510 result.attr_timeout = timeout;
511 result.entry_timeout = timeout;
514 if ((strcmp(name,
".") == 0) || (strcmp(name,
"..") == 0)) {
516 if (strcmp(name,
".") == 0) {
517 goto lookup_reply_positive;
522 goto lookup_reply_positive;
525 goto lookup_reply_negative;
527 goto lookup_reply_positive;
532 goto lookup_reply_negative;
534 goto lookup_reply_error;
540 goto lookup_reply_negative;
545 path.
Append(name, strlen(name));
548 if (live_inode == 0) {
550 goto lookup_reply_negative;
552 goto lookup_reply_error;
555 lookup_reply_positive:
557 if (live_inode > 1) {
580 static_cast<uint64_t>(timeout));
584 result.ino = dirent.
inode();
586 fuse_reply_entry(req, &result);
589 lookup_reply_negative:
595 fuse_reply_entry(req, &result);
605 fuse_reply_err(req, EIO);
615 #
if CVMFS_USE_LIBFUSE == 2
616 unsigned long nlookup
626 if (ino == FUSE_ROOT_ID) {
627 fuse_reply_none(req);
635 #if CVMFS_USE_LIBCVMFS == 2
637 uint64_t(ino), nlookup);
640 uint64_t(ino), nlookup);
649 fuse_reply_none(req);
653 #if (FUSE_VERSION >= 29)
654 static void cvmfs_forget_multi(
657 struct fuse_forget_data *forgets
663 fuse_reply_none(req);
673 for (
size_t i = 0; i < count; ++i) {
674 if (forgets[i].ino == FUSE_ROOT_ID) {
680 ino, forgets[i].nlookup);
682 bool removed = vfs_put_raii.
VfsPut(ino, forgets[i].nlookup);
684 evict_raii.
Evict(ino);
689 fuse_reply_none(req);
691 #endif // FUSE_VERSION >= 29
704 fuse_reply_err(req, ENOENT);
706 const char * name = dirent.
name().
c_str();
710 "EIO (02) name=%s symlink=%s",
711 name ? name:
"<unset>",
712 link ? link:
"<unset>");
716 fuse_reply_err(req, EIO);
725 struct fuse_file_info *fi)
730 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
732 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
742 fuse_reply_err(req, EACCES);
753 "served from page cache tracker", ino);
767 dirent.
inode(), &parent_ino, &name))
797 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
799 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
817 fuse_reply_err(req, EINVAL);
826 const char *name,
const struct stat *stat_info,
830 name, uint64_t(stat_info->st_ino));
831 size_t remaining_size = listing->
capacity() - listing->
size();
832 const size_t entry_size = fuse_add_direntry(req, NULL, 0, name, stat_info, 0);
834 while (entry_size > remaining_size) {
842 fuse_add_direntry(req, buffer + listing->
size(),
843 remaining_size, name, stat_info,
844 listing->
size() + entry_size);
853 struct fuse_file_info *fi)
857 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
859 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
869 fuse_reply_err(req, EACCES);
879 fuse_reply_err(req, ENOENT);
891 fuse_reply_err(req, ENOTDIR);
896 uint64_t(ino), path.
c_str());
917 bool retval = catalog_mgr->
ListingStat(path, &listing_from_catalog);
921 fuse_listing.Clear();
924 "EIO (03) on %s", path.
c_str());
927 fuse_reply_err(req, EIO);
930 for (
unsigned i = 0; i < listing_from_catalog.
size(); ++i) {
934 entry_path.
Append(
"/", 1);
935 entry_path.
Append(listing_from_catalog.
AtPtr(i)->name.GetChars(),
936 listing_from_catalog.
AtPtr(i)->name.GetLength());
945 struct stat fixed_info = listing_from_catalog.
AtPtr(i)->info;
946 fixed_info.st_ino = entry_dirent.
inode();
948 &fixed_info, &fuse_listing);
953 stream_listing.
size = fuse_listing.size();
954 stream_listing.
capacity = fuse_listing.capacity();
956 fuse_listing.ShareBuffer(&stream_listing.
buffer, &large_alloc);
964 "linking directory handle %d to dir inode: %" PRIu64,
973 #if (FUSE_VERSION >= 30)
974 #ifdef CVMFS_ENABLE_FUSE3_CACHE_READDIR
978 fi->cache_readdir = 1;
981 fuse_reply_open(req, fi);
989 struct fuse_file_info *fi)
995 ", handle %d", uint64_t(ino), fi->fh);
1003 if (iter_handle->second.capacity == 0)
1004 smunmap(iter_handle->second.buffer);
1006 free(iter_handle->second.buffer);
1014 fuse_reply_err(req, reply);
1022 const size_t buffer_size,
const off_t offset,
1023 const size_t max_size)
1025 if (offset < static_cast<int>(buffer_size)) {
1026 fuse_reply_buf(req, buffer + offset,
1027 std::min(static_cast<size_t>(buffer_size - offset), max_size));
1029 fuse_reply_buf(req, NULL, 0);
1038 off_t off,
struct fuse_file_info *fi)
1043 "cvmfs_readdir on inode %" PRIu64
" reading %d bytes from offset %d",
1049 DirectoryHandles::const_iterator iter_handle =
1052 listing = iter_handle->second;
1058 fuse_reply_err(req, EINVAL);
1062 struct fuse_file_info *fi)
1076 static const uint64_t kFileHandleIgnore =
static_cast<uint64_t
>(2) << 60;
1086 struct fuse_file_info *fi)
1090 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1092 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
1106 fuse_reply_err(req, ENOENT);
1118 fuse_reply_err(req, EACCES);
1130 if ((fi->flags & O_SHLOCK) || (fi->flags & O_EXLOCK)) {
1132 fuse_reply_err(req, EOPNOTSUPP);
1135 if (fi->flags & O_SYMLINK) {
1137 fi->fh = kFileHandleIgnore;
1138 fuse_reply_open(req, fi);
1142 if (fi->flags & O_EXCL) {
1144 fuse_reply_err(req, EEXIST);
1162 "chunked file %s opened (download delayed to read() call)",
1171 fuse_reply_err(req, EMFILE);
1183 "chunked file %s vanished unexpectedly", path.
c_str());
1184 fuse_reply_err(req, ENOENT);
1187 const uint64_t unique_inode = dirent_origin.
inode();
1190 chunk_tables->
Lock();
1202 "EIO (04) file %s is marked as 'chunked', but no chunks found.",
1206 fuse_reply_err(req, EIO);
1211 chunk_tables->
Lock();
1237 "linking chunk handle %d to unique inode: %" PRIu64,
1238 chunk_tables->
next_handle, uint64_t(unique_inode));
1258 fi->fh =
static_cast<uint64_t
>(-
static_cast<int64_t
>(fi->fh));
1262 fuse_reply_open(req, fi);
1269 fd = this_fetcher->
Fetch(
1285 fuse_reply_open(req, fi);
1291 fuse_reply_err(req, EMFILE);
1299 "failed to open inode: %" PRIu64
", CAS key %s, error code %d",
1301 if (errno == EMFILE) {
1302 fuse_reply_err(req, EMFILE);
1309 if (EIO == errno || EIO == -fd) {
1311 "EIO (06) on %s", path.
c_str() );
1316 fuse_reply_err(req, -fd);
1324 struct fuse_file_info *fi)
1329 "cvmfs_read inode: %" PRIu64
" reading %d bytes from offset %d "
1335 if (fi->fh == kFileHandleIgnore) {
1336 fuse_reply_err(req, EBADF);
1342 char *data =
static_cast<char *
>(alloca(size));
1343 unsigned int overall_bytes_fetched = 0;
1345 int64_t fd =
static_cast<int64_t
>(fi->fh);
1346 uint64_t abs_fd = (fd < 0) ? -fd : fd;
1351 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1353 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
1355 const uint64_t chunk_handle = abs_fd;
1356 uint64_t unique_inode;
1363 chunk_tables->
Lock();
1376 pthread_mutex_t *handle_lock = chunk_tables->
Handle2Lock(chunk_handle);
1378 chunk_tables->
Lock();
1384 off_t offset_in_chunk = off - chunks.
list->
AtPtr(chunk_idx)->
offset();
1387 if ((chunk_fd.
fd == -1) || (chunk_fd.
chunk_idx != chunk_idx)) {
1389 string verbose_path =
"Part of " + chunks.
path.
ToString();
1411 if (chunk_fd.
fd < 0) {
1413 chunk_tables->
Lock();
1421 fuse_reply_err(req, EIO);
1430 const size_t bytes_to_read = size - overall_bytes_fetched;
1431 const size_t remaining_bytes_in_chunk =
1433 size_t bytes_to_read_in_chunk =
1434 std::min(bytes_to_read, remaining_bytes_in_chunk);
1437 data + overall_bytes_fetched,
1438 bytes_to_read_in_chunk,
1441 if (bytes_fetched < 0) {
1444 chunk_tables->
Lock();
1447 if ( EIO == errno || EIO == -bytes_fetched ) {
1453 fuse_reply_err(req, -bytes_fetched);
1456 overall_bytes_fetched += bytes_fetched;
1460 offset_in_chunk = 0;
1461 }
while ((overall_bytes_fetched < size) &&
1462 (chunk_idx < chunks.list->
size()));
1465 chunk_tables->
Lock();
1473 if ( EIO == errno || EIO == -nbytes ) {
1478 "EIO (08) on %s", path.
ToString().c_str() );
1481 "EIO (08) on <unknown inode>");
1486 fuse_reply_err(req, -nbytes);
1489 overall_bytes_fetched = nbytes;
1493 fuse_reply_buf(req, data, overall_bytes_fetched);
1495 overall_bytes_fetched);
1503 struct fuse_file_info *fi)
1512 if (fi->fh == kFileHandleIgnore) {
1513 fuse_reply_err(req, 0);
1518 int64_t fd =
static_cast<int64_t
>(fi->fh);
1519 uint64_t abs_fd = (fd < 0) ? -fd : fd;
1527 const uint64_t chunk_handle = abs_fd;
1530 uint64_t unique_inode;
1537 chunk_tables->
Lock();
1554 uint64_t(unique_inode));
1560 delete to_delete.
list;
1566 if (chunk_fd.
fd != -1)
1574 fuse_reply_err(req, 0);
1610 fuse_reply_statfs(req, info);
1614 uint64_t available = 0;
1618 info->f_bsize = info->f_frsize = 512;
1620 if (capacity == (uint64_t)(-1)) {
1622 info->f_blocks = size / info->f_bsize;
1625 info->f_blocks = capacity / info->f_bsize;
1626 available = capacity -
size;
1629 info->f_bfree = info->f_bavail = available / info->f_bsize;
1635 info->f_files = all_inodes;
1636 info->f_ffree = info->f_favail = all_inodes - loaded_inode;
1643 fuse_reply_statfs(req, info);
1647 static void cvmfs_getxattr(fuse_req_t req, fuse_ino_t ino,
const char *name,
1648 size_t size, uint32_t position)
1654 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1656 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
1662 "cvmfs_getxattr on inode: %" PRIu64
" for xattr: %s",
1663 uint64_t(ino), name);
1666 fuse_reply_err(req, EACCES);
1671 const string attr = name;
1684 retval = catalog_mgr->
LookupPath(path, lookup_options, &raw_symlink);
1692 "cvmfs_statfs: Race condition? "
1693 "LookupXattrs did not succeed for path %s",
1696 fuse_reply_err(req, ESTALE);
1700 bool magic_xattr_success =
true;
1703 if (!magic_xattr.IsNull()) {
1704 magic_xattr_success = magic_xattr->
1705 PrepareValueFencedProtected(fuse_ctx->gid);
1715 if (!magic_xattr_success) {
1720 string attribute_value;
1722 if (!magic_xattr.IsNull()) {
1723 attribute_value = magic_xattr->GetValue();
1725 if (!xattrs.
Get(attr, &attribute_value)) {
1732 fuse_reply_xattr(req, attribute_value.length());
1733 }
else if (size >= attribute_value.length()) {
1734 fuse_reply_buf(req, &attribute_value[0], attribute_value.length());
1736 fuse_reply_err(req, ERANGE);
1742 const struct fuse_ctx *fuse_ctx = fuse_req_ctx(req);
1744 ClientCtxGuard ctx_guard(fuse_ctx->uid, fuse_ctx->gid, fuse_ctx->pid, &ic);
1751 "cvmfs_listxattr on inode: %" PRIu64
", size %u [visibility %d]",
1752 uint64_t(ino), size,
1758 if (d.HasXattrs()) {
1763 "cvmfs_listxattr: Race condition? "
1764 "GetPathForInode did not succeed for ino %lu",
1767 fuse_reply_err(req, ESTALE);
1773 "cvmfs_listxattr: Race condition? "
1774 "LookupXattrs did not succeed for ino %lu",
1777 fuse_reply_err(req, ESTALE);
1788 string attribute_list;
1793 fuse_reply_xattr(req, attribute_list.length());
1794 }
else if (size >= attribute_list.length()) {
1795 if (attribute_list.empty())
1796 fuse_reply_buf(req, NULL, 0);
1798 fuse_reply_buf(req, &attribute_list[0], attribute_list.length());
1800 fuse_reply_err(req, ERANGE);
1821 for (
unsigned i = 0; i < chunks.
size(); ++i) {
1831 bool Pin(
const string &path) {
1847 for (
unsigned i = 0; i < chunks.
size(); ++i) {
1889 int fd = this_fetcher->
Fetch(
1903 static void cvmfs_init(
void *userdata,
struct fuse_conn_info *conn) {
1907 #ifdef CVMFS_NFS_SUPPORT
1908 conn->want |= FUSE_CAP_EXPORT_SUPPORT;
1912 #ifdef FUSE_CAP_POSIX_ACL
1913 if ((conn->capable & FUSE_CAP_POSIX_ACL) == 0) {
1915 "ACL support requested but missing fuse kernel support, "
1918 conn->want |= FUSE_CAP_POSIX_ACL;
1922 "ACL support requested but not available in this version of "
1923 "libfuse, aborting");
1928 #ifdef FUSE_CAP_CACHE_SYMLINKS
1929 if ((conn->capable & FUSE_CAP_CACHE_SYMLINKS) == FUSE_CAP_CACHE_SYMLINKS) {
1930 conn->want |= FUSE_CAP_CACHE_SYMLINKS;
1932 "Enable symlink caching");
1933 #ifndef FUSE_CAP_EXPIRE_ONLY
1935 "FUSE: Symlink caching enabled but no support for fuse_expire_entry, "
1936 "mountpoints on top of symlinks will break!");
1941 "FUSE: Symlink caching requested but missing fuse kernel support, "
1942 "falling back to no caching");
1947 "FUSE: Symlink caching requested but missing libfuse support, "
1948 "falling back to no caching");
1952 #ifdef FUSE_CAP_EXPIRE_ONLY
1953 if ((conn->capable & FUSE_CAP_EXPIRE_ONLY) == FUSE_CAP_EXPIRE_ONLY) {
1956 "Enable fuse_expire_entry");
1959 "FUSE: Symlink caching enabled but no support for fuse_expire_entry, "
1960 "mountpoints on top of symlinks will break!");
1974 memset(cvmfs_operations, 0,
sizeof(*cvmfs_operations));
1993 #if (FUSE_VERSION >= 29)
1994 cvmfs_operations->forget_multi = cvmfs_forget_multi;
2012 #if (FUSE_VERSION >= 30)
2013 fuse_fd = fuse_session_fd(*reinterpret_cast<struct fuse_session**>(
2016 fuse_fd = fuse_chan_fd(*reinterpret_cast<struct fuse_chan**>(
2023 socket_path.c_str(), errno);
2037 loader::CvmfsExports *g_cvmfs_exports = NULL;
2053 return "never (fixed root catalog)";
2055 time_t now = time(NULL);
2056 return StringifyInt( (catalogs_valid_until_ - now) / 60);
2065 xattr_mgr_->mount_point()->catalog_mgr()->inode_gauge());
2081 time_t now = time(NULL);
2107 const string &mount_path,
2115 string fqrn_from_xattr;
2124 if (fqrn_from_xattr == fqrn) {
2126 "repository already mounted on %s", mount_path.c_str());
2130 "CernVM-FS repository %s already mounted on %s",
2131 fqrn.c_str(), mount_path.c_str());
2152 for (
unsigned i = 0, s = tokens.size(); i < s; ++i) {
2162 static unsigned max_open_files;
2163 static bool already_done =
false;
2166 if (!already_done) {
2167 unsigned soft_limit = 0;
2168 unsigned hard_limit = 0;
2173 "Warning: current limits for number of open files are "
2175 "CernVM-FS is likely to run out of file descriptors, "
2176 "set ulimit -n to at least %lu",
2179 max_open_files = soft_limit;
2180 already_done =
true;
2183 return max_open_files;
2239 sizeof(fuse_ino_t) * 8);
2248 void **channel_or_session = NULL;
2249 if (loader_exports->
version >= 4) {
2253 bool fuse_notify_invalidation =
true;
2258 fuse_notify_invalidation =
false;
2264 channel_or_session, fuse_notify_invalidation);
2279 *
g_boot_error = std::string(
"failed to set talk socket ownership - ")
2294 if (options->
IsDefined(
"CVMFS_NOTIFICATION_SERVER")) {
2296 options->
GetValue(
"CVMFS_NOTIFICATION_SERVER", &config);
2424 if (strcmp(argv[1],
"__cachemgr__") == 0) {
2427 if (strcmp(argv[1],
"__wpad__") == 0) {
2436 string msg_progress =
"Draining out kernel caches (";
2438 msg_progress +=
"up to ";
2449 string msg_progress;
2452 if (num_open_dirs != 0) {
2454 for (cvmfs::DirectoryHandles::iterator i =
2462 msg_progress =
"Saving open directory handles (" +
2471 save_open_dirs->
state = saved_handles;
2472 saved_states->push_back(save_open_dirs);
2476 msg_progress =
"Saving inode tracker\n";
2482 state_glue_buffer->
state = saved_inode_tracker;
2483 saved_states->push_back(state_glue_buffer);
2486 msg_progress =
"Saving negative entry cache\n";
2492 state_dentry_tracker->
state = saved_dentry_tracker;
2493 saved_states->push_back(state_dentry_tracker);
2495 msg_progress =
"Saving page cache entry tracker\n";
2501 state_page_cache_tracker->
state = saved_page_cache_tracker;
2502 saved_states->push_back(state_page_cache_tracker);
2504 msg_progress =
"Saving chunk tables\n";
2510 state_chunk_tables->
state = saved_chunk_tables;
2511 saved_states->push_back(state_chunk_tables);
2513 msg_progress =
"Saving inode generation\n";
2521 state_inode_generation->
state = saved_inode_generation;
2522 saved_states->push_back(state_inode_generation);
2529 state_cache_mgr->
state =
2531 saved_states->push_back(state_cache_mgr);
2533 msg_progress =
"Saving open files counter\n";
2534 uint32_t *saved_num_fd =
2538 state_num_fd->
state = saved_num_fd;
2539 saved_states->push_back(state_num_fd);
2553 for (
unsigned i = 0, l = saved_states.size(); i < l; ++i) {
2555 SendMsg2Socket(fd_progress,
"Restoring open directory handles... ");
2562 cvmfs::DirectoryHandles::const_iterator i =
2574 SendMsg2Socket(fd_progress,
"Migrating inode tracker (v1 to v4)... ");
2583 SendMsg2Socket(fd_progress,
"Migrating inode tracker (v2 to v4)... ");
2592 SendMsg2Socket(fd_progress,
"Migrating inode tracker (v3 to v4)... ");
2621 SendMsg2Socket(fd_progress,
"Restoring page cache entry tracker... ");
2633 SendMsg2Socket(fd_progress,
"Migrating chunk tables (v1 to v4)... ");
2642 SendMsg2Socket(fd_progress,
"Migrating chunk tables (v2 to v4)... ");
2651 SendMsg2Socket(fd_progress,
"Migrating chunk tables (v3 to v4)... ");
2663 saved_states[i]->state);
2664 new (chunk_tables)
ChunkTables(*saved_chunk_tables);
2689 saved_states[i]->state)));
2695 fd_progress, saved_states[i]->state);
2698 if (new_root_fd >= 0) {
2715 for (
unsigned i = 0, l = saved_states.size(); i < l; ++i) {
2716 switch (saved_states[i]->state_id) {
2718 SendMsg2Socket(fd_progress,
"Releasing saved open directory handles\n");
2723 fd_progress,
"Releasing saved glue buffer (version 1)\n");
2725 saved_states[i]->state);
2729 fd_progress,
"Releasing saved glue buffer (version 2)\n");
2731 saved_states[i]->state);
2735 fd_progress,
"Releasing saved glue buffer (version 3)\n");
2737 saved_states[i]->state);
2748 SendMsg2Socket(fd_progress,
"Releasing saved page cache entry cache\n");
2752 SendMsg2Socket(fd_progress,
"Releasing chunk tables (version 1)\n");
2754 saved_states[i]->state);
2757 SendMsg2Socket(fd_progress,
"Releasing chunk tables (version 2)\n");
2759 saved_states[i]->state);
2762 SendMsg2Socket(fd_progress,
"Releasing chunk tables (version 3)\n");
2764 saved_states[i]->state);
2768 delete static_cast<ChunkTables *
>(saved_states[i]->state);
2771 SendMsg2Socket(fd_progress,
"Releasing saved inode generation info\n");
2773 saved_states[i]->state);
2777 fd_progress, saved_states[i]->state);
2781 delete static_cast<uint32_t *
>(saved_states[i]->state);
2792 g_cvmfs_exports->so_version = PACKAGE_VERSION;
2794 g_cvmfs_exports->fnInit =
Init;
2795 g_cvmfs_exports->fnSpawn =
Spawn;
2796 g_cvmfs_exports->fnFini =
Fini;
2799 g_cvmfs_exports->fnSaveState =
SaveState;
2807 delete g_cvmfs_exports;
2808 g_cvmfs_exports = NULL;
bool GetInfoIfOpen(uint64_t inode, shash::Any *hash, struct stat *info)
perf::Counter * n_eio_total()
VfsPutRaii GetVfsPutRaii()
std::string repository_name
OptionsManager * options_mgr()
#define LogCvmfs(source, mask,...)
void Dec(class Counter *counter)
bool IsExternalFile() const
perf::Counter * n_eio_05()
void UnregisterQuotaListener()
static const time_t kIndefiniteDeadline
perf::Counter * n_fs_inode_replace()
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
perf::Counter * n_eio_01()
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_
static bool HasDifferentContent(const catalog::DirectoryEntry &dirent, const shash::Any &hash, const struct stat &info)
virtual void ParsePath(const std::string &config_file, const bool external)=0
bool ReplaceInode(uint64_t old_inode, const InodeEx &new_inode)
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 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_
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
static void SetupLoggingStandalone(const OptionsManager &options_mgr, const std::string &prefix)
int MainResolveProxyDescription(int argc, char **argv)
bool FindDentry(uint64_t ino, uint64_t *parent_ino, NameString *name)
perf::Counter * n_fs_readlink()
void SetMountpoint(const string &mountpoint)
void InvalidateDentry(uint64_t parent_ino, const NameString &name)
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_
CVMFS_EXPORT void CleanupLibcryptoMt()
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)
void EnableFuseExpireEntry()
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)
void Migrate(InodeTracker *old_tracker, glue::InodeTracker *new_tracker)
bool has_membership_req()
virtual bool PrepareValueFenced()
virtual std::string GetValue()
unsigned int mode() const
struct cvmcache_object_info __attribute__
const unsigned kLookupDefault
void RemapCatalogFd(int from, int to)
bool Pin(const string &path)
static void cvmfs_destroy(void *unused __attribute__((unused)))
perf::Counter * n_eio_08()
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)
const unsigned int kMinOpenFiles
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)
const uint64_t cache_timeout()
void DisableCacheSymlinks()
static bool GetDirentForInode(const fuse_ino_t ino, catalog::DirectoryEntry *dirent)
glue::PageCacheTracker * page_cache_tracker()
static Watchdog * Create(FnOnCrash on_crash)
void SetBit(unsigned int bit, T *field)
perf::Counter * n_eio_07()
BigVector< FileChunk > FileChunkList
static bool FixupOpenInode(const PathString &path, catalog::DirectoryEntry *dirent)
virtual std::string GetValue()
static void TraceInode(const int event, fuse_ino_t ino, const std::string &msg)
void GetLimitNoFile(unsigned *soft_limit, unsigned *hard_limit)
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)
vector< string > SplitString(const string &str, char delim)
void ClearBit(unsigned int bit, T *field)
static bool MayBeInPageCacheTracker(const catalog::DirectoryEntry &dirent)
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 Add(const uint64_t inode_parent, const char *name, uint64_t timeout_s)
virtual bool IsCanceled()
void SetSize(const size_t new_size)
lru::PathCache * path_cache()
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
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)
void SpawnCleaner(unsigned interval_s)
static void ShutdownMountpoint()
static bool AssertOrLog(int t, const LogSource, const int, const char *,...)
unsigned FindChunkIdx(const uint64_t offset)
perf::TelemetryAggregator * telemetry_aggr()
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()
perf::Counter * n_fs_stat_stale()
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()
const unsigned kLookupRawSymlink
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
glue::DentryTracker * dentry_tracker()
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()
OpenDirectives Open(uint64_t inode, const shash::Any &hash, const struct stat &info)
std::string ToString() const
QuotaManager * quota_mgr()
static string GetErrorMsg()
uint64_t GetRevision() const
static uint64_t GetDirentForPath(const PathString &path, catalog::DirectoryEntry *dirent)
int ConnectSocket(const std::string &path)
void Migrate(ChunkTables *old_tables,::ChunkTables *new_tables)
void Evict(uint64_t inode)
Log2Histogram * hist_fs_lookup()
bool IsCompatibleFileType(unsigned mode) const
bool TestBit(unsigned int bit, const T field)
CVMFS_EXPORT void SetupLibcryptoMt()
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()
FuseInterruptCue(fuse_req_t *r)
void UnregisterListener(ListenerHandle *handle)
bool Evict(const string &path)
std::vector< SavedState * > StateList
perf::Counter * n_eio_02()
PathString GetParentPath(const PathString &path)
static unsigned CheckMaxOpenFiles()
FileSystem * file_system_
perf::Counter * n_eio_03()
perf::Counter * n_eio_04()
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()
StatfsCache * statfs_cache()
uint64_t all_inodes() const
virtual uint64_t GetInode(const PathString &path)=0
void Spawn(const std::string &crash_dump_path)
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
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)
std::string GetCurrentWorkingDirectory()
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()
virtual ~FuseInterruptCue()
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 * expiry_deadline()
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)
void VfsGet(const InodeEx inode_ex, const PathString &path)
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)
perf::Counter * n_fs_statfs_cached()
bool FindPath(InodeEx *inode_ex, PathString *path)
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)
perf::Counter * n_fs_statfs()
quota::ListenerHandle * unpin_listener_
static MountPoint * Create(const std::string &fqrn, FileSystem *file_system, OptionsManager *options_mgr=NULL)
perf::Counter * n_eio_06()
OptionsManager * options_mgr