Skip to content

Commit

Permalink
Merge pull request #997 from trapexit/link-getattr
Browse files Browse the repository at this point in the history
Call FUSE getattr rather than syscall for extra logic
  • Loading branch information
trapexit authored Dec 18, 2021
2 parents 34c684a + c43b464 commit f159fe6
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/fuse_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ namespace l
const string &newbasepath_,
const char *oldfusepath_,
const char *newfusepath_,
const string &newfusedirpath_,
struct stat *st_)
const string &newfusedirpath_)
{
int rv;
int error;
Expand All @@ -84,9 +83,6 @@ namespace l
rv = fs::link(oldfullpath,newfullpath);
}

if((rv == 0) && (st_->st_ino == 0))
rv = fs::lstat(oldfullpath,st_);

error = error::calc(rv,error,errno);
}

Expand All @@ -99,8 +95,7 @@ namespace l
const Policy::Action &actionFunc_,
const Branches &branches_,
const char *oldfusepath_,
const char *newfusepath_,
struct stat *st_)
const char *newfusepath_)
{
int rv;
string newfusedirpath;
Expand All @@ -119,8 +114,7 @@ namespace l

return l::link_create_path_loop(oldbasepaths,newbasepaths[0],
oldfusepath_,newfusepath_,
newfusedirpath,
st_);
newfusedirpath);
}

static
Expand Down Expand Up @@ -208,8 +202,7 @@ namespace l
cfg_->func.link.policy,
cfg_->branches,
oldpath_,
newpath_,
st_);
newpath_);
}

static
Expand All @@ -223,13 +216,10 @@ namespace l
int rv;

rv = l::link(cfg_,oldpath_,newpath_,st_);
if(rv < 0)
return rv;

timeouts_->entry = ((rv >= 0) ?
cfg_->cache_entry :
cfg_->cache_negative_entry);
timeouts_->attr = cfg_->cache_attr;

return rv;
return FUSE::getattr(newpath_,st_,timeouts_);
}

static
Expand Down

0 comments on commit f159fe6

Please sign in to comment.