50 : myCache(cInst), hProc(0),
Log(logP,
"PfcFsctl"),
51 sysTrace(cInst.GetTrace()), m_traceID(
"PfcFSctl") {}
79 eInfo.
setErrInfo(ENOTSUP,
"File based fstcl not supported for a cache.");
92 const char *msg =
"", *xeq = args.
Arg1;
98 {eInfo.
setErrInfo(EIDRM,
"None-cache command issued to a cache.");
105 {eInfo.
setErrInfo(EINVAL,
"Missing cache command or argument.");
111 if ((!strcmp(xeq,
"evict") || !strcmp(xeq,
"fevict")) && args.
Arg2Len == -2)
112 {std::string path = args.ArgP[0];
115 {
case 0:
if (hProc) hProc->
Hide(path.c_str());
117 case -ENOENT: rc =
SFS_OK;
119 case -EBUSY:
ec = ENOTTY;
121 msg =
"file is in use";
123 case -EAGAIN: rc = 5;
126 msg =
"unlink failed";
129 TRACE(
Info,
"Cache "<<xeq<<
' '<<path<<
" rc="<<
ec<<
" ec="<<
ec<<
" msg="<<msg);
135 if (!strcmp(xeq,
"cached"))
137 const char* path = args.ArgP[0];
148 TRACE(
Info,
"Cache "<<xeq<<
' '<<path<<
" rc="<<
ec<<
" ec="<<
ec<<
" msg=file not in cache");
const char * Arg1
PLUGINO, PLUGION, PLUGXC.
int Arg2Len
Length or -count of args in extension.
< SFS_FSCTL_PLUGIN/PLUGIO/PLUGXC parms
The Plugins struct is used to pass plugin pointers to configure.
static void Hide(const char *thePath)
void * GetPtr(const char *varname)
int setErrInfo(int code, const char *emsg)
virtual int FSctl(const int cmd, int alen, const char *args, XrdSfsFile &file, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0) override
XrdPfcFSctl(XrdPfc::Cache &cInst, XrdSysLogger *logP)
Constructor.
virtual bool Configure(const char *CfgFN, const char *Parms, XrdOucEnv *envP, const Plugins &plugs) override
Attaches/creates and detaches/deletes cache-io objects for disk based cache.
virtual int ConsiderCached(const char *url)
int UnlinkFile(const std::string &f_name, bool fail_if_open)
Remove cinfo and data files from cache.