CernVM-FS
2.12.0
|
#include <sync_union_overlayfs.h>
Public Member Functions | |
SyncUnionOverlayfs (SyncMediator *mediator, const std::string &rdonly_path, const std::string &union_path, const std::string &scratch_path) | |
bool | Initialize () |
void | Traverse () |
Public Member Functions inherited from publish::SyncUnion | |
SyncUnion (AbstractSyncMediator *mediator, const std::string &rdonly_path, const std::string &union_path, const std::string &scratch_path) | |
virtual | ~SyncUnion () |
virtual void | PostUpload () |
SharedPtr< SyncItem > | CreateSyncItem (const std::string &relative_parent_path, const std::string &filename, const SyncItemType entry_type) const |
std::string | rdonly_path () const |
std::string | union_path () const |
std::string | scratch_path () const |
virtual bool | IgnoreFilePredicate (const std::string &parent_dir, const std::string &filename) |
bool | IsInitialized () const |
virtual bool | SupportsHardlinks () const |
Static Public Member Functions | |
static bool | ReadlinkEquals (std::string const &path, std::string const &compare_value) |
static bool | HasXattr (std::string const &path, std::string const &attr_name) |
Protected Member Functions | |
void | PreprocessSyncItem (SharedPtr< SyncItem > entry) const |
bool | IsWhiteoutEntry (SharedPtr< SyncItem > entry) const |
bool | IsOpaqueDirectory (SharedPtr< SyncItem > directory) const |
bool | IsWhiteoutSymlinkPath (const std::string &path) const |
std::string | UnwindWhiteoutFilename (SharedPtr< SyncItem > entry) const |
std::set< std::string > | GetIgnoreFilenames () const |
void | CheckForBrokenHardlink (SharedPtr< SyncItem > entry) const |
void | MaskFileHardlinks (SharedPtr< SyncItem > entry) const |
bool | ObtainSysAdminCapability () const |
Protected Member Functions inherited from publish::SyncUnion | |
virtual void | ProcessRegularFile (const std::string &parent_dir, const std::string &filename) |
virtual bool | ProcessDirectory (const std::string &parent_dir, const std::string &dir_name) |
virtual bool | ProcessDirectory (SharedPtr< SyncItem > entry) |
virtual bool | ProcessUnmaterializedDirectory (SharedPtr< SyncItem > entry) |
virtual void | ProcessSymlink (const std::string &parent_dir, const std::string &link_name) |
virtual void | EnterDirectory (const std::string &parent_dir, const std::string &dir_name) |
virtual void | LeaveDirectory (const std::string &parent_dir, const std::string &dir_name) |
void | ProcessCharacterDevice (const std::string &parent_dir, const std::string &filename) |
void | ProcessBlockDevice (const std::string &parent_dir, const std::string &filename) |
void | ProcessFifo (const std::string &parent_dir, const std::string &filename) |
void | ProcessSocket (const std::string &parent_dir, const std::string &filename) |
void | ProcessFile (SharedPtr< SyncItem > entry) |
Private Member Functions | |
bool | IsOpaqueDirPath (const std::string &path) const |
Private Attributes | |
std::set< std::string > | hardlink_lower_files_ |
uint64_t | hardlink_lower_inode_ |
Additional Inherited Members | |
Protected Attributes inherited from publish::SyncUnion | |
std::string | rdonly_path_ |
std::string | scratch_path_ |
std::string | union_path_ |
AbstractSyncMediator * | mediator_ |
Syncing a cvmfs repository by the help of an overlaid overlayfs read-write volume.
Definition at line 25 of file sync_union_overlayfs.h.
publish::SyncUnionOverlayfs::SyncUnionOverlayfs | ( | SyncMediator * | mediator, |
const std::string & | rdonly_path, | ||
const std::string & | union_path, | ||
const std::string & | scratch_path | ||
) |
Definition at line 21 of file sync_union_overlayfs.cc.
|
protected |
Definition at line 124 of file sync_union_overlayfs.cc.
Referenced by PreprocessSyncItem().
|
protected |
|
static |
Checks if a given file path has a specified extended attribute attached.
[in] | path | to the file to be checked |
[in] | attr_name | fully qualified name of the extend attribute (i.e. trusted.overlay.opaque) |
Definition at line 218 of file sync_union_overlayfs.cc.
Referenced by IsOpaqueDirPath().
|
virtual |
Initialize internal state of the synchronisation. This needs to be called before running anything else. Note: should be up-called!
Reimplemented from publish::SyncUnion.
Definition at line 28 of file sync_union_overlayfs.cc.
|
protectedvirtual |
Union file systems use opaque directories to fully support rmdir e.g: $ rm -rf directory $ mkdir directory This would produce an opaque directory whose contents are NOT merged with the underlying directory in the read-only branch
directory | the directory to check for opacity |
Implements publish::SyncUnion.
Definition at line 274 of file sync_union_overlayfs.cc.
|
private |
Definition at line 280 of file sync_union_overlayfs.cc.
Referenced by IsOpaqueDirectory().
|
protectedvirtual |
Checks if given file is supposed to be whiteout. These files indicate that a specific file has been deleted.
filename | the filename to check |
There seem to be two versions of overlayfs out there and in production:
Implements publish::SyncUnion.
Definition at line 235 of file sync_union_overlayfs.cc.
|
protected |
Definition at line 260 of file sync_union_overlayfs.cc.
Referenced by IsWhiteoutEntry().
Definition at line 141 of file sync_union_overlayfs.cc.
Referenced by PreprocessSyncItem().
|
protected |
Definition at line 107 of file sync_union_overlayfs.cc.
Referenced by Initialize().
|
protectedvirtual |
Allow for preprocessing steps before emitting any SyncItems from SyncUnion. This can be overridden by sub-classes but should always be up-called. Typi- cally this sets whiteout and opaque-directory flags or handles hardlinks.
entry | the SyncItem to be pre-processed (pointer parameter for google style guide compliance [1]) [1] https://google-styleguide.googlecode.com/svn/trunk/ cppguide.html::Function_Parameter_Ordering |
Reimplemented from publish::SyncUnion.
Definition at line 114 of file sync_union_overlayfs.cc.
|
static |
Wrapper around readlink to read the value of the symbolic link and return true if it is equal to the supplied value, or false otherwise (including if any errors occur)
[in] | path | to the symbolic link |
[in] | value | to compare to link value |
Definition at line 184 of file sync_union_overlayfs.cc.
Referenced by IsWhiteoutSymlinkPath().
|
virtual |
Main routine, process scratch space
Implements publish::SyncUnion.
Definition at line 153 of file sync_union_overlayfs.cc.
|
protectedvirtual |
Whiteout files may have special naming conventions. This method "unmangles" them and retrieves the original file name
filename | the filename as in the scratch directory |
Implements publish::SyncUnion.
Definition at line 289 of file sync_union_overlayfs.cc.
|
private |
Definition at line 56 of file sync_union_overlayfs.h.
|
private |
Definition at line 57 of file sync_union_overlayfs.h.