summaryrefslogtreecommitdiff
path: root/fs/smb/client/misc.c
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2025-09-24 19:38:17 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2025-09-26 19:06:54 -0300
commitd2eceb4e7b9bfde214d1f489f59d89c061f89957 (patch)
tree51b5101abeeca91d05dda28dd2c7509460c2c55e /fs/smb/client/misc.c
parent0c5b5cf37953335c6cda3acef4888c8e9e2a91f7 (diff)
downloadlinux-d2eceb4e7b9bfde214d1f489f59d89c061f89957.tar.gz
linux-d2eceb4e7b9bfde214d1f489f59d89c061f89957.tar.bz2
linux-d2eceb4e7b9bfde214d1f489f59d89c061f89957.zip
smb: client: merge {close,invalidate}_all_cached_dirs()
close_all_cached_dirs(), invalidate_all_cached_dirs() and free_cached_dirs() have become too similar now, merge their functionality in a single static invalidate_all_cfids() function. This also allows removing free_cached_dirs() altogether as it only requires cancelling the work afterwards (done directly in tconInfoFree()). Other changes: - remove struct cached_dir_dentry Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Diffstat (limited to 'fs/smb/client/misc.c')
-rw-r--r--fs/smb/client/misc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c
index da23cc12a52c..8d70333a6a3d 100644
--- a/fs/smb/client/misc.c
+++ b/fs/smb/client/misc.c
@@ -169,7 +169,14 @@ tconInfoFree(struct cifs_tcon *tcon, enum smb3_tcon_ref_trace trace)
return;
}
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, trace);
- free_cached_dirs(tcon->cfids);
+
+ if (tcon->cfids) {
+ invalidate_all_cached_dirs(tcon->cfids);
+ cancel_delayed_work_sync(&tcon->cfids->laundromat_work);
+ kfree(tcon->cfids);
+ tcon->cfids = NULL;
+ }
+
atomic_dec(&tconInfoAllocCount);
kfree(tcon->nativeFileSystem);
kfree_sensitive(tcon->password);