Skip to content

Commit a573e40

Browse files
author
Mikulas Patocka
committed
dm-verity: remove the unused "data_start" variable
Remove the unused "data_start" variable. It is always set to zero and the user can't override it. If the user needs to use some existing offset within a block device, it is possible to use the linear target. Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 61a5725 commit a573e40

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/md/dm-verity-target.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void dm_bufio_alloc_callback(struct dm_buffer *buf)
9393
*/
9494
static sector_t verity_map_sector(struct dm_verity *v, sector_t bi_sector)
9595
{
96-
return v->data_start + dm_target_offset(v->ti, bi_sector);
96+
return dm_target_offset(v->ti, bi_sector);
9797
}
9898

9999
/*
@@ -952,7 +952,7 @@ static int verity_prepare_ioctl(struct dm_target *ti, struct block_device **bdev
952952

953953
*bdev = v->data_dev->bdev;
954954

955-
if (v->data_start || ti->len != bdev_nr_sectors(v->data_dev->bdev))
955+
if (ti->len != bdev_nr_sectors(v->data_dev->bdev))
956956
return 1;
957957
return 0;
958958
}
@@ -962,7 +962,7 @@ static int verity_iterate_devices(struct dm_target *ti,
962962
{
963963
struct dm_verity *v = ti->private;
964964

965-
return fn(ti, v->data_dev, v->data_start, ti->len, data);
965+
return fn(ti, v->data_dev, 0, ti->len, data);
966966
}
967967

968968
static void verity_io_hints(struct dm_target *ti, struct queue_limits *limits)

drivers/md/dm-verity.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ struct dm_verity {
5050
unsigned int sig_size; /* root digest signature size */
5151
#endif /* CONFIG_SECURITY */
5252
unsigned int salt_size;
53-
sector_t data_start; /* data offset in 512-byte sectors */
5453
sector_t hash_start; /* hash start in blocks */
5554
sector_t data_blocks; /* the number of data blocks */
5655
sector_t hash_blocks; /* the number of hash blocks */

0 commit comments

Comments
 (0)