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 104 of file XrdOucExport.hh.

Constructor & Destructor Documentation

◆ XrdOucExport()

XrdOucExport::XrdOucExport ( )
inline

Definition at line 115 of file XrdOucExport.hh.

115{}

◆ ~XrdOucExport()

XrdOucExport::~XrdOucExport ( )
inline

Definition at line 116 of file XrdOucExport.hh.

116{}

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 {"noficl", 0, XRDEXP_NOFICL, XRDEXP_NOFICL_X},
110 {"ficl", XRDEXP_NOFICL, 0, XRDEXP_NOFICL_X}
111 };
112 int i, numopts = sizeof(rpopts)/sizeof(struct rpathopts);
113 char *val;
114
115// Process options
116//
117 val = Config.GetWord();
118 while (val)
119 {for (i = 0; i < numopts; i++)
120 {if (!strcmp(val, rpopts[i].opname))
121 {Flags = (Flags & ~rpopts[i].oprem)
122 | rpopts[i].opadd
123 | rpopts[i].opset;
124 break;
125 }
126 }
127 if (i >= numopts)
128 Eroute.Emsg("Export", "warning, invalid path option", val);
129 val = Config.GetWord();
130 }
131
132// All done
133//
134 return Flags;
135}
#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_NOFICL_X
#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_NOFICL
#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_NOFICL, XRDEXP_NOFICL_X, 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 168 of file XrdOucExport.cc.

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