ceph: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 5 Sep 2012 06:34:32 +0000 (14:34 +0800)
committerAlex Elder <elder@inktank.com>
Mon, 1 Oct 2012 19:30:49 +0000 (14:30 -0500)
Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sage Weil <sage@inktank.com>
net/ceph/pagelist.c

index 665cd23020ff98f0535ee3d0d70e539fd5f00fff..92866bebb65fe2ac438a10c068f18da5a1912018 100644 (file)
@@ -1,4 +1,3 @@
-
 #include <linux/module.h>
 #include <linux/gfp.h>
 #include <linux/pagemap.h>
@@ -134,8 +133,8 @@ int ceph_pagelist_truncate(struct ceph_pagelist *pl,
        ceph_pagelist_unmap_tail(pl);
        while (pl->head.prev != c->page_lru) {
                page = list_entry(pl->head.prev, struct page, lru);
-               list_del(&page->lru);                /* remove from pagelist */
-               list_add_tail(&page->lru, &pl->free_list); /* add to reserve */
+               /* move from pagelist to reserve */
+               list_move_tail(&page->lru, &pl->free_list);
                ++pl->num_pages_free;
        }
        pl->room = c->room;