diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-06-26 00:24:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 09:58:17 -0700 |
commit | 1bfba4e8ea0e555e3a0296051517d96253660ccc (patch) | |
tree | 48ced9016b5c08f1be217677c25e6879c07b5278 /fs/libfs.c | |
parent | a7addcea6ac7c0e9733a48cda06ca0880f116a48 (diff) | |
download | op-kernel-dev-1bfba4e8ea0e555e3a0296051517d96253660ccc.zip op-kernel-dev-1bfba4e8ea0e555e3a0296051517d96253660ccc.tar.gz |
[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 <gregkh@suse.de>
Cc: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/libfs.c')
-rw-r--r-- | fs/libfs.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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++; } |