CernVM-FS
2.12.0
|
#include <magic_xattr.h>
Public Member Functions | |
BaseMagicXattr () | |
void | MarkProtected () |
bool | PrepareValueFencedProtected (gid_t gid) |
std::pair< bool, std::string > | GetValue (int32_t requested_page, const MagicXattrMode mode) |
virtual MagicXattrFlavor | GetXattrFlavor () |
void | Lock (PathString path, catalog::DirectoryEntry *dirent) |
void | Release () |
virtual | ~BaseMagicXattr () |
Static Public Attributes | |
static const uint32_t | kMaxCharsPerPage = 40000 |
Protected Member Functions | |
virtual bool | PrepareValueFenced () |
virtual void | FinalizeValue () |
std::string | HeaderMultipageHuman (uint32_t requested_page) |
Protected Attributes | |
MagicXattrManager * | xattr_mgr_ |
PathString | path_ |
catalog::DirectoryEntry * | dirent_ |
pthread_mutex_t | access_mutex_ |
bool | is_protected_ |
std::vector< std::string > | result_pages_ |
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. Every extended attributes must 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()
Implementation notes:
Definition at line 66 of file magic_xattr.h.
|
inline |
|
inlinevirtual |
Definition at line 134 of file magic_xattr.h.
|
inlineprotectedvirtual |
Reimplemented 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.
Definition at line 145 of file magic_xattr.h.
Referenced by GetValue().
|
private |
|
private |
|
private |
std::pair< bool, std::string > BaseMagicXattr::GetValue | ( | int32_t | requested_page, |
const MagicXattrMode | mode | ||
) |
This function needs to be called after PrepareValueFenced(), which prepares the necessary data and header for kXattrHumanMode. It does the computationaly intensive part, which should not be done inside the FuseRemounter::fence(), and returns the value.
Internally it calls FinalizeValue() which each MagicXAttr has to implement to set the value of result_pages_
Definition at line 205 of file magic_xattr.cc.
|
inlinevirtual |
Reimplemented in AuthzMagicXattr, SymlinkMagicXattr, ExternalMagicXattr, RegularMagicXattr, and WithHashMagicXattr.
Definition at line 121 of file magic_xattr.h.
|
protected |
Definition at line 198 of file magic_xattr.cc.
Referenced by GetValue().
|
inline |
Definition at line 123 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 82 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 144 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 129 of file magic_xattr.h.
Referenced by MagicXattrRAIIWrapper::~MagicXattrRAIIWrapper().
|
friend |
Definition at line 67 of file magic_xattr.h.
|
protected |
Definition at line 153 of file magic_xattr.h.
Referenced by BaseMagicXattr(), Lock(), and Release().
|
protected |
Definition at line 151 of file magic_xattr.h.
Referenced by CompressionMagicXattr::FinalizeValue(), DirectIoMagicXattr::FinalizeValue(), ExternalFileMagicXattr::FinalizeValue(), HashMagicXattr::FinalizeValue(), LHashMagicXattr::FinalizeValue(), RawlinkMagicXattr::FinalizeValue(), Lock(), ChunkListMagicXattr::PrepareValueFenced(), ChunksMagicXattr::PrepareValueFenced(), CompressionMagicXattr::PrepareValueFenced(), DirectIoMagicXattr::PrepareValueFenced(), ExternalFileMagicXattr::PrepareValueFenced(), HashMagicXattr::PrepareValueFenced(), LHashMagicXattr::PrepareValueFenced(), RawlinkMagicXattr::PrepareValueFenced(), and ExternalURLMagicXattr::PrepareValueFenced().
|
protected |
Definition at line 154 of file magic_xattr.h.
Referenced by MarkProtected(), and PrepareValueFencedProtected().
|
static |
Definition at line 137 of file magic_xattr.h.
Referenced by PubkeysMagicXattr::FinalizeValue(), ListProxy(), and ChunkListMagicXattr::PrepareValueFenced().
|
protected |
Definition at line 150 of file magic_xattr.h.
Referenced by LHashMagicXattr::FinalizeValue(), ExternalURLMagicXattr::FinalizeValue(), Lock(), CatalogCountersMagicXattr::PrepareValueFenced(), ChunkListMagicXattr::PrepareValueFenced(), and ChunksMagicXattr::PrepareValueFenced().
|
protected |
Definition at line 155 of file magic_xattr.h.
Referenced by AuthzMagicXattr::FinalizeValue(), CatalogCountersMagicXattr::FinalizeValue(), ChunkListMagicXattr::FinalizeValue(), ChunksMagicXattr::FinalizeValue(), CompressionMagicXattr::FinalizeValue(), DirectIoMagicXattr::FinalizeValue(), ExternalFileMagicXattr::FinalizeValue(), ExternalHostMagicXattr::FinalizeValue(), ExternalTimeoutMagicXattr::FinalizeValue(), FqrnMagicXattr::FinalizeValue(), HashMagicXattr::FinalizeValue(), HostMagicXattr::FinalizeValue(), HostListMagicXattr::FinalizeValue(), LHashMagicXattr::FinalizeValue(), LogBufferXattr::FinalizeValue(), NCleanup24MagicXattr::FinalizeValue(), NClgMagicXattr::FinalizeValue(), NDirOpenMagicXattr::FinalizeValue(), NDownloadMagicXattr::FinalizeValue(), NIOErrMagicXattr::FinalizeValue(), NOpenMagicXattr::FinalizeValue(), HitrateMagicXattr::FinalizeValue(), ProxyMagicXattr::FinalizeValue(), ProxyListMagicXattr::FinalizeValue(), ProxyListExternalMagicXattr::FinalizeValue(), PubkeysMagicXattr::FinalizeValue(), RawlinkMagicXattr::FinalizeValue(), RepoCountersMagicXattr::FinalizeValue(), RepoMetainfoMagicXattr::FinalizeValue(), RevisionMagicXattr::FinalizeValue(), RootHashMagicXattr::FinalizeValue(), RxMagicXattr::FinalizeValue(), SpeedMagicXattr::FinalizeValue(), TagMagicXattr::FinalizeValue(), TimeoutMagicXattr::FinalizeValue(), TimeoutDirectMagicXattr::FinalizeValue(), TimestampLastIOErrMagicXattr::FinalizeValue(), UsedFdMagicXattr::FinalizeValue(), UsedDirPMagicXattr::FinalizeValue(), VersionMagicXattr::FinalizeValue(), ExternalURLMagicXattr::FinalizeValue(), GetValue(), and HeaderMultipageHuman().
|
protected |
Definition at line 149 of file magic_xattr.h.
Referenced by AuthzMagicXattr::FinalizeValue(), ExternalHostMagicXattr::FinalizeValue(), ExternalTimeoutMagicXattr::FinalizeValue(), FqrnMagicXattr::FinalizeValue(), HostMagicXattr::FinalizeValue(), HostListMagicXattr::FinalizeValue(), LHashMagicXattr::FinalizeValue(), NCleanup24MagicXattr::FinalizeValue(), NDirOpenMagicXattr::FinalizeValue(), NDownloadMagicXattr::FinalizeValue(), NIOErrMagicXattr::FinalizeValue(), NOpenMagicXattr::FinalizeValue(), HitrateMagicXattr::FinalizeValue(), ProxyMagicXattr::FinalizeValue(), ProxyListMagicXattr::FinalizeValue(), ProxyListExternalMagicXattr::FinalizeValue(), RepoMetainfoMagicXattr::FinalizeValue(), RxMagicXattr::FinalizeValue(), SpeedMagicXattr::FinalizeValue(), TimeoutMagicXattr::FinalizeValue(), TimeoutDirectMagicXattr::FinalizeValue(), TimestampLastIOErrMagicXattr::FinalizeValue(), UsedFdMagicXattr::FinalizeValue(), UsedDirPMagicXattr::FinalizeValue(), ExternalURLMagicXattr::FinalizeValue(), 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().