mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
blk-integrity: empty implementation when disabled
This patch moves the blk_integrity_payload definition outside the CONFIG_BLK_DEV_INTERITY dependency and provides empty function implementations when the kernel configuration disables integrity extensions. This simplifies drivers that make use of these to map user data so they don't need to repeat the same configuration checks. Signed-off-by: Keith Busch <[email protected]> Updated by Jens to pass an error pointer return from bio_integrity_alloc(), otherwise if CONFIG_BLK_DEV_INTEGRITY isn't set, we return a weird ENOMEM from __nvme_submit_user_cmd() if a meta buffer is set. Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
9a0be7abb6
commit
06c1e3902a
4 changed files with 28 additions and 16 deletions
|
|
@ -613,9 +613,9 @@ iblock_alloc_bip(struct se_cmd *cmd, struct bio *bio)
|
|||
}
|
||||
|
||||
bip = bio_integrity_alloc(bio, GFP_NOIO, cmd->t_prot_nents);
|
||||
if (!bip) {
|
||||
if (IS_ERR(bip)) {
|
||||
pr_err("Unable to allocate bio_integrity_payload\n");
|
||||
return -ENOMEM;
|
||||
return PTR_ERR(bip);
|
||||
}
|
||||
|
||||
bip->bip_iter.bi_size = (cmd->data_length / dev->dev_attrib.block_size) *
|
||||
|
|
|
|||
Loading…
Reference in a new issue