mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-02 21:00:13 -05:00
refactor: use free_path_and_update_stat in setattr
setattr inlined a copy of the helper getattr uses. Call it instead. Unlike getattr, setattr does not turn a vanished node into ESTALE, so the helper's result is ignored there, as before.
This commit is contained in:
parent
7e29c3f72a
commit
271a4324a7
1 changed files with 3 additions and 10 deletions
|
|
@ -1766,16 +1766,9 @@ fuse_lib_setattr(fuse_req_t *req_,
|
|||
bool stat_updated = false;
|
||||
if(!err && (fusepath != NULL))
|
||||
{
|
||||
node_t *node;
|
||||
mutex_lock(f.lock);
|
||||
unlock_path(hdr_->nodeid,NULL,NULL);
|
||||
node = get_node(hdr_->nodeid);
|
||||
if(node)
|
||||
update_stat(node,&stbuf);
|
||||
if(f.lockq)
|
||||
wake_up_queued();
|
||||
mutex_unlock(f.lock);
|
||||
free(fusepath);
|
||||
// Unlike getattr a vanished node is not turned into ESTALE
|
||||
// here, so the helper's result is deliberately ignored.
|
||||
free_path_and_update_stat(hdr_->nodeid,fusepath,&stbuf);
|
||||
stat_updated = true;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue