Remove 'all' policy and simplify logic

This commit is contained in:
Antonio SJ Musumeci 2015-02-02 21:10:36 -05:00
parent 1f61a662ad
commit b411c63df1
26 changed files with 178 additions and 285 deletions

View file

@ -107,18 +107,18 @@ _getxattr(const fs::SearchFunc searchFunc,
{
#ifndef WITHOUT_XATTR
int rv;
fs::PathVector paths;
fs::Path path;
rv = searchFunc(srcmounts,fusepath,paths);
rv = searchFunc(srcmounts,fusepath,path);
if(rv == -1)
return -errno;
if(!strcmp(attrname,"user.mergerfs.basepath"))
rv = ::_getxattr_from_string(buf,count,paths[0].base);
rv = ::_getxattr_from_string(buf,count,path.base);
else if(!strcmp(attrname,"user.mergerfs.fullpath"))
rv = ::_getxattr_from_string(buf,count,paths[0].full);
rv = ::_getxattr_from_string(buf,count,path.full);
else
rv = ::lgetxattr(paths[0].full.c_str(),attrname,buf,count);
rv = ::lgetxattr(path.full.c_str(),attrname,buf,count);
return ((rv == -1) ? -errno : rv);
#else