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:
Antonio SJ Musumeci 2026-11-29 23:10:57 -05:00
parent 7e29c3f72a
commit 271a4324a7

View file

@ -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