Skip to content

Commit c6603b1

Browse files
Anuj Guptabrauner
authored andcommitted
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>
1 parent 19272b3 commit c6603b1

12 files changed

Lines changed: 29 additions & 29 deletions

File tree

block/bio-integrity-auto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ static bool bi_offload_capable(struct blk_integrity *bi)
5454
{
5555
switch (bi->csum_type) {
5656
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);
5858
case BLK_INTEGRITY_CSUM_CRC:
5959
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);
6161
default:
6262
pr_warn_once("%s: unknown integrity checksum type:%d\n",
6363
__func__, bi->csum_type);

block/blk-integrity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static ssize_t format_show(struct device *dev, struct device_attribute *attr,
239239
{
240240
struct blk_integrity *bi = dev_to_bi(dev);
241241

242-
if (!bi->tuple_size)
242+
if (!bi->metadata_size)
243243
return sysfs_emit(page, "none\n");
244244
return sysfs_emit(page, "%s\n", blk_integrity_profile_name(bi));
245245
}

block/blk-settings.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)
114114
{
115115
struct blk_integrity *bi = &lim->integrity;
116116

117-
if (!bi->tuple_size) {
117+
if (!bi->metadata_size) {
118118
if (bi->csum_type != BLK_INTEGRITY_CSUM_NONE ||
119119
bi->tag_size || ((bi->flags & BLK_INTEGRITY_REF_TAG))) {
120120
pr_warn("invalid PI settings.\n");
@@ -875,7 +875,7 @@ bool queue_limits_stack_integrity(struct queue_limits *t,
875875
return true;
876876

877877
if (ti->flags & BLK_INTEGRITY_STACKED) {
878-
if (ti->tuple_size != bi->tuple_size)
878+
if (ti->metadata_size != bi->metadata_size)
879879
goto incompatible;
880880
if (ti->interval_exp != bi->interval_exp)
881881
goto incompatible;
@@ -891,7 +891,7 @@ bool queue_limits_stack_integrity(struct queue_limits *t,
891891
ti->flags |= (bi->flags & BLK_INTEGRITY_DEVICE_CAPABLE) |
892892
(bi->flags & BLK_INTEGRITY_REF_TAG);
893893
ti->csum_type = bi->csum_type;
894-
ti->tuple_size = bi->tuple_size;
894+
ti->metadata_size = bi->metadata_size;
895895
ti->pi_offset = bi->pi_offset;
896896
ti->interval_exp = bi->interval_exp;
897897
ti->tag_size = bi->tag_size;

block/t10-pi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void t10_pi_generate(struct blk_integrity_iter *iter,
5656
pi->ref_tag = 0;
5757

5858
iter->data_buf += iter->interval;
59-
iter->prot_buf += bi->tuple_size;
59+
iter->prot_buf += bi->metadata_size;
6060
iter->seed++;
6161
}
6262
}
@@ -105,7 +105,7 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter,
105105

106106
next:
107107
iter->data_buf += iter->interval;
108-
iter->prot_buf += bi->tuple_size;
108+
iter->prot_buf += bi->metadata_size;
109109
iter->seed++;
110110
}
111111

@@ -125,7 +125,7 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter,
125125
static void t10_pi_type1_prepare(struct request *rq)
126126
{
127127
struct blk_integrity *bi = &rq->q->limits.integrity;
128-
const int tuple_sz = bi->tuple_size;
128+
const int tuple_sz = bi->metadata_size;
129129
u32 ref_tag = t10_pi_ref_tag(rq);
130130
u8 offset = bi->pi_offset;
131131
struct bio *bio;
@@ -177,7 +177,7 @@ static void t10_pi_type1_complete(struct request *rq, unsigned int nr_bytes)
177177
{
178178
struct blk_integrity *bi = &rq->q->limits.integrity;
179179
unsigned intervals = nr_bytes >> bi->interval_exp;
180-
const int tuple_sz = bi->tuple_size;
180+
const int tuple_sz = bi->metadata_size;
181181
u32 ref_tag = t10_pi_ref_tag(rq);
182182
u8 offset = bi->pi_offset;
183183
struct bio *bio;
@@ -234,7 +234,7 @@ static void ext_pi_crc64_generate(struct blk_integrity_iter *iter,
234234
put_unaligned_be48(0ULL, pi->ref_tag);
235235

236236
iter->data_buf += iter->interval;
237-
iter->prot_buf += bi->tuple_size;
237+
iter->prot_buf += bi->metadata_size;
238238
iter->seed++;
239239
}
240240
}
@@ -289,7 +289,7 @@ static blk_status_t ext_pi_crc64_verify(struct blk_integrity_iter *iter,
289289

290290
next:
291291
iter->data_buf += iter->interval;
292-
iter->prot_buf += bi->tuple_size;
292+
iter->prot_buf += bi->metadata_size;
293293
iter->seed++;
294294
}
295295

@@ -299,7 +299,7 @@ static blk_status_t ext_pi_crc64_verify(struct blk_integrity_iter *iter,
299299
static void ext_pi_type1_prepare(struct request *rq)
300300
{
301301
struct blk_integrity *bi = &rq->q->limits.integrity;
302-
const int tuple_sz = bi->tuple_size;
302+
const int tuple_sz = bi->metadata_size;
303303
u64 ref_tag = ext_pi_ref_tag(rq);
304304
u8 offset = bi->pi_offset;
305305
struct bio *bio;
@@ -340,7 +340,7 @@ static void ext_pi_type1_complete(struct request *rq, unsigned int nr_bytes)
340340
{
341341
struct blk_integrity *bi = &rq->q->limits.integrity;
342342
unsigned intervals = nr_bytes >> bi->interval_exp;
343-
const int tuple_sz = bi->tuple_size;
343+
const int tuple_sz = bi->metadata_size;
344344
u64 ref_tag = ext_pi_ref_tag(rq);
345345
u8 offset = bi->pi_offset;
346346
struct bio *bio;

drivers/md/dm-crypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,11 @@ static int crypt_integrity_ctr(struct crypt_config *cc, struct dm_target *ti)
11891189
return -EINVAL;
11901190
}
11911191

1192-
if (bi->tuple_size < cc->used_tag_size) {
1192+
if (bi->metadata_size < cc->used_tag_size) {
11931193
ti->error = "Integrity profile tag size mismatch.";
11941194
return -EINVAL;
11951195
}
1196-
cc->tuple_size = bi->tuple_size;
1196+
cc->tuple_size = bi->metadata_size;
11971197
if (1 << bi->interval_exp != cc->sector_size) {
11981198
ti->error = "Integrity profile sector size mismatch.";
11991199
return -EINVAL;

drivers/md/dm-integrity.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,8 +3906,8 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim
39063906
struct blk_integrity *bi = &limits->integrity;
39073907

39083908
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;
39113911
bi->interval_exp =
39123912
ic->sb->log2_sectors_per_block + SECTOR_SHIFT;
39133913
}
@@ -4746,18 +4746,18 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
47464746
ti->error = "Integrity profile not supported";
47474747
goto bad;
47484748
}
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) {
47514751
r = -EINVAL;
47524752
ti->error = "The integrity profile is smaller than tag size";
47534753
goto bad;
47544754
}
4755-
if ((unsigned long)bi->tuple_size > PAGE_SIZE / 2) {
4755+
if ((unsigned long)bi->metadata_size > PAGE_SIZE / 2) {
47564756
r = -EINVAL;
47574757
ti->error = "Too big tuple size";
47584758
goto bad;
47594759
}
4760-
ic->tuple_size = bi->tuple_size;
4760+
ic->tuple_size = bi->metadata_size;
47614761
if (1 << bi->interval_exp != ic->sectors_per_block << SECTOR_SHIFT) {
47624762
r = -EINVAL;
47634763
ti->error = "Integrity profile sector size mismatch";

drivers/nvdimm/btt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ static int btt_blk_init(struct btt *btt)
15061506
int rc;
15071507

15081508
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);
15101510
lim.integrity.tag_size = btt_meta_size(btt);
15111511
}
15121512

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ static bool nvme_init_integrity(struct nvme_ns_head *head,
18661866
break;
18671867
}
18681868

1869-
bi->tuple_size = head->ms;
1869+
bi->metadata_size = head->ms;
18701870
bi->pi_offset = info->pi_offset;
18711871
return true;
18721872
}

drivers/nvme/target/io-cmd-bdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void nvmet_bdev_ns_enable_integrity(struct nvmet_ns *ns)
6565
return;
6666

6767
if (bi->csum_type == BLK_INTEGRITY_CSUM_CRC) {
68-
ns->metadata_size = bi->tuple_size;
68+
ns->metadata_size = bi->metadata_size;
6969
if (bi->flags & BLK_INTEGRITY_REF_TAG)
7070
ns->pi_type = NVME_NS_DPS_PI_TYPE1;
7171
else

drivers/scsi/sd_dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void sd_dif_config_host(struct scsi_disk *sdkp, struct queue_limits *lim)
5252
if (type != T10_PI_TYPE3_PROTECTION)
5353
bi->flags |= BLK_INTEGRITY_REF_TAG;
5454

55-
bi->tuple_size = sizeof(struct t10_pi_tuple);
55+
bi->metadata_size = sizeof(struct t10_pi_tuple);
5656

5757
if (dif && type) {
5858
bi->flags |= BLK_INTEGRITY_DEVICE_CAPABLE;

0 commit comments

Comments
 (0)