copy: speed up the speedup

This commit is contained in:
Thomas Schoebel-Theuer 2017-03-01 08:49:10 +01:00
parent 7e2de9c4ac
commit 0a9fcf5f8a

View File

@ -223,7 +223,11 @@ void copy_endio(struct generic_callback *cb)
brick = mref_a->brick;
CHECK_PTR(brick, err);
brick->check_hint = mref->ref_pos;
/* This is racy, but affects only a _hint_ for
* performance optimization.
*/
if (!brick->check_hint || mref->ref_pos < brick->check_hint)
brick->check_hint = mref->ref_pos;
queue = mref_a->queue;
index = GET_INDEX(mref->ref_pos);