Commit 8c77f1cb authored by Baokun Li's avatar Baokun Li Committed by Mike Snitzer

dm writecache: use list_move instead of list_del/list_add in writecache_writeback()

Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 991bd8d7
......@@ -1864,15 +1864,13 @@ static void writecache_writeback(struct work_struct *work)
if (unlikely(read_original_sector(wc, f) ==
read_original_sector(wc, e))) {
BUG_ON(!f->write_in_progress);
list_del(&e->lru);
list_add(&e->lru, &skipped);
list_move(&e->lru, &skipped);
cond_resched();
continue;
}
}
wc->writeback_size++;
list_del(&e->lru);
list_add(&e->lru, &wbl.list);
list_move(&e->lru, &wbl.list);
wbl.size++;
e->write_in_progress = true;
e->wc_list_contiguous = 1;
......@@ -1907,8 +1905,7 @@ static void writecache_writeback(struct work_struct *work)
// break;
wc->writeback_size++;
list_del(&g->lru);
list_add(&g->lru, &wbl.list);
list_move(&g->lru, &wbl.list);
wbl.size++;
g->write_in_progress = true;
g->wc_list_contiguous = BIO_MAX_VECS;
......
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