CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sync_union_overlayfs.h
Go to the documentation of this file.
1 
9 #ifndef CVMFS_SYNC_UNION_OVERLAYFS_H_
10 #define CVMFS_SYNC_UNION_OVERLAYFS_H_
11 
12 #include "sync_union.h"
13 
14 #include <set>
15 #include <string>
16 
17 #include "util/shared_ptr.h"
18 
19 namespace publish {
20 
25 class SyncUnionOverlayfs : public SyncUnion {
26  public:
27  SyncUnionOverlayfs(SyncMediator *mediator, const std::string &rdonly_path,
28  const std::string &union_path,
29  const std::string &scratch_path);
30 
31  bool Initialize();
32 
33  void Traverse();
34  static bool ReadlinkEquals(std::string const &path,
35  std::string const &compare_value);
36  static bool HasXattr(std::string const &path, std::string const &attr_name);
37 
38  protected:
39  void PreprocessSyncItem(SharedPtr<SyncItem> entry) const;
40 
41  bool IsWhiteoutEntry(SharedPtr<SyncItem> entry) const;
42  bool IsOpaqueDirectory(SharedPtr<SyncItem> directory) const;
43  bool IsWhiteoutSymlinkPath(const std::string &path) const;
44 
45  std::string UnwindWhiteoutFilename(SharedPtr<SyncItem> entry) const;
46  std::set<std::string> GetIgnoreFilenames() const;
47 
49  void MaskFileHardlinks(SharedPtr<SyncItem> entry) const;
50 
51  bool ObtainSysAdminCapability() const;
52 
53  private:
54  bool IsOpaqueDirPath(const std::string &path) const;
55 
56  std::set<std::string> hardlink_lower_files_;
58 }; // class SyncUnionOverlayfs
59 } // namespace publish
60 
61 #endif // CVMFS_SYNC_UNION_OVERLAYFS_H_
bool IsWhiteoutSymlinkPath(const std::string &path) const
void PreprocessSyncItem(SharedPtr< SyncItem > entry) const
bool IsOpaqueDirectory(SharedPtr< SyncItem > directory) const
std::string scratch_path() const
Definition: sync_union.h:98
static bool HasXattr(std::string const &path, std::string const &attr_name)
std::string UnwindWhiteoutFilename(SharedPtr< SyncItem > entry) const
std::string union_path() const
Definition: sync_union.h:97
bool IsOpaqueDirPath(const std::string &path) const
void MaskFileHardlinks(SharedPtr< SyncItem > entry) const
std::set< std::string > hardlink_lower_files_
void CheckForBrokenHardlink(SharedPtr< SyncItem > entry) const
SyncUnionOverlayfs(SyncMediator *mediator, const std::string &rdonly_path, const std::string &union_path, const std::string &scratch_path)
static bool ReadlinkEquals(std::string const &path, std::string const &compare_value)
std::set< std::string > GetIgnoreFilenames() const
std::string rdonly_path() const
Definition: sync_union.h:96
bool IsWhiteoutEntry(SharedPtr< SyncItem > entry) const