@@ -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);
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(-)