Skip to contentSkip to conversation

Remove unused dm_target fields

PATCH In review Damien Le Moal 2 participants 5 messages Jul 3, 2024 – Jul 4, 2024 Device mapper

lore
Share & tools
lore
#0 lore raw

cover Remove unused dm_target fields

A couple of patches to remove unused fields in struct dm_target.

Damien Le Moal (2):
dm: Remove max_write_zeroes_granularity
dm: Remove max_secure_erase_granularity

 drivers/md/dm.c               |  4 ----
 include/linux/device-mapper.h | 12 ------------
 2 files changed, 16 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 dm: Remove max_write_zeroes_granularity

The max_write_zeroes_granularity boolean of struct dm_target is used in __process_abnormal_io() but never set by any target. Remove this field and the dead code using it.

---
 drivers/md/dm.c               | 2 --
 include/linux/device-mapper.h | 6 ------
 2 files changed, 8 deletions(-)
drivers/md/dm.c +0 -2
index 3763b2ce557b..a63efa2a46ae 100644
@@ -1664,8 +1664,6 @@ static blk_status_t __process_abnormal_io(struct clone_info *ci,
 	case REQ_OP_WRITE_ZEROES:
 		num_bios = ti->num_write_zeroes_bios;
 		max_sectors = limits->max_write_zeroes_sectors;
-		if (ti->max_write_zeroes_granularity)
-			max_granularity = max_sectors;
 		break;
 	default:
 		break;
include/linux/device-mapper.h +0 -6
index 3611b230d0aa..5b7e96653ec6 100644
@@ -369,12 +369,6 @@ struct dm_target {
 	 */
 	bool max_secure_erase_granularity:1;
 
-	/*
-	 * Set if this target requires that write_zeroes be split on
-	 * 'max_write_zeroes_sectors' boundaries.
-	 */
-	bool max_write_zeroes_granularity:1;
-
 	/*
 	 * Set if we need to limit the number of in-flight bios when swapping.
 	 */
Signature · 1 line
2.45.2
#3 lore raw

PATCH 2/2 dm: Remove max_secure_erase_granularity

In reply to Damien Le Moal

The max_secure_erase_granularity boolean of struct dm_target is used in __process_abnormal_io() but never set by any target. Remove this field and the dead code using it.

---
 drivers/md/dm.c               | 2 --
 include/linux/device-mapper.h | 6 ------
 2 files changed, 8 deletions(-)
drivers/md/dm.c +0 -2
index a63efa2a46ae..2abf2b6865ea 100644
@@ -1658,8 +1658,6 @@ static blk_status_t __process_abnormal_io(struct clone_info *ci,
 	case REQ_OP_SECURE_ERASE:
 		num_bios = ti->num_secure_erase_bios;
 		max_sectors = limits->max_secure_erase_sectors;
-		if (ti->max_secure_erase_granularity)
-			max_granularity = max_sectors;
 		break;
 	case REQ_OP_WRITE_ZEROES:
 		num_bios = ti->num_write_zeroes_bios;
include/linux/device-mapper.h +0 -6
index 5b7e96653ec6..4ba2e73993bd 100644
@@ -363,12 +363,6 @@ struct dm_target {
 	 */
 	bool max_discard_granularity:1;
 
-	/*
-	 * Set if this target requires that secure_erases be split on
-	 * 'max_secure_erase_sectors' boundaries.
-	 */
-	bool max_secure_erase_granularity:1;
-
 	/*
 	 * Set if we need to limit the number of in-flight bios when swapping.
 	 */
Signature · 1 line
2.45.2