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: rename tuple_size field in blk_integrity to metadata_size

The tuple_size field in blk_integrity currently represents the total
size of metadata associated with each data interval. To make the meaning
more explicit, rename tuple_size to metadata_size. This is a purely
mechanical rename with no functional changes.

Suggested-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://lore.kernel.org/20250630090548.3317-2-anuj20.g@samsung.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Anuj Gupta and committed by
Christian Brauner
c6603b1d 19272b37

+29 -29
+2 -2
block/bio-integrity-auto.c
··· 54 54 { 55 55 switch (bi->csum_type) { 56 56 case BLK_INTEGRITY_CSUM_CRC64: 57 - return bi->tuple_size == sizeof(struct crc64_pi_tuple); 57 + return bi->metadata_size == sizeof(struct crc64_pi_tuple); 58 58 case BLK_INTEGRITY_CSUM_CRC: 59 59 case BLK_INTEGRITY_CSUM_IP: 60 - return bi->tuple_size == sizeof(struct t10_pi_tuple); 60 + return bi->metadata_size == sizeof(struct t10_pi_tuple); 61 61 default: 62 62 pr_warn_once("%s: unknown integrity checksum type:%d\n", 63 63 __func__, bi->csum_type);
+1 -1
block/blk-integrity.c
··· 239 239 { 240 240 struct blk_integrity *bi = dev_to_bi(dev); 241 241 242 - if (!bi->tuple_size) 242 + if (!bi->metadata_size) 243 243 return sysfs_emit(page, "none\n"); 244 244 return sysfs_emit(page, "%s\n", blk_integrity_profile_name(bi)); 245 245 }
+3 -3
block/blk-settings.c
··· 114 114 { 115 115 struct blk_integrity *bi = &lim->integrity; 116 116 117 - if (!bi->tuple_size) { 117 + if (!bi->metadata_size) { 118 118 if (bi->csum_type != BLK_INTEGRITY_CSUM_NONE || 119 119 bi->tag_size || ((bi->flags & BLK_INTEGRITY_REF_TAG))) { 120 120 pr_warn("invalid PI settings.\n"); ··· 875 875 return true; 876 876 877 877 if (ti->flags & BLK_INTEGRITY_STACKED) { 878 - if (ti->tuple_size != bi->tuple_size) 878 + if (ti->metadata_size != bi->metadata_size) 879 879 goto incompatible; 880 880 if (ti->interval_exp != bi->interval_exp) 881 881 goto incompatible; ··· 891 891 ti->flags |= (bi->flags & BLK_INTEGRITY_DEVICE_CAPABLE) | 892 892 (bi->flags & BLK_INTEGRITY_REF_TAG); 893 893 ti->csum_type = bi->csum_type; 894 - ti->tuple_size = bi->tuple_size; 894 + ti->metadata_size = bi->metadata_size; 895 895 ti->pi_offset = bi->pi_offset; 896 896 ti->interval_exp = bi->interval_exp; 897 897 ti->tag_size = bi->tag_size;
+8 -8
block/t10-pi.c
··· 56 56 pi->ref_tag = 0; 57 57 58 58 iter->data_buf += iter->interval; 59 - iter->prot_buf += bi->tuple_size; 59 + iter->prot_buf += bi->metadata_size; 60 60 iter->seed++; 61 61 } 62 62 } ··· 105 105 106 106 next: 107 107 iter->data_buf += iter->interval; 108 - iter->prot_buf += bi->tuple_size; 108 + iter->prot_buf += bi->metadata_size; 109 109 iter->seed++; 110 110 } 111 111 ··· 125 125 static void t10_pi_type1_prepare(struct request *rq) 126 126 { 127 127 struct blk_integrity *bi = &rq->q->limits.integrity; 128 - const int tuple_sz = bi->tuple_size; 128 + const int tuple_sz = bi->metadata_size; 129 129 u32 ref_tag = t10_pi_ref_tag(rq); 130 130 u8 offset = bi->pi_offset; 131 131 struct bio *bio; ··· 177 177 { 178 178 struct blk_integrity *bi = &rq->q->limits.integrity; 179 179 unsigned intervals = nr_bytes >> bi->interval_exp; 180 - const int tuple_sz = bi->tuple_size; 180 + const int tuple_sz = bi->metadata_size; 181 181 u32 ref_tag = t10_pi_ref_tag(rq); 182 182 u8 offset = bi->pi_offset; 183 183 struct bio *bio; ··· 234 234 put_unaligned_be48(0ULL, pi->ref_tag); 235 235 236 236 iter->data_buf += iter->interval; 237 - iter->prot_buf += bi->tuple_size; 237 + iter->prot_buf += bi->metadata_size; 238 238 iter->seed++; 239 239 } 240 240 } ··· 289 289 290 290 next: 291 291 iter->data_buf += iter->interval; 292 - iter->prot_buf += bi->tuple_size; 292 + iter->prot_buf += bi->metadata_size; 293 293 iter->seed++; 294 294 } 295 295 ··· 299 299 static void ext_pi_type1_prepare(struct request *rq) 300 300 { 301 301 struct blk_integrity *bi = &rq->q->limits.integrity; 302 - const int tuple_sz = bi->tuple_size; 302 + const int tuple_sz = bi->metadata_size; 303 303 u64 ref_tag = ext_pi_ref_tag(rq); 304 304 u8 offset = bi->pi_offset; 305 305 struct bio *bio; ··· 340 340 { 341 341 struct blk_integrity *bi = &rq->q->limits.integrity; 342 342 unsigned intervals = nr_bytes >> bi->interval_exp; 343 - const int tuple_sz = bi->tuple_size; 343 + const int tuple_sz = bi->metadata_size; 344 344 u64 ref_tag = ext_pi_ref_tag(rq); 345 345 u8 offset = bi->pi_offset; 346 346 struct bio *bio;
+2 -2
drivers/md/dm-crypt.c
··· 1189 1189 return -EINVAL; 1190 1190 } 1191 1191 1192 - if (bi->tuple_size < cc->used_tag_size) { 1192 + if (bi->metadata_size < cc->used_tag_size) { 1193 1193 ti->error = "Integrity profile tag size mismatch."; 1194 1194 return -EINVAL; 1195 1195 } 1196 - cc->tuple_size = bi->tuple_size; 1196 + cc->tuple_size = bi->metadata_size; 1197 1197 if (1 << bi->interval_exp != cc->sector_size) { 1198 1198 ti->error = "Integrity profile sector size mismatch."; 1199 1199 return -EINVAL;
+6 -6
drivers/md/dm-integrity.c
··· 3906 3906 struct blk_integrity *bi = &limits->integrity; 3907 3907 3908 3908 memset(bi, 0, sizeof(*bi)); 3909 - bi->tuple_size = ic->tag_size; 3910 - bi->tag_size = bi->tuple_size; 3909 + bi->metadata_size = ic->tag_size; 3910 + bi->tag_size = bi->metadata_size; 3911 3911 bi->interval_exp = 3912 3912 ic->sb->log2_sectors_per_block + SECTOR_SHIFT; 3913 3913 } ··· 4746 4746 ti->error = "Integrity profile not supported"; 4747 4747 goto bad; 4748 4748 } 4749 - /*printk("tag_size: %u, tuple_size: %u\n", bi->tag_size, bi->tuple_size);*/ 4750 - if (bi->tuple_size < ic->tag_size) { 4749 + /*printk("tag_size: %u, metadata_size: %u\n", bi->tag_size, bi->metadata_size);*/ 4750 + if (bi->metadata_size < ic->tag_size) { 4751 4751 r = -EINVAL; 4752 4752 ti->error = "The integrity profile is smaller than tag size"; 4753 4753 goto bad; 4754 4754 } 4755 - if ((unsigned long)bi->tuple_size > PAGE_SIZE / 2) { 4755 + if ((unsigned long)bi->metadata_size > PAGE_SIZE / 2) { 4756 4756 r = -EINVAL; 4757 4757 ti->error = "Too big tuple size"; 4758 4758 goto bad; 4759 4759 } 4760 - ic->tuple_size = bi->tuple_size; 4760 + ic->tuple_size = bi->metadata_size; 4761 4761 if (1 << bi->interval_exp != ic->sectors_per_block << SECTOR_SHIFT) { 4762 4762 r = -EINVAL; 4763 4763 ti->error = "Integrity profile sector size mismatch";
+1 -1
drivers/nvdimm/btt.c
··· 1506 1506 int rc; 1507 1507 1508 1508 if (btt_meta_size(btt) && IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)) { 1509 - lim.integrity.tuple_size = btt_meta_size(btt); 1509 + lim.integrity.metadata_size = btt_meta_size(btt); 1510 1510 lim.integrity.tag_size = btt_meta_size(btt); 1511 1511 } 1512 1512
+1 -1
drivers/nvme/host/core.c
··· 1866 1866 break; 1867 1867 } 1868 1868 1869 - bi->tuple_size = head->ms; 1869 + bi->metadata_size = head->ms; 1870 1870 bi->pi_offset = info->pi_offset; 1871 1871 return true; 1872 1872 }
+1 -1
drivers/nvme/target/io-cmd-bdev.c
··· 65 65 return; 66 66 67 67 if (bi->csum_type == BLK_INTEGRITY_CSUM_CRC) { 68 - ns->metadata_size = bi->tuple_size; 68 + ns->metadata_size = bi->metadata_size; 69 69 if (bi->flags & BLK_INTEGRITY_REF_TAG) 70 70 ns->pi_type = NVME_NS_DPS_PI_TYPE1; 71 71 else
+1 -1
drivers/scsi/sd_dif.c
··· 52 52 if (type != T10_PI_TYPE3_PROTECTION) 53 53 bi->flags |= BLK_INTEGRITY_REF_TAG; 54 54 55 - bi->tuple_size = sizeof(struct t10_pi_tuple); 55 + bi->metadata_size = sizeof(struct t10_pi_tuple); 56 56 57 57 if (dif && type) { 58 58 bi->flags |= BLK_INTEGRITY_DEVICE_CAPABLE;
+2 -2
include/linux/blk-integrity.h
··· 33 33 static inline bool 34 34 blk_integrity_queue_supports_integrity(struct request_queue *q) 35 35 { 36 - return q->limits.integrity.tuple_size; 36 + return q->limits.integrity.metadata_size; 37 37 } 38 38 39 39 static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk) ··· 74 74 static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi, 75 75 unsigned int sectors) 76 76 { 77 - return bio_integrity_intervals(bi, sectors) * bi->tuple_size; 77 + return bio_integrity_intervals(bi, sectors) * bi->metadata_size; 78 78 } 79 79 80 80 static inline bool blk_integrity_rq(struct request *rq)
+1 -1
include/linux/blkdev.h
··· 116 116 struct blk_integrity { 117 117 unsigned char flags; 118 118 enum blk_integrity_checksum csum_type; 119 - unsigned char tuple_size; 119 + unsigned char metadata_size; 120 120 unsigned char pi_offset; 121 121 unsigned char interval_exp; 122 122 unsigned char tag_size;