Loading...
Searching...
No Matches
XrdFrmCns Class Reference

`#include <XrdFrmCns.hh>`

Collaboration diagram for XrdFrmCns:

## Public Member Functions

| XrdFrmCns ()
| ~XrdFrmCns ()

## Static Public Member Functions

static void | Add (const char *tID, const char *Path, long long Size, mode_t Mode)
static int | Init (const char *aPath, int Opts)
static int | Init (const char *myID, const char *aPath, const char *iName)
static void | Rm (const char *Path, int islfn=0)
static void | Rmd (const char *Path, int islfn=0)

## Static Public Attributes

static const int | cnsAuto = -1
static const int | cnsIgnore = 0
static const int | cnsRequire = 1

## Detailed Description

Definition at line 36 of file XrdFrmCns.hh.

## Constructor & Destructor Documentation

## XrdFrmCns()

XrdFrmCns::XrdFrmCns | ( |  | ) |

inline

Definition at line 59 of file XrdFrmCns.hh.

{}

## ~XrdFrmCns()

XrdFrmCns::~XrdFrmCns | ( |  | ) |

inline

Definition at line 60 of file XrdFrmCns.hh.

{}

## Member Function Documentation

## Add()

void XrdFrmCns::Add | ( | const char * | tID,
|  | const char * | Path,
|  | long long | Size,
|  | mode_t | Mode )

static

Definition at line 67 of file XrdFrmCns.cc.

{
static const int mMask = S_IRWXU|S_IRWXG|S_IRWXO;
static char NewLine = '\n';
struct iovec iov[9];
char mBuff[8], sBuff[24];
// Check if there is a cns here and we should initialize it
//
if (!cnsMode) return;
if (cnsInit && !Init())
{Say.Emsg("FrmCns", "Auto-ignore cnsd create", Path); return;}
// Fill out the io vector
//
iov[0].iov_base = (char *)tID;
iov[0].iov_len = strlen(tID);
iov[1].iov_base = (char *)" create ";
iov[1].iov_len = 8;
iov[2].iov_base = mBuff;
iov[2].iov_len = sprintf(mBuff, "%3o ", Mode&mMask);
iov[3].iov_base = (char *)Path;
iov[3].iov_len = strlen(Path);
iov[4].iov_base = &NewLine;
iov[4].iov_len = 1;
iov[5] = iov[0];
iov[6].iov_base = (char *)" closew ";
iov[6].iov_len = 8;
iov[7] = iov[3];
iov[8].iov_base = sBuff;
iov[8].iov_len = sprintf(sBuff, " %lld\n", Size);
// Send this off to the cnsd
//
if (!Send2Cnsd(iov, 9)) Say.Emsg("FrmCns", "Auto-ignore cnsd create", Path);
}
Say
XrdOucPup XrdCmsParser::Pup & Say
Definition XrdCmsParser.cc:124
Mode
int Mode
Definition XrdSecgsiProxy.cc:94
Path
XrdOucString Path
Definition XrdSecpwdSrvAdmin.cc:160
XrdFrmCns::Init
static int Init(const char *aPath, int Opts)
Definition XrdFrmCns.cc:167

References Init(), Mode, Path, and Say.

Here is the call graph for this function:

## Init() [1/2]

int XrdFrmCns::Init | ( | const char * | aPath,
|  | int | Opts )

static

Definition at line 167 of file XrdFrmCns.cc.

{
int rc;
if (aPath && (rc = setPath(aPath, 0))) return rc;
cnsMode = Opts;
return 0;
}
XrdMpx::Opts
int Opts
Definition XrdMpxStats.cc:58

Referenced by Add().

Here is the caller graph for this function:

## Init() [2/2]

int XrdFrmCns::Init | ( | const char * | myID,
|  | const char * | aPath,
|  | const char * | iName )

static

Definition at line 178 of file XrdFrmCns.cc.

{
char buff[2048];
int rc;
// If we are ignoring the cns then don't bother with this
//
if (!cnsMode) return 0;
// Construct the path to he cns events file (we know buff is large enough)
//
if (!cnsPath && (rc = setPath(aPath, iName))) return rc;
// Create a static headers for deletes
//
cnsHdrLen = sprintf(buff, "%s.%d.0@localhost rmdir ", myID, getpid());
cnsHdr[HdrRmd] = strdup(buff);
sprintf(buff, "%s.%d.0@localhost rm ", myID, getpid());
cnsHdr[HdrRmf] = strdup(buff);
// All done
//
return 0;
}

## Rm()

void XrdFrmCns::Rm | ( | const char * | Path,
|  | int | islfn = 0 )

inline static

Definition at line 53 of file XrdFrmCns.hh.

{if (cnsMode) Del(Path, HdrRmf, islfn);}

References Path.

## Rmd()

void XrdFrmCns::Rmd | ( | const char * | Path,
|  | int | islfn = 0 )

inline static

Definition at line 56 of file XrdFrmCns.hh.

{if (cnsMode) Del(Path, HdrRmd, islfn);}

References Path.

Referenced by XrdFrmPurgeDir::isEmpty().

Here is the caller graph for this function:

## Member Data Documentation

## cnsAuto

const int XrdFrmCns::cnsAuto = -1

static

Definition at line 43 of file XrdFrmCns.hh.

## cnsIgnore

const int XrdFrmCns::cnsIgnore = 0

static

Definition at line 45 of file XrdFrmCns.hh.

## cnsRequire

const int XrdFrmCns::cnsRequire = 1

static

Definition at line 47 of file XrdFrmCns.hh.

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

- XrdFrmCns.hh
- XrdFrmCns.cc