aboutsummaryrefslogtreecommitdiffstats
path: root/fs/smb/client/cifsfs.c
diff options
context:
space:
mode:
authorBharath SM <bharathsm@microsoft.com>2025-09-29 15:57:46 -0500
committerSteve French <stfrench@microsoft.com>2025-10-01 21:49:53 -0500
commit63eb8bd6c81d84a23fdc18fffd604e3ea38bb96c (patch)
treea9c7c02f27c2e621b34286cea8122284ad27ed08 /fs/smb/client/cifsfs.c
parentsmb: client: add drop_dir_cache module parameter to invalidate cached dirents (diff)
downloadlinux-63eb8bd6c81d84a23fdc18fffd604e3ea38bb96c.tar.gz
linux-63eb8bd6c81d84a23fdc18fffd604e3ea38bb96c.zip
smb: client: account smb directory cache usage and per-tcon totals
Add lightweight accounting for directory lease cache usage to aid debugging and limiting cache size in future. Track per-directory entry/byte counts and maintain per-tcon aggregates. Also expose the totals in /proc/fs/cifs/open_dirs. Signed-off-by: Bharath SM <bharathsm@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/cifsfs.c')
-rw-r--r--fs/smb/client/cifsfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 9a83f528d39d..1775c2b7528f 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -121,6 +121,8 @@ unsigned int dir_cache_timeout = 30;
module_param(dir_cache_timeout, uint, 0644);
MODULE_PARM_DESC(dir_cache_timeout, "Number of seconds to cache directory contents for which we have a lease. Default: 30 "
"Range: 1 to 65000 seconds, 0 to disable caching dir contents");
+/* Module-wide total cached dirents (in bytes) across all tcons */
+atomic64_t cifs_dircache_bytes_used = ATOMIC64_INIT(0);
/*
* Write-only module parameter to drop all cached directory entries across