![]() |
CernVM-FS
2.11.0
|
#include <magic_xattr.h>
Public Member Functions | |
BaseMagicXattr () | |
void | MarkProtected () |
bool | PrepareValueFencedProtected (gid_t gid) |
virtual std::string | GetValue ()=0 |
virtual MagicXattrFlavor | GetXattrFlavor () |
void | Lock (PathString path, catalog::DirectoryEntry *dirent) |
void | Release () |
virtual | ~BaseMagicXattr () |
Protected Member Functions | |
virtual bool | PrepareValueFenced () |
Protected Attributes | |
MagicXattrManager * | xattr_mgr_ |
PathString | path_ |
catalog::DirectoryEntry * | dirent_ |
pthread_mutex_t | access_mutex_ |
bool | is_protected_ |
Private Member Functions | |
FRIEND_TEST (T_MagicXattr, ProtectedXattr) | |
FRIEND_TEST (T_MagicXattr, TestFqrn) | |
FRIEND_TEST (T_MagicXattr, TestLogBuffer) | |
Friends | |
class | MagicXattrManager |
This is a base class for magic extended attribute. Concrete extended attributes inherit from this class. It should be generally used only in cooperation with MagicXattrManager. It contains an access mutex. Users should use Lock() and Release() before and after usage (Lock() is called implicitly in MagicXattrManager).
To read out the attribute value, do: 0. Get an instance through MagicXattrManager::Get()
Definition at line 43 of file magic_xattr.h.
|
inline |
|
inlinevirtual |
Definition at line 91 of file magic_xattr.h.
|
private |
|
private |
|
private |
|
pure virtual |
This function needs to be called after PrepareValueFenced(), which prepares the necessary data. It does the computationaly intensive part, which should not be done inside the FuseRemounter::fence(), and returns the value.
Implemented in UptimeMagicXattr, PidMagicXattr, MaxFdMagicXattr, InodeMaxMagicXattr, ExpiresMagicXattr, ExternalURLMagicXattr, VersionMagicXattr, UsedDirPMagicXattr, UsedFdMagicXattr, TimestampLastIOErrMagicXattr, TimeoutDirectMagicXattr, TimeoutMagicXattr, TagMagicXattr, SpeedMagicXattr, RxMagicXattr, RootHashMagicXattr, RevisionMagicXattr, RepoMetainfoMagicXattr, RepoCountersMagicXattr, RawlinkMagicXattr, PubkeysMagicXattr, ProxyListExternalMagicXattr, ProxyListMagicXattr, ProxyMagicXattr, HitrateMagicXattr, NOpenMagicXattr, NIOErrMagicXattr, NDownloadMagicXattr, NDirOpenMagicXattr, NClgMagicXattr, NCleanup24MagicXattr, LogBufferXattr, LHashMagicXattr, HostListMagicXattr, HostMagicXattr, HashMagicXattr, FqrnMagicXattr, ExternalTimeoutMagicXattr, ExternalHostMagicXattr, ExternalFileMagicXattr, DirectIoMagicXattr, CompressionMagicXattr, ChunksMagicXattr, ChunkListMagicXattr, CatalogCountersMagicXattr, and AuthzMagicXattr.
|
inlinevirtual |
Reimplemented in AuthzMagicXattr, SymlinkMagicXattr, ExternalMagicXattr, RegularMagicXattr, and WithHashMagicXattr.
Definition at line 78 of file magic_xattr.h.
|
inline |
Definition at line 80 of file magic_xattr.h.
Referenced by MagicXattrManager::GetLocked(), and MagicXattrRAIIWrapper::MagicXattrRAIIWrapper().
|
inline |
Mark a Xattr protected so that only certain users with the correct gid can access it.
Definition at line 59 of file magic_xattr.h.
Referenced by MagicXattrManager::Register().
|
inlineprotectedvirtual |
This function is used to obtain the necessary information while inside FuseRemounter::fence(), which should prevent data races.
Reimplemented in ExpiresMagicXattr, ExternalURLMagicXattr, TagMagicXattr, RootHashMagicXattr, RevisionMagicXattr, RepoMetainfoMagicXattr, RepoCountersMagicXattr, RawlinkMagicXattr, PubkeysMagicXattr, NClgMagicXattr, LHashMagicXattr, HashMagicXattr, ExternalFileMagicXattr, DirectIoMagicXattr, CompressionMagicXattr, ChunksMagicXattr, ChunkListMagicXattr, CatalogCountersMagicXattr, and AuthzMagicXattr.
Definition at line 98 of file magic_xattr.h.
Referenced by PrepareValueFencedProtected().
bool BaseMagicXattr::PrepareValueFencedProtected | ( | gid_t | gid | ) |
Access right check before normal fence
Definition at line 158 of file magic_xattr.cc.
|
inline |
Definition at line 86 of file magic_xattr.h.
Referenced by MagicXattrRAIIWrapper::~MagicXattrRAIIWrapper().
|
friend |
Definition at line 44 of file magic_xattr.h.
|
protected |
Definition at line 104 of file magic_xattr.h.
Referenced by BaseMagicXattr(), Lock(), and Release().
|
protected |
Definition at line 102 of file magic_xattr.h.
Referenced by CompressionMagicXattr::GetValue(), DirectIoMagicXattr::GetValue(), ExternalFileMagicXattr::GetValue(), HashMagicXattr::GetValue(), LHashMagicXattr::GetValue(), RawlinkMagicXattr::GetValue(), Lock(), ChunkListMagicXattr::PrepareValueFenced(), ChunksMagicXattr::PrepareValueFenced(), CompressionMagicXattr::PrepareValueFenced(), DirectIoMagicXattr::PrepareValueFenced(), ExternalFileMagicXattr::PrepareValueFenced(), HashMagicXattr::PrepareValueFenced(), LHashMagicXattr::PrepareValueFenced(), RawlinkMagicXattr::PrepareValueFenced(), and ExternalURLMagicXattr::PrepareValueFenced().
|
protected |
Definition at line 105 of file magic_xattr.h.
Referenced by MarkProtected(), and PrepareValueFencedProtected().
|
protected |
Definition at line 101 of file magic_xattr.h.
Referenced by LHashMagicXattr::GetValue(), ExternalURLMagicXattr::GetValue(), Lock(), CatalogCountersMagicXattr::PrepareValueFenced(), ChunkListMagicXattr::PrepareValueFenced(), and ChunksMagicXattr::PrepareValueFenced().
|
protected |
Definition at line 100 of file magic_xattr.h.
Referenced by AuthzMagicXattr::GetValue(), ExternalHostMagicXattr::GetValue(), ExternalTimeoutMagicXattr::GetValue(), FqrnMagicXattr::GetValue(), HostMagicXattr::GetValue(), HostListMagicXattr::GetValue(), LHashMagicXattr::GetValue(), NCleanup24MagicXattr::GetValue(), NDirOpenMagicXattr::GetValue(), NDownloadMagicXattr::GetValue(), NIOErrMagicXattr::GetValue(), NOpenMagicXattr::GetValue(), HitrateMagicXattr::GetValue(), ProxyMagicXattr::GetValue(), ProxyListMagicXattr::GetValue(), ProxyListExternalMagicXattr::GetValue(), RepoMetainfoMagicXattr::GetValue(), RxMagicXattr::GetValue(), SpeedMagicXattr::GetValue(), TimeoutMagicXattr::GetValue(), TimeoutDirectMagicXattr::GetValue(), TimestampLastIOErrMagicXattr::GetValue(), UsedFdMagicXattr::GetValue(), UsedDirPMagicXattr::GetValue(), ExternalURLMagicXattr::GetValue(), AuthzMagicXattr::PrepareValueFenced(), CatalogCountersMagicXattr::PrepareValueFenced(), ChunkListMagicXattr::PrepareValueFenced(), ChunksMagicXattr::PrepareValueFenced(), NClgMagicXattr::PrepareValueFenced(), PubkeysMagicXattr::PrepareValueFenced(), RepoCountersMagicXattr::PrepareValueFenced(), RepoMetainfoMagicXattr::PrepareValueFenced(), RevisionMagicXattr::PrepareValueFenced(), RootHashMagicXattr::PrepareValueFenced(), TagMagicXattr::PrepareValueFenced(), PrepareValueFencedProtected(), and MagicXattrManager::Register().