mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] core: use list_move()
This patch converts the combination of list_del(A) and list_add(A, B) to list_move(A, B). Cc: Greg Kroah-Hartman <[email protected]> Cc: Ram Pai <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a7addcea6a
commit
1bfba4e8ea
8 changed files with 22 additions and 38 deletions
10
fs/libfs.c
10
fs/libfs.c
|
|
@ -149,10 +149,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
|||
/* fallthrough */
|
||||
default:
|
||||
spin_lock(&dcache_lock);
|
||||
if (filp->f_pos == 2) {
|
||||
list_del(q);
|
||||
list_add(q, &dentry->d_subdirs);
|
||||
}
|
||||
if (filp->f_pos == 2)
|
||||
list_move(q, &dentry->d_subdirs);
|
||||
|
||||
for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
|
||||
struct dentry *next;
|
||||
next = list_entry(p, struct dentry, d_u.d_child);
|
||||
|
|
@ -164,8 +163,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
|||
return 0;
|
||||
spin_lock(&dcache_lock);
|
||||
/* next is still alive */
|
||||
list_del(q);
|
||||
list_add(q, p);
|
||||
list_move(q, p);
|
||||
p = q;
|
||||
filp->f_pos++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue