Loading...
Searching...
No Matches
XrdOssApi.cc File Reference
`#include <unistd.h>`
`#include <cerrno>`
`#include <fcntl.h>`
`#include <signal.h>`
`#include <strings.h>`
`#include <cstdio>`
`#include <sys/file.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <sys/param.h>`
`#include "XrdVersion.hh"`
`#include "XrdFrc/XrdFrcXAttr.hh"`
`#include "XrdOss/XrdOssApi.hh"`
`#include "XrdOss/XrdOssCache.hh"`
`#include "XrdOss/XrdOssConfig.hh"`
`#include "XrdOss/XrdOssError.hh"`
`#include "XrdOss/XrdOssMio.hh"`
`#include "XrdOss/XrdOssTrace.hh"`
`#include "XrdOuc/XrdOucEnv.hh"`
`#include "XrdOuc/XrdOucName2Name.hh"`
`#include "XrdOuc/XrdOucPinLoader.hh"`
`#include "XrdOuc/XrdOucXAttr.hh"`
`#include "XrdSfs/XrdSfsFlags.hh"`
`#include "XrdSys/XrdSysAtomics.hh"`
`#include "XrdSys/XrdSysError.hh"`
`#include "XrdSys/XrdSysFD.hh"`
`#include "XrdSys/XrdSysHeaders.hh"`
`#include "XrdSys/XrdSysPlatform.hh"`
`#include "XrdSys/XrdSysPlugin.hh"`
Include dependency graph for XrdOssApi.cc:

Go to the source code of this file.

## Functions

XrdOss * | XrdOssDefaultSS (XrdSysLogger *logger, const char *cfg_fn, XrdVersionInfo &urVer)
XrdOss * | XrdOssGetSS (XrdSysLogger *Logger, const char *config_fn, const char *OssLib, const char *OssParms, XrdOucEnv *envP, XrdVersionInfo &urVer)

## Variables

XrdSysError | OssEroute (0, "oss_")
XrdSysTrace | OssTrace ("oss")
XrdOssSys * | XrdOssSS = 0

## Function Documentation

## XrdOssDefaultSS()

XrdOss * XrdOssDefaultSS | ( | XrdSysLogger * | logger,
|  | const char * | cfg_fn,
|  | XrdVersionInfo & | urVer )

Get the default Storage System object.

Include this file in your code to declare the external function that obtains a default version of the XrdOss object; then simply invoke it.

Parameters

  logger | the address of the logging object to direct messages.
  cfg_fn | the address of the configuration file path.
  urVer | the version string associated with your code. This is generated by the XrdVERSIONINFODEF macro and can be found in XrdVersion.hh include file. You must supply a compatible version identification string.

Returns
  XrdOss pointer to a default configured storage system object. 0 a storage system object could not be created because of configration problems or your version is incompatible.

Definition at line 165 of file XrdOssApi.cc.

{
return XrdOssGetSS(logger, cfg_fn, 0, 0, 0, urVer);
}
XrdOssGetSS
XrdOss * XrdOssGetSS(XrdSysLogger *Logger, const char *config_fn, const char *OssLib, const char *OssParms, XrdOucEnv *envP, XrdVersionInfo &urVer)
Definition XrdOssApi.cc:98

References XrdOssGetSS().

Here is the call graph for this function:

## XrdOssGetSS()

XrdOss * XrdOssGetSS | ( | XrdSysLogger * | Logger,
|  | const char * | config_fn,
|  | const char * | OssLib,
|  | const char * | OssParms,
|  | XrdOucEnv * | envP,
|  | XrdVersionInfo & | urVer )

Definition at line 98 of file XrdOssApi.cc.

{
static XrdOssSys myOssSys;
extern XrdSysError OssEroute;
XrdOucPinLoader *myLib;
XrdOss *ossP;
// Verify that versions are compatible.
//
if (urVer.vNum != myOssSys.myVersion->vNum
&& !XrdSysPlugin::VerCmp(urVer, *(myOssSys.myVersion))) return 0;
// Set logger for tracing and errors
//
OssTrace.SetLogger(Logger);
OssEroute.logger(Logger);
// If no library has been specified, return the default object
//
if (!OssLib) {if (myOssSys.Init(Logger, config_fn, envP)) return 0;
else return (XrdOss *)&myOssSys;
}
// Create a plugin object. Take into account the proxy library. Eventually,
// we will need to support other core libraries. But, for now, this will do.
//
if (!(myLib = new XrdOucPinLoader(&OssEroute, myOssSys.myVersion,
"osslib", OssLib))) return 0;
// Declare the interface versions
//
XrdOssGetStorageSystem_t getOSS1;
const char *epName1 = "XrdOssGetStorageSystem";
XrdOssGetStorageSystem2_t getOSS2;
const char *epName2 ="?XrdOssGetStorageSystem2";
// First try finding version 2 of the initializer. If that fails try version 1.
// In the process, we will get an oss object if we succeed at all.
//
getOSS2 = (XrdOssGetStorageSystem2_t)myLib->Resolve(epName2);
if (getOSS2) ossP = getOSS2((XrdOss *)&myOssSys, Logger, config_fn,
OssParms, envP);
else {getOSS1 = (XrdOssGetStorageSystem_t)myLib->Resolve(epName1);
if (!getOSS1) return 0;
ossP = getOSS1((XrdOss *)&myOssSys, Logger, config_fn, OssParms);
}
// Call the legacy EnvInfo() method and set what library we are using if it
// differs from what we wre passed.
//
if (ossP && envP)
{ossP->EnvInfo(envP);
if (envP && strcmp(OssLib, myLib->Path()))
envP->Put("oss.lib", myLib->Path());
}
// All done
//
delete myLib;
return ossP;
}
Logger
static XrdSysLogger Logger
Definition XrdCryptoAux.cc:37
OssTrace
XrdSysTrace OssTrace
OssEroute
XrdSysError OssEroute
XrdOssGetStorageSystem2_t
XrdOss *(* XrdOssGetStorageSystem2_t)(XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms, XrdOucEnv *envP)
Definition XrdOss.hh:939
XrdOssGetStorageSystem_t
XrdOss *(* XrdOssGetStorageSystem_t)(XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms)
The typedef that describes the XRdOssStatInfoInit external.
Definition XrdOss.hh:934
XrdOssSys
Definition XrdOssApi.hh:154
XrdOssSys::Init
int Init(XrdSysLogger *, const char *, XrdOucEnv *envP)
Definition XrdOssApi.cc:186
XrdOssSys::myVersion
XrdVersionInfo * myVersion
Definition XrdOssApi.hh:282
XrdOss
Definition XrdOss.hh:499
XrdOss::EnvInfo
virtual void EnvInfo(XrdOucEnv *envP)
Definition XrdOss.cc:54
XrdOucEnv::Put
void Put(const char *varname, const char *value)
Definition XrdOucEnv.hh:85
XrdOucPinLoader
Definition XrdOucPinLoader.hh:50
XrdOucPinLoader::Resolve
void * Resolve(const char *symbl, int mcnt=1)
Definition XrdOucPinLoader.cc:267
XrdOucPinLoader::Path
const char * Path()
Definition XrdOucPinLoader.hh:91
XrdSysError
Definition XrdSysError.hh:90
XrdSysPlugin::VerCmp
static bool VerCmp(XrdVersionInfo &vInf1, XrdVersionInfo &vInf2, bool noMsg=false)
Definition XrdSysPlugin.cc:472
XrdOfsPrepGPIReal::ossP
XrdOss * ossP
Definition XrdOfsPrepGPI.cc:57
XrdProxy::envP
XrdOucEnv * envP
Definition XrdPss.cc:109

References XrdOss::EnvInfo(), XrdOssSys::Init(), Logger, XrdOssSys::myVersion, OssEroute, OssTrace, XrdOucPinLoader::Path(), XrdOucEnv::Put(), XrdOucPinLoader::Resolve(), and XrdSysPlugin::VerCmp().

Referenced by XrdFrmConfig::Configure(), XrdOfsConfigPI::Load(), and XrdOssDefaultSS().

Here is the call graph for this function:
Here is the caller graph for this function:

## Variable Documentation

## OssEroute

XrdSysError OssEroute(0, "oss_") | ( | 0 | ,
|  | "oss_" | )

## OssTrace

XrdSysTrace OssTrace("oss") | ( | "oss" |  | ) |

## XrdOssSS

XrdOssSys* XrdOssSS = 0

Definition at line 77 of file XrdOssApi.cc.

Referenced by XrdOssDir::Close(), XrdOssSys::Create(), XrdOssSys::Init(), XrdOssFile::Open(), XrdOssDir::Opendir(), XrdOssFile::Read(), XrdOssDir::Readdir(), XrdOssFile::ReadV(), XrdOssFile::Write(), and XrdOssxfr().