Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative cache failed lookups. This saves a FUSE operation when #56

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,18 @@ static void sqfs_ll_op_lookup(fuse_req_t req, fuse_ino_t parent,
return;
}
if (!found) {
fuse_reply_err(req, ENOENT);
/* Returning with zero inode indicates not found with
* timeout, i.e. future lookups of this name will not generate
* fuse requests.
*/
struct fuse_entry_param fentry;
memset(&fentry, 0, sizeof(fentry));
fentry.attr_timeout = fentry.entry_timeout = SQFS_TIMEOUT;
fentry.ino = 0;
fuse_reply_entry(req, &fentry);
return;
}

if (sqfs_inode_get(&lli.ll->fs, &inode, sqfs_dentry_inode(&entry))) {
fuse_reply_err(req, ENOENT);
} else {
Expand Down