diff mbox series

[v5,09/10] scsi: add support for user-meta interface

Message ID 20241029162402.21400-10-anuj20.g@samsung.com (mailing list archive)
State Superseded
Headers show
Series [v5,01/10] block: define set of integrity flags to be inherited by cloned bip | expand

Commit Message

Anuj Gupta Oct. 29, 2024, 4:24 p.m. UTC
Add support for sending user-meta buffer. Set tags to be checked
using flags specified by user/block-layer.

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 drivers/scsi/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Oct. 30, 2024, 5:10 a.m. UTC | #1
On Tue, Oct 29, 2024 at 09:54:01PM +0530, Anuj Gupta wrote:
> Add support for sending user-meta buffer. Set tags to be checked
> using flags specified by user/block-layer.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

> -		if (bio_integrity_flagged(bio, BIP_CTRL_NOCHECK) == false)
> +		if (bio_integrity_flagged(bio, BIP_CHECK_GUARD))
>  			scmd->prot_flags |= SCSI_PROT_GUARD_CHECK;
>  	}
>  
>  	if (dif != T10_PI_TYPE3_PROTECTION) {	/* DIX/DIF Type 0, 1, 2 */
>  		scmd->prot_flags |= SCSI_PROT_REF_INCREMENT;
>  
> -		if (bio_integrity_flagged(bio, BIP_CTRL_NOCHECK) == false)
> +		if (bio_integrity_flagged(bio, BIP_CHECK_REFTAG))

BIP_CTRL_NOCHECK is unused now, and should probably go away.
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index ca4bc0ac76ad..d1a2ae0d4c29 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -814,14 +814,14 @@  static unsigned char sd_setup_protect_cmnd(struct scsi_cmnd *scmd,
 		if (bio_integrity_flagged(bio, BIP_IP_CHECKSUM))
 			scmd->prot_flags |= SCSI_PROT_IP_CHECKSUM;
 
-		if (bio_integrity_flagged(bio, BIP_CTRL_NOCHECK) == false)
+		if (bio_integrity_flagged(bio, BIP_CHECK_GUARD))
 			scmd->prot_flags |= SCSI_PROT_GUARD_CHECK;
 	}
 
 	if (dif != T10_PI_TYPE3_PROTECTION) {	/* DIX/DIF Type 0, 1, 2 */
 		scmd->prot_flags |= SCSI_PROT_REF_INCREMENT;
 
-		if (bio_integrity_flagged(bio, BIP_CTRL_NOCHECK) == false)
+		if (bio_integrity_flagged(bio, BIP_CHECK_REFTAG))
 			scmd->prot_flags |= SCSI_PROT_REF_CHECK;
 	}