Skip to contentSkip to conversation

dm deadcoding

PATCH In review [email protected] 3 participants 14 messages Oct 3, 2024 – Oct 21, 2024

Subsystems (2)
lore
Share & tools
lore
#2 lore raw

PATCH 2/9 dm cache: Remove unused dm_cache_dump

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

dm_cache_dump() has been unused since the original commit c6b4fcbad044 ("dm: add cache target")

Remove it.

---
 drivers/md/dm-cache-metadata.c | 24 ------------------------
 drivers/md/dm-cache-metadata.h |  2 --
 2 files changed, 26 deletions(-)
drivers/md/dm-cache-metadata.c +0 -24
index 24cd87fddf75..5c757603ab36 100644
@@ -1507,30 +1507,6 @@ int dm_cache_load_mappings(struct dm_cache_metadata *cmd,
 	return r;
 }
 
-static int __dump_mapping(void *context, uint64_t cblock, void *leaf)
-{
-	__le64 value;
-	dm_oblock_t oblock;
-	unsigned int flags;
-
-	memcpy(&value, leaf, sizeof(value));
-	unpack_value(value, &oblock, &flags);
-
-	return 0;
-}
-
-static int __dump_mappings(struct dm_cache_metadata *cmd)
-{
-	return dm_array_walk(&cmd->info, cmd->root, __dump_mapping, NULL);
-}
-
-void dm_cache_dump(struct dm_cache_metadata *cmd)
-{
-	READ_LOCK_VOID(cmd);
-	__dump_mappings(cmd);
-	READ_UNLOCK(cmd);
-}
-
 int dm_cache_changed_this_transaction(struct dm_cache_metadata *cmd)
 {
 	int r;
drivers/md/dm-cache-metadata.h +0 -2
index 57afc7047947..3e5472173baa 100644
@@ -123,8 +123,6 @@ int dm_cache_get_free_metadata_block_count(struct dm_cache_metadata *cmd,
 int dm_cache_get_metadata_dev_size(struct dm_cache_metadata *cmd,
 				   dm_block_t *result);
 
-void dm_cache_dump(struct dm_cache_metadata *cmd);
-
 /*
  * The policy is invited to save a 32bit hint value for every cblock (eg,
  * for a hit count).  These are stored against the policy name.  If
Signature · 1 line
2.46.2
#5 lore raw

PATCH 5/9 dm: Remove unused dm_set_md_type

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

dm_set_md_type() has been unused since commit ba30585936b0 ("dm: move setting md->type into dm_setup_md_queue")

Remove it.

---
 drivers/md/dm.c | 6 ------
 drivers/md/dm.h | 1 -
 2 files changed, 7 deletions(-)
drivers/md/dm.c +0 -6
index ff4a6b570b76..6630e89cea4a 100644
@@ -2515,12 +2515,6 @@ void dm_unlock_md_type(struct mapped_device *md)
 	mutex_unlock(&md->type_lock);
 }
 
-void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type)
-{
-	BUG_ON(!mutex_is_locked(&md->type_lock));
-	md->type = type;
-}
-
 enum dm_queue_mode dm_get_md_type(struct mapped_device *md)
 {
 	return md->type;
drivers/md/dm.h +0 -1
index 8ad782249af8..d4062c3154db 100644
@@ -76,7 +76,6 @@ bool dm_table_request_based(struct dm_table *t);
 
 void dm_lock_md_type(struct mapped_device *md);
 void dm_unlock_md_type(struct mapped_device *md);
-void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type);
 enum dm_queue_mode dm_get_md_type(struct mapped_device *md);
 struct target_type *dm_get_immutable_target_type(struct mapped_device *md);
 
Signature · 1 line
2.46.2
#6 lore raw

PATCH 6/9 dm: Remove unused dm_table_bio_based

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

dm_table_bio_based() is unused since commit
29dec90a0f1d ("dm: fix bio_set allocation")

Remove it.

---
 drivers/md/dm-table.c | 5 -----
 drivers/md/dm.h       | 1 -
 2 files changed, 6 deletions(-)
drivers/md/dm-table.c +0 -5
index dbd39b9722b9..bd8b796ae683 100644
@@ -1033,11 +1033,6 @@ struct dm_target *dm_table_get_wildcard_target(struct dm_table *t)
 	return NULL;
 }
 
-bool dm_table_bio_based(struct dm_table *t)
-{
-	return __table_type_bio_based(dm_table_get_type(t));
-}
-
 bool dm_table_request_based(struct dm_table *t)
 {
 	return __table_type_request_based(dm_table_get_type(t));
drivers/md/dm.h +0 -1
index d4062c3154db..a0a8ff119815 100644
@@ -71,7 +71,6 @@ enum dm_queue_mode dm_table_get_type(struct dm_table *t);
 struct target_type *dm_table_get_immutable_target_type(struct dm_table *t);
 struct dm_target *dm_table_get_immutable_target(struct dm_table *t);
 struct dm_target *dm_table_get_wildcard_target(struct dm_table *t);
-bool dm_table_bio_based(struct dm_table *t);
 bool dm_table_request_based(struct dm_table *t);
 
 void dm_lock_md_type(struct mapped_device *md);
Signature · 1 line
2.46.2
#7 lore raw

PATCH 7/9 dm: zoned: Remove unused functions

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

dmz_resume_metadata() is unused since it was added in commit 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")

dmz_zone_nr_blocks_shift is unused since it was added in commit 368205601375 ("dm zoned: move fields from struct dmz_dev to dmz_metadata")

Remove them.

---
 drivers/md/dm-zoned-metadata.c | 50 ----------------------------------
 drivers/md/dm-zoned.h          |  2 --
 2 files changed, 52 deletions(-)
drivers/md/dm-zoned-metadata.c +0 -50
index 8156881a31de..deff22ecccbb 100644
@@ -245,11 +245,6 @@ unsigned int dmz_zone_nr_blocks(struct dmz_metadata *zmd)
 	return zmd->zone_nr_blocks;
 }
 
-unsigned int dmz_zone_nr_blocks_shift(struct dmz_metadata *zmd)
-{
-	return zmd->zone_nr_blocks_shift;
-}
-
 unsigned int dmz_zone_nr_sectors(struct dmz_metadata *zmd)
 {
 	return zmd->zone_nr_sectors;
@@ -3005,48 +3000,3 @@ void dmz_dtr_metadata(struct dmz_metadata *zmd)
 	dmz_cleanup_metadata(zmd);
 	kfree(zmd);
 }
-
-/*
- * Check zone information on resume.
- */
-int dmz_resume_metadata(struct dmz_metadata *zmd)
-{
-	struct dm_zone *zone;
-	sector_t wp_block;
-	unsigned int i;
-	int ret;
-
-	/* Check zones */
-	for (i = 0; i < zmd->nr_zones; i++) {
-		zone = dmz_get(zmd, i);
-		if (!zone) {
-			dmz_zmd_err(zmd, "Unable to get zone %u", i);
-			return -EIO;
-		}
-		wp_block = zone->wp_block;
-
-		ret = dmz_update_zone(zmd, zone);
-		if (ret) {
-			dmz_zmd_err(zmd, "Broken zone %u", i);
-			return ret;
-		}
-
-		if (dmz_is_offline(zone)) {
-			dmz_zmd_warn(zmd, "Zone %u is offline", i);
-			continue;
-		}
-
-		/* Check write pointer */
-		if (!dmz_is_seq(zone))
-			zone->wp_block = 0;
-		else if (zone->wp_block != wp_block) {
-			dmz_zmd_err(zmd, "Zone %u: Invalid wp (%llu / %llu)",
-				    i, (u64)zone->wp_block, (u64)wp_block);
-			zone->wp_block = wp_block;
-			dmz_invalidate_blocks(zmd, zone, zone->wp_block,
-					      zmd->zone_nr_blocks - zone->wp_block);
-		}
-	}
-
-	return 0;
-}
drivers/md/dm-zoned.h +0 -2
index 265494d3f711..59ba0aaa9531 100644
@@ -192,7 +192,6 @@ enum {
 int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
 		     struct dmz_metadata **zmd, const char *devname);
 void dmz_dtr_metadata(struct dmz_metadata *zmd);
-int dmz_resume_metadata(struct dmz_metadata *zmd);
 
 void dmz_lock_map(struct dmz_metadata *zmd);
 void dmz_unlock_map(struct dmz_metadata *zmd);
@@ -230,7 +229,6 @@ unsigned int dmz_nr_unmap_rnd_zones(struct dmz_metadata *zmd, int idx);
 unsigned int dmz_nr_seq_zones(struct dmz_metadata *zmd, int idx);
 unsigned int dmz_nr_unmap_seq_zones(struct dmz_metadata *zmd, int idx);
 unsigned int dmz_zone_nr_blocks(struct dmz_metadata *zmd);
-unsigned int dmz_zone_nr_blocks_shift(struct dmz_metadata *zmd);
 unsigned int dmz_zone_nr_sectors(struct dmz_metadata *zmd);
 unsigned int dmz_zone_nr_sectors_shift(struct dmz_metadata *zmd);
 
Signature · 1 line
2.46.2
#8 lore raw

PATCH 8/9 dm vdo: Remove unused functions

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

get_data_vio_pool_active_discards()
get_data_vio_pool_discard_limit()
get_data_vio_pool_maximum_discards()
set_data_vio_pool_discard_limit()

are all unused since commit
a9da0fb6d8c6 ("dm vdo: remove all sysfs interfaces")

Remove them.

---
 drivers/md/dm-vdo/data-vio.c | 29 -----------------------------
 drivers/md/dm-vdo/data-vio.h |  5 -----
 2 files changed, 34 deletions(-)
drivers/md/dm-vdo/data-vio.c +0 -29
index 0d502f6a86ad..2b489e37538e 100644
@@ -1074,35 +1074,6 @@ void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios)
 	spin_unlock(&pool->lock);
 }
 
-data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.busy);
-}
-
-data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.limit);
-}
-
-data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.max_busy);
-}
-
-int set_data_vio_pool_discard_limit(struct data_vio_pool *pool, data_vio_count_t limit)
-{
-	if (get_data_vio_pool_request_limit(pool) < limit) {
-		// The discard limit may not be higher than the data_vio limit.
-		return -EINVAL;
-	}
-
-	spin_lock(&pool->lock);
-	pool->discard_limiter.limit = limit;
-	spin_unlock(&pool->lock);
-
-	return VDO_SUCCESS;
-}
-
 data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool)
 {
 	return READ_ONCE(pool->limiter.busy);
drivers/md/dm-vdo/data-vio.h +0 -5
index 25926b6cd98b..067b983bb291 100644
@@ -336,11 +336,6 @@ void drain_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *comp
 void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *completion);
 
 void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios);
-data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool);
-data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool);
-data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool);
-int __must_check set_data_vio_pool_discard_limit(struct data_vio_pool *pool,
-						 data_vio_count_t limit);
 data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool);
 data_vio_count_t get_data_vio_pool_request_limit(struct data_vio_pool *pool);
 data_vio_count_t get_data_vio_pool_maximum_requests(struct data_vio_pool *pool);
Signature · 1 line
2.46.2
#10 lore raw

PATCH 9/9 dm vdo: Remove unused uds_compute_index_size

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

uds_compute_index_size() has been unused since it was added in commit b46d79bdb82a ("dm vdo: add deduplication index storage interface")

Remove it.

---
 drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------------------
 drivers/md/dm-vdo/indexer/indexer.h      |  4 ----
 2 files changed, 30 deletions(-)
drivers/md/dm-vdo/indexer/index-layout.c +0 -26
index 627adc24af3b..af8fab83b0f3 100644
@@ -248,32 +248,6 @@ static int __must_check compute_sizes(const struct uds_configuration *config,
 	return UDS_SUCCESS;
 }
 
-int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size)
-{
-	int result;
-	struct uds_configuration *index_config;
-	struct save_layout_sizes sizes;
-
-	if (index_size == NULL) {
-		vdo_log_error("Missing output size pointer");
-		return -EINVAL;
-	}
-
-	result = uds_make_configuration(parameters, &index_config);
-	if (result != UDS_SUCCESS) {
-		vdo_log_error_strerror(result, "cannot compute index size");
-		return uds_status_to_errno(result);
-	}
-
-	result = compute_sizes(index_config, &sizes);
-	uds_free_configuration(index_config);
-	if (result != UDS_SUCCESS)
-		return uds_status_to_errno(result);
-
-	*index_size = sizes.total_size;
-	return UDS_SUCCESS;
-}
-
 /* Create unique data using the current time and a pseudorandom number. */
 static void create_unique_nonce_data(u8 *buffer)
 {
drivers/md/dm-vdo/indexer/indexer.h +0 -4
index 3744aaf625b0..183a94eb7e92 100644
@@ -283,10 +283,6 @@ struct uds_request {
 	enum uds_index_region location;
 };
 
-/* Compute the number of bytes needed to store an index. */
-int __must_check uds_compute_index_size(const struct uds_parameters *parameters,
-					u64 *index_size);
-
 /* A session is required for most index operations. */
 int __must_check uds_create_index_session(struct uds_index_session **session);
 
Signature · 1 line
2.46.2
#0 lore raw

cover dm deadcoding

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
This is a collection of deadcoding in various parts
of dm. It's all strictly function deletion with no (expected) change of behaviour.

Build and booted on x86-64, but no dm tests done.

Dr. David Alan Gilbert (9):
dm cache: Remove unused btracker_nr_writebacks_queued dm cache: Remove unused dm_cache_dump
dm cache: Remove unused dm_cache_size
dm cache: Remove unused functions in bio-prison-v1
dm: Remove unused dm_set_md_type
dm: Remove unused dm_table_bio_based
dm: zoned: Remove unused functions
dm vdo: Remove unused functions
dm vdo: Remove unused uds_compute_index_size

 drivers/md/dm-bio-prison-v1.c            | 35 -----------------
 drivers/md/dm-bio-prison-v1.h            | 24 ------------
 drivers/md/dm-cache-background-tracker.c |  6 ---
 drivers/md/dm-cache-background-tracker.h |  1 -
 drivers/md/dm-cache-metadata.c           | 33 ----------------
 drivers/md/dm-cache-metadata.h           |  3 --
 drivers/md/dm-table.c                    |  5 ---
 drivers/md/dm-vdo/data-vio.c             | 29 --------------
 drivers/md/dm-vdo/data-vio.h             |  5 ---
 drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------
 drivers/md/dm-vdo/indexer/indexer.h      |  4 --
 drivers/md/dm-zoned-metadata.c           | 50 ------------------------
 drivers/md/dm-zoned.h                    |  2 -
 drivers/md/dm.c                          |  6 ---
 drivers/md/dm.h                          |  2 -
 15 files changed, 231 deletions(-)
Signature · 1 line
2.46.2
#1 lore raw

PATCH 1/9 dm cache: Remove unused btracker_nr_writebacks_queued

From: "Dr. David Alan Gilbert" <[email protected]>

btracker_nr_writebacks_queued() has been unused since commit 2e63309507c8 ("dm cache policy smq: don't do any writebacks unless IDLE")

Remove it.

---
 drivers/md/dm-cache-background-tracker.c | 6 ------
 drivers/md/dm-cache-background-tracker.h | 1 -
 2 files changed, 7 deletions(-)
drivers/md/dm-cache-background-tracker.c +0 -6
index 9c5308298cf1..504299bb7310 100644
@@ -156,12 +156,6 @@ static void update_stats(struct background_tracker *b, struct policy_work *w, in
 	}
 }
 
-unsigned int btracker_nr_writebacks_queued(struct background_tracker *b)
-{
-	return atomic_read(&b->pending_writebacks);
-}
-EXPORT_SYMBOL_GPL(btracker_nr_writebacks_queued);
-
 unsigned int btracker_nr_demotions_queued(struct background_tracker *b)
 {
 	return atomic_read(&b->pending_demotes);
drivers/md/dm-cache-background-tracker.h +0 -1
index 5b8f5c667b81..7e66ad58efa6 100644
@@ -42,7 +42,6 @@ struct background_tracker *btracker_create(unsigned int max_work);
  */
 void btracker_destroy(struct background_tracker *b);
 
-unsigned int btracker_nr_writebacks_queued(struct background_tracker *b);
 unsigned int btracker_nr_demotions_queued(struct background_tracker *b);
 
 /*
Signature · 1 line
2.46.2
#3 lore raw

PATCH 3/9 dm cache: Remove unused dm_cache_size

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

dm_cache_size() has been unused since the original commit c6b4fcbad044 ("dm: add cache target")

Remove it.

---
 drivers/md/dm-cache-metadata.c | 9 ---------
 drivers/md/dm-cache-metadata.h | 1 -
 2 files changed, 10 deletions(-)
drivers/md/dm-cache-metadata.c +0 -9
index 5c757603ab36..a9a1ab284076 100644
@@ -1218,15 +1218,6 @@ int dm_cache_load_discards(struct dm_cache_metadata *cmd,
 	return r;
 }
 
-int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result)
-{
-	READ_LOCK(cmd);
-	*result = cmd->cache_blocks;
-	READ_UNLOCK(cmd);
-
-	return 0;
-}
-
 static int __remove(struct dm_cache_metadata *cmd, dm_cblock_t cblock)
 {
 	int r;
drivers/md/dm-cache-metadata.h +0 -1
index 3e5472173baa..5f77890207fe 100644
@@ -71,7 +71,6 @@ void dm_cache_metadata_close(struct dm_cache_metadata *cmd);
  * origin blocks to map to.
  */
 int dm_cache_resize(struct dm_cache_metadata *cmd, dm_cblock_t new_cache_size);
-int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result);
 
 int dm_cache_discard_bitset_resize(struct dm_cache_metadata *cmd,
 				   sector_t discard_block_size,
Signature · 1 line
2.46.2
#4 lore raw

PATCH 4/9 dm cache: Remove unused functions in bio-prison-v1

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

dm_cache_size() and dm_cache_dump() are unused since commit b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")

Remove them.

---
 drivers/md/dm-bio-prison-v1.c | 35 -----------------------------------
 drivers/md/dm-bio-prison-v1.h | 24 ------------------------
 2 files changed, 59 deletions(-)
drivers/md/dm-bio-prison-v1.c +0 -35
index bca0f39e15b8..b4d1c4329df3 100644
@@ -198,15 +198,6 @@ int dm_bio_detain(struct dm_bio_prison *prison,
 }
 EXPORT_SYMBOL_GPL(dm_bio_detain);
 
-int dm_get_cell(struct dm_bio_prison *prison,
-		struct dm_cell_key *key,
-		struct dm_bio_prison_cell *cell_prealloc,
-		struct dm_bio_prison_cell **cell_result)
-{
-	return bio_detain(prison, key, NULL, cell_prealloc, cell_result);
-}
-EXPORT_SYMBOL_GPL(dm_get_cell);
-
 /*
  * @inmates must have been initialised prior to this call
  */
@@ -288,32 +279,6 @@ void dm_cell_visit_release(struct dm_bio_prison *prison,
 }
 EXPORT_SYMBOL_GPL(dm_cell_visit_release);
 
-static int __promote_or_release(struct rb_root *root,
-				struct dm_bio_prison_cell *cell)
-{
-	if (bio_list_empty(&cell->bios)) {
-		rb_erase(&cell->node, root);
-		return 1;
-	}
-
-	cell->holder = bio_list_pop(&cell->bios);
-	return 0;
-}
-
-int dm_cell_promote_or_release(struct dm_bio_prison *prison,
-			       struct dm_bio_prison_cell *cell)
-{
-	int r;
-	unsigned l = lock_nr(&cell->key, prison->num_locks);
-
-	spin_lock_irq(&prison->regions[l].lock);
-	r = __promote_or_release(&prison->regions[l].cell, cell);
-	spin_unlock_irq(&prison->regions[l].lock);
-
-	return r;
-}
-EXPORT_SYMBOL_GPL(dm_cell_promote_or_release);
-
 /*----------------------------------------------------------------*/
 
 #define DEFERRED_SET_SIZE 64
drivers/md/dm-bio-prison-v1.h +0 -24
index 2a097ed0d85e..d39706c48447 100644
@@ -72,17 +72,6 @@ struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison
 void dm_bio_prison_free_cell(struct dm_bio_prison *prison,
 			     struct dm_bio_prison_cell *cell);
 
-/*
- * Creates, or retrieves a cell that overlaps the given key.
- *
- * Returns 1 if pre-existing cell returned, zero if new cell created using
- * @cell_prealloc.
- */
-int dm_get_cell(struct dm_bio_prison *prison,
-		struct dm_cell_key *key,
-		struct dm_bio_prison_cell *cell_prealloc,
-		struct dm_bio_prison_cell **cell_result);
-
 /*
  * Returns false if key is beyond BIO_PRISON_MAX_RANGE or spans a boundary.
  */
@@ -117,19 +106,6 @@ void dm_cell_visit_release(struct dm_bio_prison *prison,
 			   void (*visit_fn)(void *, struct dm_bio_prison_cell *),
 			   void *context, struct dm_bio_prison_cell *cell);
 
-/*
- * Rather than always releasing the prisoners in a cell, the client may
- * want to promote one of them to be the new holder.  There is a race here
- * though between releasing an empty cell, and other threads adding new
- * inmates.  So this function makes the decision with its lock held.
- *
- * This function can have two outcomes:
- * i) An inmate is promoted to be the holder of the cell (return value of 0).
- * ii) The cell has no inmate for promotion and is released (return value of 1).
- */
-int dm_cell_promote_or_release(struct dm_bio_prison *prison,
-			       struct dm_bio_prison_cell *cell);
-
 /*----------------------------------------------------------------*/
 
 /*
Signature · 1 line
2.46.2
maintainer Reviewed-by on v1 8/9
#9 lore raw

Re: [PATCH 8/9] dm vdo: Remove unused functions

In reply to [email protected]
Quoted 7 lines · On 10/2/24 9:15 PM, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

get_data_vio_pool_active_discards()
get_data_vio_pool_discard_limit()
get_data_vio_pool_maximum_discards()
set_data_vio_pool_discard_limit()

Quoted 6 lines

are all unused since commit
a9da0fb6d8c6 ("dm vdo: remove all sysfs interfaces")

Remove them.

Quoted 61 lines
---
  drivers/md/dm-vdo/data-vio.c | 29 -----------------------------
  drivers/md/dm-vdo/data-vio.h |  5 -----
  2 files changed, 34 deletions(-)
drivers/md/dm-vdo/data-vio.c +0 -29
index 0d502f6a86ad..2b489e37538e 100644
@@ -1074,35 +1074,6 @@ void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios)
  	spin_unlock(&pool->lock);
  }
 
-data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.busy);
-}
-
-data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.limit);
-}
-
-data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.max_busy);
-}
-
-int set_data_vio_pool_discard_limit(struct data_vio_pool *pool, data_vio_count_t limit)
-{
-	if (get_data_vio_pool_request_limit(pool) < limit) {
-		// The discard limit may not be higher than the data_vio limit.
-		return -EINVAL;
-	}
-
-	spin_lock(&pool->lock);
-	pool->discard_limiter.limit = limit;
-	spin_unlock(&pool->lock);
-
-	return VDO_SUCCESS;
-}
-
  data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool)
  {
  	return READ_ONCE(pool->limiter.busy);
drivers/md/dm-vdo/data-vio.h +0 -5
index 25926b6cd98b..067b983bb291 100644
@@ -336,11 +336,6 @@ void drain_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *comp
  void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *completion);
 
  void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios);
-data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool);
-data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool);
-data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool);
-int __must_check set_data_vio_pool_discard_limit(struct data_vio_pool *pool,
-						 data_vio_count_t limit);
  data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool);
  data_vio_count_t get_data_vio_pool_request_limit(struct data_vio_pool *pool);
  data_vio_count_t get_data_vio_pool_maximum_requests(struct data_vio_pool *pool);
maintainer Reviewed-by on v1 9/9
#11 lore raw

Re: [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size

In reply to [email protected]
Quoted 8 lines · On 10/2/24 9:15 PM, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

uds_compute_index_size() has been unused since it was added in commit b46d79bdb82a ("dm vdo: add deduplication index storage interface")

Remove it.

Quoted 57 lines
---
  drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------------------
  drivers/md/dm-vdo/indexer/indexer.h      |  4 ----
  2 files changed, 30 deletions(-)
drivers/md/dm-vdo/indexer/index-layout.c +0 -26
index 627adc24af3b..af8fab83b0f3 100644
@@ -248,32 +248,6 @@ static int __must_check compute_sizes(const struct uds_configuration *config,
  	return UDS_SUCCESS;
  }
 
-int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size)
-{
-	int result;
-	struct uds_configuration *index_config;
-	struct save_layout_sizes sizes;
-
-	if (index_size == NULL) {
-		vdo_log_error("Missing output size pointer");
-		return -EINVAL;
-	}
-
-	result = uds_make_configuration(parameters, &index_config);
-	if (result != UDS_SUCCESS) {
-		vdo_log_error_strerror(result, "cannot compute index size");
-		return uds_status_to_errno(result);
-	}
-
-	result = compute_sizes(index_config, &sizes);
-	uds_free_configuration(index_config);
-	if (result != UDS_SUCCESS)
-		return uds_status_to_errno(result);
-
-	*index_size = sizes.total_size;
-	return UDS_SUCCESS;
-}
-
  /* Create unique data using the current time and a pseudorandom number. */
  static void create_unique_nonce_data(u8 *buffer)
  {
drivers/md/dm-vdo/indexer/indexer.h +0 -4
index 3744aaf625b0..183a94eb7e92 100644
@@ -283,10 +283,6 @@ struct uds_request {
  	enum uds_index_region location;
  };
 
-/* Compute the number of bytes needed to store an index. */
-int __must_check uds_compute_index_size(const struct uds_parameters *parameters,
-					u64 *index_size);
-
  /* A session is required for most index operations. */
  int __must_check uds_create_index_session(struct uds_index_session **session);
 
maintainer
#12 lore raw
In reply to [email protected]

Hi

I've accepted these patches.

Mikulas

Quoted 43 lines · On Thu, 3 Oct 2024, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
This is a collection of deadcoding in various parts
of dm. It's all strictly function deletion with no (expected) change of behaviour.

Build and booted on x86-64, but no dm tests done.

Dr. David Alan Gilbert (9):
dm cache: Remove unused btracker_nr_writebacks_queued dm cache: Remove unused dm_cache_dump
dm cache: Remove unused dm_cache_size
dm cache: Remove unused functions in bio-prison-v1
dm: Remove unused dm_set_md_type
dm: Remove unused dm_table_bio_based
dm: zoned: Remove unused functions
dm vdo: Remove unused functions
dm vdo: Remove unused uds_compute_index_size

 drivers/md/dm-bio-prison-v1.c            | 35 -----------------
 drivers/md/dm-bio-prison-v1.h            | 24 ------------
 drivers/md/dm-cache-background-tracker.c |  6 ---
 drivers/md/dm-cache-background-tracker.h |  1 -
 drivers/md/dm-cache-metadata.c           | 33 ----------------
 drivers/md/dm-cache-metadata.h           |  3 --
 drivers/md/dm-table.c                    |  5 ---
 drivers/md/dm-vdo/data-vio.c             | 29 --------------
 drivers/md/dm-vdo/data-vio.h             |  5 ---
 drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------
 drivers/md/dm-vdo/indexer/indexer.h      |  4 --
 drivers/md/dm-zoned-metadata.c           | 50 ------------------------
 drivers/md/dm-zoned.h                    |  2 -
 drivers/md/dm.c                          |  6 ---
 drivers/md/dm.h                          |  2 -
 15 files changed, 231 deletions(-)
Signature · 1 line
2.46.2
#13 lore raw
Quoted 3 lines · * Mikulas Patocka ([email protected]) wrote:

Hi

I've accepted these patches.

Thanks, yep I noticed them in -next :-)

Dave

Quoted 51 lines

Mikulas

Quoted 43 lines · On Thu, 3 Oct 2024, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
This is a collection of deadcoding in various parts
of dm. It's all strictly function deletion with no (expected) change of behaviour.

Build and booted on x86-64, but no dm tests done.

Dr. David Alan Gilbert (9):
dm cache: Remove unused btracker_nr_writebacks_queued dm cache: Remove unused dm_cache_dump
dm cache: Remove unused dm_cache_size
dm cache: Remove unused functions in bio-prison-v1
dm: Remove unused dm_set_md_type
dm: Remove unused dm_table_bio_based
dm: zoned: Remove unused functions
dm vdo: Remove unused functions
dm vdo: Remove unused uds_compute_index_size

 drivers/md/dm-bio-prison-v1.c            | 35 -----------------
 drivers/md/dm-bio-prison-v1.h            | 24 ------------
 drivers/md/dm-cache-background-tracker.c |  6 ---
 drivers/md/dm-cache-background-tracker.h |  1 -
 drivers/md/dm-cache-metadata.c           | 33 ----------------
 drivers/md/dm-cache-metadata.h           |  3 --
 drivers/md/dm-table.c                    |  5 ---
 drivers/md/dm-vdo/data-vio.c             | 29 --------------
 drivers/md/dm-vdo/data-vio.h             |  5 ---
 drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------
 drivers/md/dm-vdo/indexer/indexer.h      |  4 --
 drivers/md/dm-zoned-metadata.c           | 50 ------------------------
 drivers/md/dm-zoned.h                    |  2 -
 drivers/md/dm.c                          |  6 ---
 drivers/md/dm.h                          |  2 -
 15 files changed, 231 deletions(-)
Signature · 1 line
2.46.2
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/