vfs: use list_move instead of list_del/list_add
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 11 Mar 2013 16:10:50 +0000 (00:10 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 4 May 2013 19:43:02 +0000 (15:43 -0400)
Using list_move() instead of list_del() + list_add().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c

index a161ebcab9d28370226fd0b6a0371c604a915fc7..f09b9085f7d849e235a2b8d77c079de71c96f5d2 100644 (file)
@@ -2397,8 +2397,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
        dentry->d_parent = dentry;
        list_del_init(&dentry->d_u.d_child);
        anon->d_parent = dparent;
-       list_del(&anon->d_u.d_child);
-       list_add(&anon->d_u.d_child, &dparent->d_subdirs);
+       list_move(&anon->d_u.d_child, &dparent->d_subdirs);
 
        write_seqcount_end(&dentry->d_seq);
        write_seqcount_end(&anon->d_seq);