diff options
author | Steve French <stfrench@microsoft.com> | 2023-09-19 19:35:53 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-09-19 21:32:02 +0300 |
commit | 2da338ff752a2789470d733111a5241f30026675 (patch) | |
tree | 06b78b25341ba966454dc9a641c825e5f42abf80 /fs/smb/client/misc.c | |
parent | e3603ccf4a35fdf433ee7b60bb7cfb598f19c8fa (diff) | |
download | linux-2da338ff752a2789470d733111a5241f30026675.tar.xz |
smb3: do not start laundromat thread when dir leases
disabled
When no directory lease support, or for IPC shares where directories
can not be opened, do not start an unneeded laundromat thread for
that mount (it wastes resources).
Fixes: d14de8067e3f ("cifs: Add a laundromat thread for cached directories")
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Acked-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/misc.c')
-rw-r--r-- | fs/smb/client/misc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 366b755ca913..35b176457bbe 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -113,18 +113,22 @@ sesInfoFree(struct cifs_ses *buf_to_free) } struct cifs_tcon * -tconInfoAlloc(void) +tcon_info_alloc(bool dir_leases_enabled) { struct cifs_tcon *ret_buf; ret_buf = kzalloc(sizeof(*ret_buf), GFP_KERNEL); if (!ret_buf) return NULL; - ret_buf->cfids = init_cached_dirs(); - if (!ret_buf->cfids) { - kfree(ret_buf); - return NULL; + + if (dir_leases_enabled == true) { + ret_buf->cfids = init_cached_dirs(); + if (!ret_buf->cfids) { + kfree(ret_buf); + return NULL; + } } + /* else ret_buf->cfids is already set to NULL above */ atomic_inc(&tconInfoAllocCount); ret_buf->status = TID_NEW; |