Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc4829e5 authored by Wei Yongjun's avatar Wei Yongjun Committed by Alex Elder
Browse files

ceph: use list_move_tail instead of list_del/list_add_tail



Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarSage Weil <sage@inktank.com>
parent 523f3258
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line

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