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 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
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:96
#define XRDEXP_NODREAD
Definition: XrdOucExport.hh:46
#define XRDEXP_INPLACE
Definition: XrdOucExport.hh:66
#define XRDEXP_PURGE
Definition: XrdOucExport.hh:62
#define XRDEXP_NOFICL_X
Definition: XrdOucExport.hh:90
#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_NOFICL
Definition: XrdOucExport.hh:89
#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:95
#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:116
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_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
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: