Skip to content

Commit

Permalink
NFS: Allow applications to speed up readdir+statx() using AT_STATX_DO…
Browse files Browse the repository at this point in the history
…NT_SYNC

If the application uses the AT_STATX_DONT_SYNC flag after doing readdir(),
then we should still mark the parent inode as seeing a readdirplus hit.
That ensures that we continue to use readdirplus in the 'ls -l' type
of workflow to do fast lookups of the dentries.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Jul 13, 2020
1 parent 11ba468 commit ac7cbb2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,10 @@ int nfs_getattr(const struct path *path, struct kstat *stat,

trace_nfs_getattr_enter(inode);

if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync)
if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync) {
nfs_readdirplus_parent_cache_hit(path->dentry);
goto out_no_update;
}

/* Flush out writes to the server in order to update c/mtime. */
if ((request_mask & (STATX_CTIME|STATX_MTIME)) &&
Expand Down

0 comments on commit ac7cbb2

Please sign in to comment.