OSDN Git Service

smb3: allow controlling length of time directory entries are cached with dir leases
authorSteve French <stfrench@microsoft.com>
Thu, 31 Aug 2023 03:48:41 +0000 (22:48 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 31 Aug 2023 15:06:36 +0000 (10:06 -0500)
commit238b351d0935df568ecb3dc5aef25971778f0f7c
tree1effd48a53e69677b6c7f1c70ea5d373c295a6b7
parentefc0b0bcffcba60d9c6301063d25a22a4744b499
smb3: allow controlling length of time directory entries are cached with dir leases

Currently with directory leases we cache directory contents for a fixed period
of time (default 30 seconds) but for many workloads this is too short.  Allow
configuring the maximum amount of time directory entries are cached when a
directory lease is held on that directory. Add module load parm "max_dir_cache"

For example to set the timeout to 10 minutes you would do:

  echo 600 > /sys/module/cifs/parameters/dir_cache_timeout

or to disable caching directory contents:

  echo 0 > /sys/module/cifs/parameters/dir_cache_timeout

Reviewed-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cached_dir.c
fs/smb/client/cifsfs.c
fs/smb/client/cifsglob.h