CernVM-FS  2.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseMagicXattr Class Referenceabstract

#include <magic_xattr.h>

Inheritance diagram for BaseMagicXattr:
Collaboration diagram for BaseMagicXattr:

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

MagicXattrManagerxattr_mgr_
 
PathString path_
 
catalog::DirectoryEntrydirent_
 
pthread_mutex_t access_mutex_
 
bool is_protected_
 

Private Member Functions

 FRIEND_TEST (T_MagicXattr, ProtectedXattr)
 
 FRIEND_TEST (T_MagicXattr, TestFqrn)
 

Friends

class MagicXattrManager
 

Detailed Description

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()

  1. Call PrepareValueFenced() inside FuseRemounter::fence()
  2. Call GetValue() to get the actual value (can be called outside the fence)

Definition at line 43 of file magic_xattr.h.

Constructor & Destructor Documentation

BaseMagicXattr::BaseMagicXattr ( )
inline

Definition at line 49 of file magic_xattr.h.

Here is the call graph for this function:

virtual BaseMagicXattr::~BaseMagicXattr ( )
inlinevirtual

Definition at line 90 of file magic_xattr.h.

Member Function Documentation

BaseMagicXattr::FRIEND_TEST ( T_MagicXattr  ,
ProtectedXattr   
)
private
BaseMagicXattr::FRIEND_TEST ( T_MagicXattr  ,
TestFqrn   
)
private
virtual MagicXattrFlavor BaseMagicXattr::GetXattrFlavor ( )
inlinevirtual
void BaseMagicXattr::Lock ( PathString  path,
catalog::DirectoryEntry dirent 
)
inline

Definition at line 79 of file magic_xattr.h.

Referenced by MagicXattrManager::GetLocked(), and MagicXattrRAIIWrapper::MagicXattrRAIIWrapper().

Here is the call graph for this function:

Here is the caller graph for this function:

void BaseMagicXattr::MarkProtected ( )
inline

Mark a Xattr protected so that only certain users with the correct gid can access it.

Definition at line 58 of file magic_xattr.h.

Referenced by MagicXattrManager::Register().

Here is the caller graph for this function:

virtual bool BaseMagicXattr::PrepareValueFenced ( )
inlineprotectedvirtual
bool BaseMagicXattr::PrepareValueFencedProtected ( gid_t  gid)

Access right check before normal fence

Definition at line 156 of file magic_xattr.cc.

Here is the call graph for this function:

void BaseMagicXattr::Release ( )
inline

Definition at line 85 of file magic_xattr.h.

Referenced by MagicXattrRAIIWrapper::~MagicXattrRAIIWrapper().

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class MagicXattrManager
friend

Definition at line 44 of file magic_xattr.h.

Member Data Documentation

pthread_mutex_t BaseMagicXattr::access_mutex_
protected

Definition at line 103 of file magic_xattr.h.

Referenced by BaseMagicXattr(), Lock(), and Release().

bool BaseMagicXattr::is_protected_
protected

Definition at line 104 of file magic_xattr.h.

Referenced by MarkProtected(), and PrepareValueFencedProtected().


The documentation for this class was generated from the following files: