XRootD
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
Definition: XrdOucExport.hh:47
#define XRDEXP_ROW_X
Definition: XrdOucExport.hh:44
#define XRDEXP_NOTRW
Definition: XrdOucExport.hh:45
#define XRDEXP_NOLK_X
Definition: XrdOucExport.hh:94
#define XRDEXP_NODREAD
Definition: XrdOucExport.hh:46
#define XRDEXP_INPLACE
Definition: XrdOucExport.hh:66
#define XRDEXP_PURGE
Definition: XrdOucExport.hh:62
#define XRDEXP_LOCAL_X
Definition: XrdOucExport.hh:73
#define XRDEXP_MMAP
Definition: XrdOucExport.hh:56
#define XRDEXP_MKEEP
Definition: XrdOucExport.hh:60
#define XRDEXP_PFCACHE
Definition: XrdOucExport.hh:70
#define XRDEXP_FORCERO
Definition: XrdOucExport.hh:43
#define XRDEXP_MLOK
Definition: XrdOucExport.hh:58
#define XRDEXP_STAGEMM
Definition: XrdOucExport.hh:76
#define XRDEXP_MMAP_X
Definition: XrdOucExport.hh:57
#define XRDEXP_RCREATE_X
Definition: XrdOucExport.hh:49
#define XRDEXP_MWMODE
Definition: XrdOucExport.hh:68
#define XRDEXP_CHECK_X
Definition: XrdOucExport.hh:51
#define XRDEXP_GLBLRO
Definition: XrdOucExport.hh:74
#define XRDEXP_PURGE_X
Definition: XrdOucExport.hh:63
#define XRDEXP_NOCHECK
Definition: XrdOucExport.hh:50
#define XRDEXP_NOXATTR_X
Definition: XrdOucExport.hh:65
#define XRDEXP_STAGE_X
Definition: XrdOucExport.hh:53
#define XRDEXP_RCREATE
Definition: XrdOucExport.hh:48
#define XRDEXP_MWMODE_X
Definition: XrdOucExport.hh:69
#define XRDEXP_NOXATTR
Definition: XrdOucExport.hh:64
#define XRDEXP_READONLY
Definition: XrdOucExport.hh:42
#define XRDEXP_STAGE
Definition: XrdOucExport.hh:52
#define XRDEXP_NOLK
Definition: XrdOucExport.hh:93
#define XRDEXP_MLOK_X
Definition: XrdOucExport.hh:59
#define XRDEXP_INPLACE_X
Definition: XrdOucExport.hh:67
#define XRDEXP_MKEEP_X
Definition: XrdOucExport.hh:61
#define XRDEXP_MIG
Definition: XrdOucExport.hh:54
#define XRDEXP_GLBLRO_X
Definition: XrdOucExport.hh:75
#define XRDEXP_PFCACHE_X
Definition: XrdOucExport.hh:71
#define XRDEXP_LOCAL
Definition: XrdOucExport.hh:72
#define XRDEXP_MIG_X
Definition: XrdOucExport.hh:55
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
XrdCmsConfig Config

References XrdCms::Config, 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
Definition: XrdOucExport.hh:81
#define XRDEXP_MEMAP
Definition: XrdOucExport.hh:84
#define XRDEXP_SETTINGS
Definition: XrdOucExport.hh:82
#define XRDEXP_MIGPRG
Definition: XrdOucExport.hh:86
size_t strlcpy(char *dst, const char *src, size_t sz)
static unsigned long long ParseDefs(XrdOucStream &Config, XrdSysError &Eroute, unsigned long long Flags)
Definition: XrdOucExport.cc:60
void Insert(XrdOucPList *newitem)
Definition: XrdOucPList.hh:134
XrdOucPList * Match(const char *pathname)
Definition: XrdOucPList.hh:122
void Set(int aval)
Definition: XrdOucPList.hh:51
unsigned long long Flag()
Definition: XrdOucPList.hh:42
int Opts
Definition: XrdMpxStats.cc:58

References XrdCms::Config, XrdSysError::Emsg(), XrdOucPList::Flag(), XrdOucPListAnchor::Insert(), XrdOucPListAnchor::Match(), XrdMpx::Opts, 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: