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.

block: prepare generation / verification helpers for fs usage

Return the status from verify instead of directly stashing it in the bio,
and rename the helpers to use the usual bio_ prefix for things operating
on a bio.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
3f006268 7afe9394

+12 -10
+2 -2
block/bio-integrity-auto.c
··· 39 39 container_of(work, struct bio_integrity_data, work); 40 40 struct bio *bio = bid->bio; 41 41 42 - blk_integrity_verify_iter(bio, &bid->saved_bio_iter); 42 + bio->bi_status = bio_integrity_verify(bio, &bid->saved_bio_iter); 43 43 bio_integrity_finish(bid); 44 44 bio_endio(bio); 45 45 } ··· 100 100 101 101 /* Auto-generate integrity metadata if this is a write */ 102 102 if (bio_data_dir(bio) == WRITE && bip_should_check(&bid->bip)) 103 - blk_integrity_generate(bio); 103 + bio_integrity_generate(bio); 104 104 else 105 105 bid->saved_bio_iter = bio->bi_iter; 106 106 }
+4 -2
block/blk.h
··· 699 699 const struct blk_holder_ops *hops, struct file *bdev_file); 700 700 int bdev_permission(dev_t dev, blk_mode_t mode, void *holder); 701 701 702 - void blk_integrity_generate(struct bio *bio); 703 - void blk_integrity_verify_iter(struct bio *bio, struct bvec_iter *saved_iter); 702 + void bio_integrity_generate(struct bio *bio); 703 + blk_status_t bio_integrity_verify(struct bio *bio, 704 + struct bvec_iter *saved_iter); 705 + 704 706 void blk_integrity_prepare(struct request *rq); 705 707 void blk_integrity_complete(struct request *rq, unsigned int nr_bytes); 706 708
+6 -6
block/t10-pi.c
··· 372 372 } 373 373 } 374 374 375 - void blk_integrity_generate(struct bio *bio) 375 + void bio_integrity_generate(struct bio *bio) 376 376 { 377 377 struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk); 378 378 struct bio_integrity_payload *bip = bio_integrity(bio); ··· 404 404 } 405 405 } 406 406 407 - void blk_integrity_verify_iter(struct bio *bio, struct bvec_iter *saved_iter) 407 + blk_status_t bio_integrity_verify(struct bio *bio, struct bvec_iter *saved_iter) 408 408 { 409 409 struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk); 410 410 struct bio_integrity_payload *bip = bio_integrity(bio); ··· 439 439 } 440 440 kunmap_local(kaddr); 441 441 442 - if (ret) { 443 - bio->bi_status = ret; 444 - return; 445 - } 442 + if (ret) 443 + return ret; 446 444 } 445 + 446 + return BLK_STS_OK; 447 447 } 448 448 449 449 void blk_integrity_prepare(struct request *rq)