xrootd
|
Go to the source code of this file.
Namespaces | |
namespace | XrdOssStatEvent |
Typedefs | |
typedef int(* | XrdOssStatInfo_t) (const char *path, struct stat *buff, int opts, XrdOucEnv *envP) |
typedef int(* | XrdOssStatInfo2_t) (const char *path, struct stat *buff, int opts, XrdOucEnv *envP, const char *lfn) |
typedef XrdOssStatInfo_t(* | XrdOssStatInfoInit_t) (XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms) |
The typedef that describes the XRdOssStatInfoInit external. | |
typedef XrdOssStatInfo2_t(* | XrdOssStatInfoInit2_t) (XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms, XrdOucEnv *envP) |
Variables | |
static const int | XrdOssStatEvent::FileAdded = 1 |
Path has been added. | |
static const int | XrdOssStatEvent::PendAdded = 2 |
Path has been added in pending mode. | |
static const int | XrdOssStatEvent::FileRemoved = 0 |
Path has been removed. | |
typedef int(* XrdOssStatInfo2_t) (const char *path, struct stat *buff, int opts, XrdOucEnv *envP, const char *lfn) |
This file defines the alternate stat() function that can be used as a replacement for the normal system stat() call that is used to determine the file attributes, including whether the file exists or not. It is loaded as a plug-in via the XrdOssStatInfoInit() function residing in the shared library pecified by the 'oss.statlib' directive. The returned function is preferentially used by the XrdOssSys::Stat() method. Get file information.
path | -> the file path whose stat information is wanted. |
buff | -> to the stat structure that is to be filled in with stat information the same way that stat() would have, |
opts | A combination of XRDOSS_xxxx options. See XrdOss.hh. |
envP | -> environment pointer which includes CGI information. This pointer is nil if no special environment exists. |
lfn | -> the corresponding logical file name. This is only passed for version 2 calls (see XrdOssStatInfoInit2). |
When the arevents option is specified in the oss.statlib directive and the executable is the cmsd running in server mode, then the StatInfo function is also used to relay add/remove file requests send by the companion xrootd to the cmsd. The parameters then are as follows:
path | -> the file path whose whose stat information changed. |
buff | -> Nil; this indicates that stat information is being set. |
opts | One of the following options: XrdOssStatEvent::FileAdded, XrdOssStatEvent::PendAdded, XrdOssStatEvent::FileRemoved. |
envP | -> Nil |
lfn | -> the logical file name whose stat information changed. |
typedef XrdOssStatInfo2_t(* XrdOssStatInfoInit2_t) (XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms, XrdOucEnv *envP) |
typedef XrdOssStatInfo_t(* XrdOssStatInfoInit_t) (XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms) |
The typedef that describes the XRdOssStatInfoInit external.
Get the address of the appropriate XrdOssStatInfo function.
native_oss | -> object that implements the storage system. |
Logger | -> The message routing object to be used in conjunction with an XrdSysError object for error messages. |
config_fn | -> The name of the config file. |
parms | -> Any parameters specified after the path on the oss.statlib directive. If there are no parameters, the pointer may be zero. |
Additionally, two special envars may be queried to determine the context:
getenv("XRDPROG") Indicates which program is loading the library: "cmsd", "frm_purged", "frm_xfrd", or "xrootd" Any other value, inclduing a nil pointer, indicates a non-standard program is doing the load.
getenv("XRDROLE") Is the role of the program. The envar is set only when XRDPROG is set to "cmsd" or "xrootd". Valid roles are: "manager", "supervisor", "server", "proxy", or "peer".
The function creator must be declared as an extern "C" function in the plug-in shared library as follows:
An alternate entry point may be defined in lieu of the previous entry point. This normally identified by a version option in the configuration file (e.g. oss.statlib -2 <path>). It differs in that an extra parameter is passed and if returns a function that accepts an extra parameter.
envP | - Pointer to the environment containing implementation specific information. |
Declare compilation version.
Additionally, you must declare the xrootd version you used to compile your plug-in. Include the code shown below at file level in your source.
#include "XrdVersion.hh" XrdVERSIONINFO(XrdOssStatInfoInit,<name>);
where <name> is a 1- to 15-character unquoted name identifying your plugin.