From: Alex Elder Date: Thu, 7 Mar 2013 05:39:38 +0000 (-0600) Subject: libceph: advance pagelist with list_rotate_left() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35c7bfbcd4fabded090e5ab316a1cbf053a0a980;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git libceph: advance pagelist with list_rotate_left() While processing an outgoing pagelist (either the data pagelist or trail) in a ceph message, the messenger cycles through each of the pages on the list. This is accomplished in out_msg_pos_next(), if the end of the first page on the list is reached, the first page is moved to the end of the list. There is a list operation, list_rotate_left(), which performs exactly this operation, and by using it, what's really going on becomes more obvious. So replace these two list_move_tail() calls with list_rotate_left(). Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index fb5f6e7d57a3..2734d0337f95 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1041,11 +1041,9 @@ static void out_msg_pos_next(struct ceph_connection *con, struct page *page, con->out_msg_pos.page++; con->out_msg_pos.did_page_crc = false; if (in_trail) - list_move_tail(&page->lru, - &msg->trail->head); + list_rotate_left(&msg->trail->head); else if (msg->pagelist) - list_move_tail(&page->lru, - &msg->pagelist->head); + list_rotate_left(&msg->pagelist->head); #ifdef CONFIG_BLOCK else if (msg->bio) iter_bio_next(&msg->bio_iter, &msg->bio_seg);