mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
block: Consolidate static integrity profile properties
We previously made a complete copy of a device's data integrity profile even though several of the fields inside the blk_integrity struct are pointers to fixed template entries in t10-pi.c. Split the static and per-device portions so that we can reference the template directly. Signed-off-by: Martin K. Petersen <[email protected]> Reported-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Cc: Dan Williams <[email protected]> Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
aff34e192e
commit
0f8087ecde
9 changed files with 65 additions and 64 deletions
|
|
@ -177,11 +177,11 @@ bool bio_integrity_enabled(struct bio *bio)
|
|||
if (bi == NULL)
|
||||
return false;
|
||||
|
||||
if (bio_data_dir(bio) == READ && bi->verify_fn != NULL &&
|
||||
if (bio_data_dir(bio) == READ && bi->profile->verify_fn != NULL &&
|
||||
(bi->flags & BLK_INTEGRITY_VERIFY))
|
||||
return true;
|
||||
|
||||
if (bio_data_dir(bio) == WRITE && bi->generate_fn != NULL &&
|
||||
if (bio_data_dir(bio) == WRITE && bi->profile->generate_fn != NULL &&
|
||||
(bi->flags & BLK_INTEGRITY_GENERATE))
|
||||
return true;
|
||||
|
||||
|
|
@ -340,7 +340,7 @@ int bio_integrity_prep(struct bio *bio)
|
|||
|
||||
/* Auto-generate integrity metadata if this is a write */
|
||||
if (bio_data_dir(bio) == WRITE)
|
||||
bio_integrity_process(bio, bi->generate_fn);
|
||||
bio_integrity_process(bio, bi->profile->generate_fn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -361,7 +361,7 @@ static void bio_integrity_verify_fn(struct work_struct *work)
|
|||
struct bio *bio = bip->bip_bio;
|
||||
struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
|
||||
|
||||
bio->bi_error = bio_integrity_process(bio, bi->verify_fn);
|
||||
bio->bi_error = bio_integrity_process(bio, bi->profile->verify_fn);
|
||||
|
||||
/* Restore original bio completion handler */
|
||||
bio->bi_end_io = bip->bip_end_io;
|
||||
|
|
|
|||
Loading…
Reference in a new issue