diff mbox series

dm-verity: remove the unused "data_start" variable

Message ID 0d153702-5a7a-469e-4bbe-b79b259e8a1b@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Mikulas Patocka
Headers show
Series dm-verity: remove the unused "data_start" variable | expand

Commit Message

Mikulas Patocka Nov. 18, 2024, 3:15 p.m. UTC
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 <mpatocka@redhat.com>

---
 drivers/md/dm-verity-target.c |    6 +++---
 drivers/md/dm-verity.h        |    1 -
 2 files changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

Index: linux-2.6/drivers/md/dm-verity-target.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-verity-target.c	2024-11-07 12:49:00.000000000 +0100
+++ linux-2.6/drivers/md/dm-verity-target.c	2024-11-18 15:31:43.000000000 +0100
@@ -93,7 +93,7 @@  static void dm_bufio_alloc_callback(stru
  */
 static sector_t verity_map_sector(struct dm_verity *v, sector_t bi_sector)
 {
-	return v->data_start + dm_target_offset(v->ti, bi_sector);
+	return dm_target_offset(v->ti, bi_sector);
 }
 
 /*
@@ -952,7 +952,7 @@  static int verity_prepare_ioctl(struct d
 
 	*bdev = v->data_dev->bdev;
 
-	if (v->data_start || ti->len != bdev_nr_sectors(v->data_dev->bdev))
+	if (ti->len != bdev_nr_sectors(v->data_dev->bdev))
 		return 1;
 	return 0;
 }
@@ -962,7 +962,7 @@  static int verity_iterate_devices(struct
 {
 	struct dm_verity *v = ti->private;
 
-	return fn(ti, v->data_dev, v->data_start, ti->len, data);
+	return fn(ti, v->data_dev, 0, ti->len, data);
 }
 
 static void verity_io_hints(struct dm_target *ti, struct queue_limits *limits)
Index: linux-2.6/drivers/md/dm-verity.h
===================================================================
--- linux-2.6.orig/drivers/md/dm-verity.h	2024-11-07 12:49:00.000000000 +0100
+++ linux-2.6/drivers/md/dm-verity.h	2024-11-18 15:31:15.000000000 +0100
@@ -50,7 +50,6 @@  struct dm_verity {
 	unsigned int sig_size;	/* root digest signature size */
 #endif /* CONFIG_SECURITY */
 	unsigned int salt_size;
-	sector_t data_start;	/* data offset in 512-byte sectors */
 	sector_t hash_start;	/* hash start in blocks */
 	sector_t data_blocks;	/* the number of data blocks */
 	sector_t hash_blocks;	/* the number of hash blocks */