Skip to content

Commit 76c7c44

Browse files
Anuj Guptakawasaki
authored andcommitted
block: introduce pi_size field in blk_integrity
Introduce a new pi_size field in struct blk_integrity to explicitly represent the size (in bytes) of the protection information (PI) tuple. This is a prep patch. Signed-off-by: Anuj Gupta <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]>
1 parent a73409f commit 76c7c44

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,7 @@ static bool nvme_init_integrity(struct nvme_ns_head *head,
18671867
}
18681868

18691869
bi->tuple_size = head->ms;
1870+
bi->pi_size = head->pi_size;
18701871
bi->pi_offset = info->pi_offset;
18711872
return true;
18721873
}

drivers/scsi/sd_dif.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ void sd_dif_config_host(struct scsi_disk *sdkp, struct queue_limits *lim)
5353
bi->flags |= BLK_INTEGRITY_REF_TAG;
5454

5555
bi->tuple_size = sizeof(struct t10_pi_tuple);
56+
bi->pi_size = bi->tuple_size;
5657

5758
if (dif && type) {
5859
bi->flags |= BLK_INTEGRITY_DEVICE_CAPABLE;

include/linux/blkdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct blk_integrity {
120120
unsigned char pi_offset;
121121
unsigned char interval_exp;
122122
unsigned char tag_size;
123+
unsigned char pi_size;
123124
};
124125

125126
typedef unsigned int __bitwise blk_mode_t;

0 commit comments

Comments
 (0)