Commit 35c7bfbc authored by Alex Elder's avatar Alex Elder Committed by Sage Weil

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: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent e788182f
...@@ -1041,11 +1041,9 @@ static void out_msg_pos_next(struct ceph_connection *con, struct page *page, ...@@ -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.page++;
con->out_msg_pos.did_page_crc = false; con->out_msg_pos.did_page_crc = false;
if (in_trail) if (in_trail)
list_move_tail(&page->lru, list_rotate_left(&msg->trail->head);
&msg->trail->head);
else if (msg->pagelist) else if (msg->pagelist)
list_move_tail(&page->lru, list_rotate_left(&msg->pagelist->head);
&msg->pagelist->head);
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
else if (msg->bio) else if (msg->bio)
iter_bio_next(&msg->bio_iter, &msg->bio_seg); iter_bio_next(&msg->bio_iter, &msg->bio_seg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment