Skip to content

Commit ac7cbb2

Browse files
author
Trond Myklebust
committed
NFS: Allow applications to speed up readdir+statx() using AT_STATX_DONT_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 <[email protected]>
1 parent 11ba468 commit ac7cbb2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/nfs/inode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,10 @@ int nfs_getattr(const struct path *path, struct kstat *stat,
794794

795795
trace_nfs_getattr_enter(inode);
796796

797-
if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync)
797+
if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync) {
798+
nfs_readdirplus_parent_cache_hit(path->dentry);
798799
goto out_no_update;
800+
}
799801

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

0 commit comments

Comments
 (0)