Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dm vdo: Update code to use mem_is_zero

Remove function that would check if data was all zeroes. Use the
built-in kernel function mem_is_zero() instead.

Signed-off-by: Bruce Johnston <bjohnsto@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

authored by

Bruce Johnston and committed by
Mikulas Patocka
e828a187 2b1c6d7a

+3 -14
+3 -14
drivers/md/dm-vdo/data-vio.c
··· 17 17 #include <linux/minmax.h> 18 18 #include <linux/sched.h> 19 19 #include <linux/spinlock.h> 20 + #include <linux/string.h> 20 21 #include <linux/wait.h> 21 22 22 23 #include "logger.h" ··· 510 509 vdo_enqueue_completion(completion, VDO_DEFAULT_Q_MAP_BIO_PRIORITY); 511 510 } 512 511 513 - static bool is_zero_block(char *block) 514 - { 515 - int i; 516 - 517 - for (i = 0; i < VDO_BLOCK_SIZE; i += sizeof(u64)) { 518 - if (*((u64 *) &block[i])) 519 - return false; 520 - } 521 - 522 - return true; 523 - } 524 - 525 512 static void copy_from_bio(struct bio *bio, char *data_ptr) 526 513 { 527 514 struct bio_vec biovec; ··· 561 572 * we acknowledge the bio. 562 573 */ 563 574 copy_from_bio(bio, data_vio->vio.data); 564 - data_vio->is_zero = is_zero_block(data_vio->vio.data); 575 + data_vio->is_zero = mem_is_zero(data_vio->vio.data, VDO_BLOCK_SIZE); 565 576 data_vio->write = true; 566 577 } 567 578 ··· 1448 1459 copy_from_bio(bio, data + data_vio->offset); 1449 1460 } 1450 1461 1451 - data_vio->is_zero = is_zero_block(data); 1462 + data_vio->is_zero = mem_is_zero(data, VDO_BLOCK_SIZE); 1452 1463 data_vio->read = false; 1453 1464 launch_data_vio_logical_callback(data_vio, 1454 1465 continue_data_vio_with_block_map_slot);