spin_unlock(&table->cache_lock);
}
-/*
- * helper function to run the xor_blocks api. It is only
- * able to do MAX_XOR_BLOCKS at a time, so we need to
- * loop through.
- */
-static void run_xor(void **pages, int src_cnt, ssize_t len)
-{
- int src_off = 0;
- int xor_src_cnt = 0;
- void *dest = pages[src_cnt];
-
- while(src_cnt > 0) {
- xor_src_cnt = min(src_cnt, MAX_XOR_BLOCKS);
- xor_blocks(xor_src_cnt, len, dest, pages + src_off);
-
- src_cnt -= xor_src_cnt;
- src_off += xor_src_cnt;
- }
-}
-
/*
* Returns true if the bio list inside this rbio covers an entire stripe (no
* rmw required).
} else {
/* raid5 */
memcpy(pointers[rbio->nr_data], pointers[0], step);
- run_xor(pointers + 1, rbio->nr_data - 1, step);
+ xor_gen(pointers[rbio->nr_data], pointers + 1, rbio->nr_data - 1,
+ step);
}
for (stripe = stripe - 1; stripe >= 0; stripe--)
kunmap_local(pointers[stripe]);
pointers[rbio->nr_data - 1] = p;
/* Xor in the rest */
- run_xor(pointers, rbio->nr_data - 1, step);
+ xor_gen(p, pointers, rbio->nr_data - 1, step);
}
cleanup:
} else {
/* RAID5. */
memcpy(pointers[nr_data], pointers[0], step);
- run_xor(pointers + 1, nr_data - 1, step);
+ xor_gen(pointers[nr_data], pointers + 1, nr_data - 1, step);
}
/* Check scrubbing parity and repair it. */