diff options
author | Bharath SM <bharathsm.hsk@gmail.com> | 2025-06-11 16:59:02 +0530 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2025-06-12 13:38:21 -0500 |
commit | 72dd7961a4bb4fa1fc456169a61dd12e68e50645 (patch) | |
tree | 798f77af2d54fafdc22fe8d15e7b071ed5be5314 /fs/btrfs/dev-replace.c | |
parent | b64af6bcd3b0f3fc633d6a70adb0991737abfef4 (diff) |
smb: improve directory cache reuse for readdir operations
Currently, cached directory contents were not reused across subsequent
'ls' operations because the cache validity check relied on comparing
the ctx pointer, which changes with each readdir invocation. As a
result, the cached dir entries was not marked as valid and the cache was
not utilized for subsequent 'ls' operations.
This change uses the file pointer, which remains consistent across all
readdir calls for a given directory instance, to associate and validate
the cache. As a result, cached directory contents can now be
correctly reused, improving performance for repeated directory listings.
Performance gains with local windows SMB server:
Without the patch and default actimeo=1:
1000 directory enumeration operations on dir with 10k files took 135.0s
With this patch and actimeo=0:
1000 directory enumeration operations on dir with 10k files took just 5.1s
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions