XRootD
Loading...
Searching...
No Matches
XrdOucExport Class Reference

#include <XrdOucExport.hh>

Collaboration diagram for XrdOucExport:

Public Member Functions

 XrdOucExport ()
 ~XrdOucExport ()

Static Public Member Functions

static unsigned long long ParseDefs (XrdOucStream &Config, XrdSysError &Eroute, unsigned long long Flags)
static XrdOucPListParsePath (XrdOucStream &Config, XrdSysError &Eroute, XrdOucPListAnchor &Export, unsigned long long Defopts)

Detailed Description

Definition at line 102 of file XrdOucExport.hh.

Constructor & Destructor Documentation

◆ XrdOucExport()

XrdOucExport::XrdOucExport ( )
inline

Definition at line 113 of file XrdOucExport.hh.

113{}

◆ ~XrdOucExport()

XrdOucExport::~XrdOucExport ( )
inline

Definition at line 114 of file XrdOucExport.hh.

114{}

Member Function Documentation

◆ ParseDefs()

unsigned long long XrdOucExport::ParseDefs ( XrdOucStream & Config,
XrdSysError & Eroute,
unsigned long long Flags )
static

Definition at line 60 of file XrdOucExport.cc.

63{
64 static struct rpathopts
65 {const char *opname;
66 unsigned long long oprem;
67 unsigned long long opadd;
68 unsigned long long opset;} rpopts[] =
69 {
70 {"r/o", 0, XRDEXP_READONLY,XRDEXP_ROW_X},
71 {"readonly", 0, XRDEXP_READONLY,XRDEXP_ROW_X},
72 {"forcero", 0, XRDEXP_FORCERO, XRDEXP_ROW_X},
73 {"notwritable", 0, XRDEXP_READONLY,XRDEXP_ROW_X},
74 {"writable", XRDEXP_NOTRW, 0, XRDEXP_ROW_X},
75 {"r/w", XRDEXP_NOTRW, 0, XRDEXP_ROW_X},
76 {"inplace", 0, XRDEXP_INPLACE, XRDEXP_INPLACE_X},
77 {"outplace", XRDEXP_INPLACE, 0, XRDEXP_INPLACE_X},
78// {"nocache", XRDEXP_PFCACHE, 0, XRDEXP_PFCACHE_X},
79 {"cache", 0, XRDEXP_PFCACHE, XRDEXP_PFCACHE_X},
80 {"nomig", XRDEXP_MIG, 0, XRDEXP_MIG_X},
81 {"mig", 0, XRDEXP_MIG, XRDEXP_MIG_X},
82 {"notmigratable", XRDEXP_MIG, 0, XRDEXP_MIG_X},
83 {"migratable", 0, XRDEXP_MIG, XRDEXP_MIG_X},
84 {"nomkeep", XRDEXP_MKEEP, 0, XRDEXP_MKEEP_X},
85 {"mkeep", 0, XRDEXP_MKEEP, XRDEXP_MKEEP_X},
86 {"nomlock", XRDEXP_MLOK, 0, XRDEXP_MLOK_X},
87 {"mlock", 0, XRDEXP_MLOK, XRDEXP_MLOK_X},
88 {"nommap", XRDEXP_MMAP, 0, XRDEXP_MMAP_X},
89 {"mmap", 0, XRDEXP_MMAP, XRDEXP_MMAP_X},
90 {"mwfiles", 0, XRDEXP_MWMODE, XRDEXP_MWMODE_X},
91 {"nopurge", XRDEXP_PURGE, 0, XRDEXP_PURGE_X},
92 {"purge", 0, XRDEXP_PURGE, XRDEXP_PURGE_X},
93 {"nostage", XRDEXP_STAGE, 0, XRDEXP_STAGE_X},
94 {"stage", 0, XRDEXP_STAGE, XRDEXP_STAGE_X},
95 {"stage+", 0, XRDEXP_STAGEMM, XRDEXP_STAGE_X},
96 {"dread", XRDEXP_NODREAD, 0, XRDEXP_DREAD_X},
97 {"nodread", 0, XRDEXP_NODREAD, XRDEXP_DREAD_X},
98 {"check", XRDEXP_NOCHECK, 0, XRDEXP_CHECK_X},
99 {"nocheck", 0, XRDEXP_NOCHECK, XRDEXP_CHECK_X},
100 {"rcreate", 0, XRDEXP_RCREATE, XRDEXP_RCREATE_X},
101 {"norcreate", XRDEXP_RCREATE, 0, XRDEXP_RCREATE_X},
103 {"global", XRDEXP_LOCAL, 0, XRDEXP_LOCAL_X},
105 {"lock", XRDEXP_NOLK, 0, XRDEXP_NOLK_X},
106 {"nolock", 0, XRDEXP_NOLK, XRDEXP_NOLK_X},
107 {"xattrs", XRDEXP_NOXATTR, 0, XRDEXP_NOXATTR_X},
108 {"noxattrs", 0, XRDEXP_NOXATTR, XRDEXP_NOXATTR_X}
109 };
110 int i, numopts = sizeof(rpopts)/sizeof(struct rpathopts);
111 char *val;
112
113// Process options
114//
115 val = Config.GetWord();
116 while (val)
117 {for (i = 0; i < numopts; i++)
118 {if (!strcmp(val, rpopts[i].opname))
119 {Flags = (Flags & ~rpopts[i].oprem)
120 | rpopts[i].opadd
121 | rpopts[i].opset;
122 break;
123 }
124 }
125 if (i >= numopts)
126 Eroute.Emsg("Export", "warning, invalid path option", val);
127 val = Config.GetWord();
128 }
129
130// All done
131//
132 return Flags;
133}
#define XRDEXP_DREAD_X
#define XRDEXP_ROW_X
#define XRDEXP_NOTRW
#define XRDEXP_NOLK_X
#define XRDEXP_NODREAD
#define XRDEXP_INPLACE
#define XRDEXP_PURGE
#define XRDEXP_LOCAL_X
#define XRDEXP_MMAP
#define XRDEXP_MKEEP
#define XRDEXP_PFCACHE
#define XRDEXP_FORCERO
#define XRDEXP_MLOK
#define XRDEXP_STAGEMM
#define XRDEXP_MMAP_X
#define XRDEXP_RCREATE_X
#define XRDEXP_MWMODE
#define XRDEXP_CHECK_X
#define XRDEXP_GLBLRO
#define XRDEXP_PURGE_X
#define XRDEXP_NOCHECK
#define XRDEXP_NOXATTR_X
#define XRDEXP_STAGE_X
#define XRDEXP_RCREATE
#define XRDEXP_MWMODE_X
#define XRDEXP_NOXATTR
#define XRDEXP_READONLY
#define XRDEXP_STAGE
#define XRDEXP_NOLK
#define XRDEXP_MLOK_X
#define XRDEXP_INPLACE_X
#define XRDEXP_MKEEP_X
#define XRDEXP_MIG
#define XRDEXP_GLBLRO_X
#define XRDEXP_PFCACHE_X
#define XRDEXP_LOCAL
#define XRDEXP_MIG_X
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
XrdCmsConfig Config

References XrdSysError::Emsg(), XRDEXP_CHECK_X, XRDEXP_DREAD_X, XRDEXP_FORCERO, XRDEXP_GLBLRO, XRDEXP_GLBLRO_X, XRDEXP_INPLACE, XRDEXP_INPLACE_X, XRDEXP_LOCAL, XRDEXP_LOCAL_X, XRDEXP_MIG, XRDEXP_MIG_X, XRDEXP_MKEEP, XRDEXP_MKEEP_X, XRDEXP_MLOK, XRDEXP_MLOK_X, XRDEXP_MMAP, XRDEXP_MMAP_X, XRDEXP_MWMODE, XRDEXP_MWMODE_X, XRDEXP_NOCHECK, XRDEXP_NODREAD, XRDEXP_NOLK, XRDEXP_NOLK_X, XRDEXP_NOTRW, XRDEXP_NOXATTR, XRDEXP_NOXATTR_X, XRDEXP_PFCACHE, XRDEXP_PFCACHE_X, XRDEXP_PURGE, XRDEXP_PURGE_X, XRDEXP_RCREATE, XRDEXP_RCREATE_X, XRDEXP_READONLY, XRDEXP_ROW_X, XRDEXP_STAGE, XRDEXP_STAGE_X, and XRDEXP_STAGEMM.

Referenced by ParsePath(), and XrdOssSys::xdefault().

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

◆ ParsePath()

XrdOucPList * XrdOucExport::ParsePath ( XrdOucStream & Config,
XrdSysError & Eroute,
XrdOucPListAnchor & Export,
unsigned long long Defopts )
static

Definition at line 166 of file XrdOucExport.cc.

169{
170 XrdOucPList *plp;
171 char *path, pbuff[1024];
172 unsigned long long rpval;
173
174// Get the path
175//
176 path = Config.GetWord();
177 if (!path || !path[0])
178 {Eroute.Emsg("Export", "path not specified"); return 0;}
179 strlcpy(pbuff, path, sizeof(pbuff));
180
181// Handle object ID specification
182//
183 if (*pbuff == '*') pbuff[1] = 0;
184
185// Process path options and apply defaults to any unspecified otions
186//
187 rpval = ParseDefs(Config, Eroute, 0);
188 rpval = rpval | (Defopts & (~(rpval >> XRDEXP_MASKSHIFT)))
189 | (Defopts & (~(rpval & ~XRDEXP_SETTINGS)));
190
191// Make sure that we have no conflicting options
192//
193 if ((rpval & XRDEXP_MEMAP) && !(rpval & XRDEXP_NOTRW))
194 {Eroute.Emsg("config", "warning, file memory mapping forced path", path,
195 "to be readonly");
196 rpval |= XRDEXP_FORCERO;
197 }
198
199// noxattr conflicts with mig or purge
200//
201 if ((rpval & XRDEXP_NOXATTR) && (rpval & XRDEXP_MIGPRG))
202 {Eroute.Emsg("config", "noxattrs attribute is incompatible with "
203 "mig and purge attributes.");
204 return 0;
205 }
206
207
208// Update the export list. If this path is being modified, turn off all bits
209// in the old path specified in the new path and then set the new bits.
210//
211 if ((plp = Export.Match(pbuff)))
212 {unsigned long long Opts = rpval >> XRDEXP_MASKSHIFT;
213 Opts = (plp->Flag() & ~Opts) | rpval;
214 plp->Set(Opts);
215 } else {
216 plp = new XrdOucPList(pbuff,rpval);
217 Export.Insert(plp);
218 }
219
220// Return the path specification
221//
222 return plp;
223}
#define XRDEXP_MASKSHIFT
#define XRDEXP_MEMAP
#define XRDEXP_SETTINGS
#define XRDEXP_MIGPRG
size_t strlcpy(char *dst, const char *src, size_t sz)
static unsigned long long ParseDefs(XrdOucStream &Config, XrdSysError &Eroute, unsigned long long Flags)
XrdOucPList * Match(const char *pathname)
void Insert(XrdOucPList *newitem)
void Set(int aval)
unsigned long long Flag()

References XrdSysError::Emsg(), XrdOucPList::Flag(), XrdOucPListAnchor::Insert(), XrdOucPListAnchor::Match(), ParseDefs(), XrdOucPList::Set(), strlcpy(), XRDEXP_FORCERO, XRDEXP_MASKSHIFT, XRDEXP_MEMAP, XRDEXP_MIGPRG, XRDEXP_NOTRW, XRDEXP_NOXATTR, and XRDEXP_SETTINGS.

Referenced by XrdOssSys::xpath().

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

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