]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dm-verity: rename dm_verity::hash_blocks to dm_verity::hash_end
authorEric Biggers <ebiggers@kernel.org>
Fri, 6 Feb 2026 04:59:25 +0000 (20:59 -0800)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 9 Mar 2026 14:11:41 +0000 (15:11 +0100)
Rename hash_blocks to hash_end to reflect what it actually is.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-verity-fec.c
drivers/md/dm-verity-target.c
drivers/md/dm-verity.h

index e5d38bb3f16f1341bd333dbcc0d7ff89517de7a1..7a5ca1186af0d5387ba26b912a7a0a970d411067 100644 (file)
@@ -635,7 +635,7 @@ int verity_fec_ctr(struct dm_verity *v)
         * hash device after the hash blocks.
         */
 
-       hash_blocks = v->hash_blocks - v->hash_start;
+       hash_blocks = v->hash_end - v->hash_start;
 
        /*
         * Require matching block sizes for data and hash devices for
index 61073cd01d131db3fe97710a31e4a45b53b5ef88..e1d435c79e96c9ccf169d58c30bbe392935968cc 100644 (file)
@@ -733,8 +733,8 @@ static void verity_prefetch_io(struct work_struct *work)
 
                        hash_block_start &= ~(sector_t)(cluster - 1);
                        hash_block_end |= cluster - 1;
-                       if (unlikely(hash_block_end >= v->hash_blocks))
-                               hash_block_end = v->hash_blocks - 1;
+                       if (unlikely(hash_block_end >= v->hash_end))
+                               hash_block_end = v->hash_end - 1;
                }
 no_prefetch_cluster:
                dm_bufio_prefetch_with_ioprio(v->bufio, hash_block_start,
@@ -1607,7 +1607,7 @@ static int verity_ctr(struct dm_target *ti, unsigned int argc, char **argv)
                }
                hash_position += s;
        }
-       v->hash_blocks = hash_position;
+       v->hash_end = hash_position;
 
        r = mempool_init_page_pool(&v->recheck_pool, 1, 0);
        if (unlikely(r)) {
@@ -1634,7 +1634,7 @@ static int verity_ctr(struct dm_target *ti, unsigned int argc, char **argv)
                goto bad;
        }
 
-       if (dm_bufio_get_device_size(v->bufio) < v->hash_blocks) {
+       if (dm_bufio_get_device_size(v->bufio) < v->hash_end) {
                ti->error = "Hash device is too small";
                r = -E2BIG;
                goto bad;
index d6bfabb27113b95f697d882c18fdb288733f4a84..2922263501f68d6ef02f509ccd4a0bcf4e13663e 100644 (file)
@@ -53,9 +53,9 @@ struct dm_verity {
        unsigned int sig_size;  /* root digest signature size */
 #endif /* CONFIG_SECURITY */
        unsigned int salt_size;
-       sector_t hash_start;    /* hash start in blocks */
+       sector_t hash_start;    /* index of first hash block on hash_dev */
+       sector_t hash_end;      /* 1 + index of last hash block on hash dev */
        sector_t data_blocks;   /* the number of data blocks */
-       sector_t hash_blocks;   /* the number of hash blocks */
        unsigned char data_dev_block_bits;      /* log2(data blocksize) */
        unsigned char hash_dev_block_bits;      /* log2(hash blocksize) */
        unsigned char hash_per_block_bits;      /* log2(hashes in hash block) */