* [PATCH] cifs: use list_move instead of list_del + list_add
@ 2022-09-24 4:32 Sun Ke
0 siblings, 0 replies; only message in thread
From: Sun Ke @ 2022-09-24 4:32 UTC (permalink / raw)
To: sfrench; +Cc: linux-cifs, samba-technical, kernel-janitors, lsahlber, sunke32
Using list_move() instead of list_del() + list_add().
Signed-off-by: Sun Ke <sunke32@huawei.com>
---
fs/cifs/cached_dir.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/cifs/cached_dir.c b/fs/cifs/cached_dir.c
index b58bed63db1e..68f86f052dba 100644
--- a/fs/cifs/cached_dir.c
+++ b/fs/cifs/cached_dir.c
@@ -389,8 +389,7 @@ void invalidate_all_cached_dirs(struct cifs_tcon *tcon)
INIT_LIST_HEAD(&entry);
spin_lock(&cfids->cfid_list_lock);
list_for_each_entry_safe(cfid, q, &cfids->entries, entry) {
- list_del(&cfid->entry);
- list_add(&cfid->entry, &entry);
+ list_move(&cfid->entry, &entry);
cfids->num_entries--;
cfid->is_open = false;
/* To prevent race with smb2_cached_lease_break() */
@@ -531,8 +530,7 @@ void free_cached_dirs(struct cached_fids *cfids)
list_for_each_entry_safe(cfid, q, &cfids->entries, entry) {
cfid->on_list = false;
cfid->is_open = false;
- list_del(&cfid->entry);
- list_add(&cfid->entry, &entry);
+ list_move(&cfid->entry, &entry);
}
spin_unlock(&cfids->cfid_list_lock);
--
2.31.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-24 4:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24 4:32 [PATCH] cifs: use list_move instead of list_del + list_add Sun Ke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).