* [PATCH] ceph: [PATCH] ceph: use list_move_tail instead of list_del/list_add_tail
@ 2012-09-05 6:34 Wei Yongjun
2012-09-05 15:48 ` Sage Weil
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-09-05 6:34 UTC (permalink / raw)
To: sage, davem; +Cc: yongjun_wei, ceph-devel, netdev
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Using list_move_tail() instead of list_del() + list_add_tail().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
net/ceph/pagelist.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/ceph/pagelist.c b/net/ceph/pagelist.c
index 665cd23..92866be 100644
--- a/net/ceph/pagelist.c
+++ b/net/ceph/pagelist.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ceph: [PATCH] ceph: use list_move_tail instead of list_del/list_add_tail
2012-09-05 6:34 [PATCH] ceph: [PATCH] ceph: use list_move_tail instead of list_del/list_add_tail Wei Yongjun
@ 2012-09-05 15:48 ` Sage Weil
0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2012-09-05 15:48 UTC (permalink / raw)
To: Wei Yongjun; +Cc: davem, yongjun_wei, ceph-devel, netdev
Applied to the ceph queue. Thanks!
sage
On Wed, 5 Sep 2012, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using list_move_tail() instead of list_del() + list_add_tail().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> net/ceph/pagelist.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/ceph/pagelist.c b/net/ceph/pagelist.c
> index 665cd23..92866be 100644
> --- a/net/ceph/pagelist.c
> +++ b/net/ceph/pagelist.c
> @@ -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;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-05 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 6:34 [PATCH] ceph: [PATCH] ceph: use list_move_tail instead of list_del/list_add_tail Wei Yongjun
2012-09-05 15:48 ` Sage Weil
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.