CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
helpers.h
Go to the documentation of this file.
1 
4 #ifndef CVMFS_SHRINKWRAP_POSIX_HELPERS_H_
5 #define CVMFS_SHRINKWRAP_POSIX_HELPERS_H_
6 
7 #include <sys/stat.h>
8 #include <sys/types.h>
9 
10 #include <map>
11 #include <string>
12 
13 #include "statistics.h"
14 
15 #define WARNING_FILE_NAME "DO_NOT_MODIFY_THIS_IS_AN_AUTOGENERATED_DIRECTORY"
16 #define POSIX_GARBAGE_DIR "/.garbage"
17 #define POSIX_GARBAGE_FLAGGED_FILE "/flagged"
18 #define POSIX_GC_STAT_FILES_REMOVED "Files removed"
19 #define POSIX_GC_STAT_BYTES_REMOVED "Bytes removed"
20 
21 const unsigned kDirLevels = 2;
22 const unsigned kDigitsPerDirLevel = 2;
23 
26  std::map<ino_t, bool> gc_flagged;
27 };
28 
35 
39 std::string BuildPath(struct fs_traversal_context *ctx, const char *dir);
40 std::string BuildHiddenPath(struct fs_traversal_context *ctx,
41  const char *ident);
42 int PosixSetMeta(const char *path,
43  const struct cvmfs_attr *stat_info, bool set_permissions = true);
44 
45 bool BackupMtimes(std::string path, struct utimbuf *mtimes);
46 
47 
48 #endif // CVMFS_SHRINKWRAP_POSIX_HELPERS_H_
std::map< ino_t, bool > gc_flagged
Definition: helpers.h:26
struct cvmcache_context * ctx
void InitialFsOperations(struct fs_traversal_context *ctx)
Definition: helpers.cc:39
int PosixSetMeta(const char *path, const struct cvmfs_attr *stat_info, bool set_permissions)
Definition: helpers.cc:79
void FinalizeFsOperations(struct fs_traversal_context *ctx)
Definition: helpers.cc:45
void InitializeWarningFile(struct fs_traversal_context *ctx)
Definition: helpers.cc:49
const unsigned kDigitsPerDirLevel
Definition: helpers.h:22
std::string BuildPath(struct fs_traversal_context *ctx, const char *dir)
Definition: helpers.cc:61
const unsigned kDirLevels
Definition: helpers.h:21
bool BackupMtimes(std::string path, struct utimbuf *mtimes)
Definition: helpers.cc:116
std::string BuildHiddenPath(struct fs_traversal_context *ctx, const char *ident)
Definition: helpers.cc:72