* [PATCH 0/9] dm deadcoding
@ 2024-10-03 1:15 linux
2024-10-03 1:15 ` [PATCH 1/9] dm cache: Remove unused btracker_nr_writebacks_queued linux
` (9 more replies)
0 siblings, 10 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
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.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
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(-)
--
2.46.2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/9] dm cache: Remove unused btracker_nr_writebacks_queued
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 2/9] dm cache: Remove unused dm_cache_dump linux
` (8 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
btracker_nr_writebacks_queued() has been unused since commit
2e63309507c8 ("dm cache policy smq: don't do any writebacks unless IDLE")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-cache-background-tracker.c | 6 ------
drivers/md/dm-cache-background-tracker.h | 1 -
2 files changed, 7 deletions(-)
diff --git a/drivers/md/dm-cache-background-tracker.c b/drivers/md/dm-cache-background-tracker.c
index 9c5308298cf1..504299bb7310 100644
--- a/drivers/md/dm-cache-background-tracker.c
+++ b/drivers/md/dm-cache-background-tracker.c
@@ -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);
diff --git a/drivers/md/dm-cache-background-tracker.h b/drivers/md/dm-cache-background-tracker.h
index 5b8f5c667b81..7e66ad58efa6 100644
--- a/drivers/md/dm-cache-background-tracker.h
+++ b/drivers/md/dm-cache-background-tracker.h
@@ -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);
/*
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/9] dm cache: Remove unused dm_cache_dump
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
2024-10-03 1:15 ` [PATCH 1/9] dm cache: Remove unused btracker_nr_writebacks_queued linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 3/9] dm cache: Remove unused dm_cache_size linux
` (7 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
dm_cache_dump() has been unused since the original commit
c6b4fcbad044 ("dm: add cache target")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-cache-metadata.c | 24 ------------------------
drivers/md/dm-cache-metadata.h | 2 --
2 files changed, 26 deletions(-)
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index 24cd87fddf75..5c757603ab36 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -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;
diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h
index 57afc7047947..3e5472173baa 100644
--- a/drivers/md/dm-cache-metadata.h
+++ b/drivers/md/dm-cache-metadata.h
@@ -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
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/9] dm cache: Remove unused dm_cache_size
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
2024-10-03 1:15 ` [PATCH 1/9] dm cache: Remove unused btracker_nr_writebacks_queued linux
2024-10-03 1:15 ` [PATCH 2/9] dm cache: Remove unused dm_cache_dump linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 4/9] dm cache: Remove unused functions in bio-prison-v1 linux
` (6 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
dm_cache_size() has been unused since the original commit
c6b4fcbad044 ("dm: add cache target")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-cache-metadata.c | 9 ---------
drivers/md/dm-cache-metadata.h | 1 -
2 files changed, 10 deletions(-)
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index 5c757603ab36..a9a1ab284076 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -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;
diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h
index 3e5472173baa..5f77890207fe 100644
--- a/drivers/md/dm-cache-metadata.h
+++ b/drivers/md/dm-cache-metadata.h
@@ -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,
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/9] dm cache: Remove unused functions in bio-prison-v1
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (2 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 3/9] dm cache: Remove unused dm_cache_size linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 5/9] dm: Remove unused dm_set_md_type linux
` (5 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
dm_cache_size() and dm_cache_dump() are unused since commit
b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-bio-prison-v1.c | 35 -----------------------------------
drivers/md/dm-bio-prison-v1.h | 24 ------------------------
2 files changed, 59 deletions(-)
diff --git a/drivers/md/dm-bio-prison-v1.c b/drivers/md/dm-bio-prison-v1.c
index bca0f39e15b8..b4d1c4329df3 100644
--- a/drivers/md/dm-bio-prison-v1.c
+++ b/drivers/md/dm-bio-prison-v1.c
@@ -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
diff --git a/drivers/md/dm-bio-prison-v1.h b/drivers/md/dm-bio-prison-v1.h
index 2a097ed0d85e..d39706c48447 100644
--- a/drivers/md/dm-bio-prison-v1.h
+++ b/drivers/md/dm-bio-prison-v1.h
@@ -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);
-
/*----------------------------------------------------------------*/
/*
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/9] dm: Remove unused dm_set_md_type
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (3 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 4/9] dm cache: Remove unused functions in bio-prison-v1 linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 6/9] dm: Remove unused dm_table_bio_based linux
` (4 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
dm_set_md_type() has been unused since commit
ba30585936b0 ("dm: move setting md->type into dm_setup_md_queue")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm.c | 6 ------
drivers/md/dm.h | 1 -
2 files changed, 7 deletions(-)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index ff4a6b570b76..6630e89cea4a 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -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;
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 8ad782249af8..d4062c3154db 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -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);
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/9] dm: Remove unused dm_table_bio_based
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (4 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 5/9] dm: Remove unused dm_set_md_type linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 7/9] dm: zoned: Remove unused functions linux
` (3 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
dm_table_bio_based() is unused since commit
29dec90a0f1d ("dm: fix bio_set allocation")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-table.c | 5 -----
drivers/md/dm.h | 1 -
2 files changed, 6 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index dbd39b9722b9..bd8b796ae683 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -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));
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index d4062c3154db..a0a8ff119815 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -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);
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 7/9] dm: zoned: Remove unused functions
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (5 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 6/9] dm: Remove unused dm_table_bio_based linux
@ 2024-10-03 1:15 ` linux
2024-10-03 1:15 ` [PATCH 8/9] dm vdo: " linux
` (2 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
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.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-zoned-metadata.c | 50 ----------------------------------
drivers/md/dm-zoned.h | 2 --
2 files changed, 52 deletions(-)
diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
index 8156881a31de..deff22ecccbb 100644
--- a/drivers/md/dm-zoned-metadata.c
+++ b/drivers/md/dm-zoned-metadata.c
@@ -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;
-}
diff --git a/drivers/md/dm-zoned.h b/drivers/md/dm-zoned.h
index 265494d3f711..59ba0aaa9531 100644
--- a/drivers/md/dm-zoned.h
+++ b/drivers/md/dm-zoned.h
@@ -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);
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 8/9] dm vdo: Remove unused functions
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (6 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 7/9] dm: zoned: Remove unused functions linux
@ 2024-10-03 1:15 ` linux
2024-10-03 15:43 ` Matthew Sakai
2024-10-03 1:15 ` [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size linux
2024-10-21 11:55 ` [PATCH 0/9] dm deadcoding Mikulas Patocka
9 siblings, 1 reply; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
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.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-vdo/data-vio.c | 29 -----------------------------
drivers/md/dm-vdo/data-vio.h | 5 -----
2 files changed, 34 deletions(-)
diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c
index 0d502f6a86ad..2b489e37538e 100644
--- a/drivers/md/dm-vdo/data-vio.c
+++ b/drivers/md/dm-vdo/data-vio.c
@@ -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);
diff --git a/drivers/md/dm-vdo/data-vio.h b/drivers/md/dm-vdo/data-vio.h
index 25926b6cd98b..067b983bb291 100644
--- a/drivers/md/dm-vdo/data-vio.h
+++ b/drivers/md/dm-vdo/data-vio.h
@@ -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);
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (7 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 8/9] dm vdo: " linux
@ 2024-10-03 1:15 ` linux
2024-10-03 15:43 ` Matthew Sakai
2024-10-21 11:55 ` [PATCH 0/9] dm deadcoding Mikulas Patocka
9 siblings, 1 reply; 14+ messages in thread
From: linux @ 2024-10-03 1:15 UTC (permalink / raw)
To: agk, snitzer, mpatocka, msakai
Cc: dm-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
uds_compute_index_size() has been unused since it was added in
commit b46d79bdb82a ("dm vdo: add deduplication index storage interface")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------------------
drivers/md/dm-vdo/indexer/indexer.h | 4 ----
2 files changed, 30 deletions(-)
diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c
index 627adc24af3b..af8fab83b0f3 100644
--- a/drivers/md/dm-vdo/indexer/index-layout.c
+++ b/drivers/md/dm-vdo/indexer/index-layout.c
@@ -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)
{
diff --git a/drivers/md/dm-vdo/indexer/indexer.h b/drivers/md/dm-vdo/indexer/indexer.h
index 3744aaf625b0..183a94eb7e92 100644
--- a/drivers/md/dm-vdo/indexer/indexer.h
+++ b/drivers/md/dm-vdo/indexer/indexer.h
@@ -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);
--
2.46.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 8/9] dm vdo: Remove unused functions
2024-10-03 1:15 ` [PATCH 8/9] dm vdo: " linux
@ 2024-10-03 15:43 ` Matthew Sakai
0 siblings, 0 replies; 14+ messages in thread
From: Matthew Sakai @ 2024-10-03 15:43 UTC (permalink / raw)
To: linux, agk, snitzer, mpatocka; +Cc: dm-devel, linux-kernel
On 10/2/24 9:15 PM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> 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.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
> ---
> drivers/md/dm-vdo/data-vio.c | 29 -----------------------------
> drivers/md/dm-vdo/data-vio.h | 5 -----
> 2 files changed, 34 deletions(-)
>
> diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c
> index 0d502f6a86ad..2b489e37538e 100644
> --- a/drivers/md/dm-vdo/data-vio.c
> +++ b/drivers/md/dm-vdo/data-vio.c
> @@ -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);
> diff --git a/drivers/md/dm-vdo/data-vio.h b/drivers/md/dm-vdo/data-vio.h
> index 25926b6cd98b..067b983bb291 100644
> --- a/drivers/md/dm-vdo/data-vio.h
> +++ b/drivers/md/dm-vdo/data-vio.h
> @@ -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);
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size
2024-10-03 1:15 ` [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size linux
@ 2024-10-03 15:43 ` Matthew Sakai
0 siblings, 0 replies; 14+ messages in thread
From: Matthew Sakai @ 2024-10-03 15:43 UTC (permalink / raw)
To: linux, agk, snitzer, mpatocka; +Cc: dm-devel, linux-kernel
On 10/2/24 9:15 PM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> uds_compute_index_size() has been unused since it was added in
> commit b46d79bdb82a ("dm vdo: add deduplication index storage interface")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
> ---
> drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------------------
> drivers/md/dm-vdo/indexer/indexer.h | 4 ----
> 2 files changed, 30 deletions(-)
>
> diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c
> index 627adc24af3b..af8fab83b0f3 100644
> --- a/drivers/md/dm-vdo/indexer/index-layout.c
> +++ b/drivers/md/dm-vdo/indexer/index-layout.c
> @@ -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)
> {
> diff --git a/drivers/md/dm-vdo/indexer/indexer.h b/drivers/md/dm-vdo/indexer/indexer.h
> index 3744aaf625b0..183a94eb7e92 100644
> --- a/drivers/md/dm-vdo/indexer/indexer.h
> +++ b/drivers/md/dm-vdo/indexer/indexer.h
> @@ -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);
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/9] dm deadcoding
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
` (8 preceding siblings ...)
2024-10-03 1:15 ` [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size linux
@ 2024-10-21 11:55 ` Mikulas Patocka
2024-10-21 12:02 ` Dr. David Alan Gilbert
9 siblings, 1 reply; 14+ messages in thread
From: Mikulas Patocka @ 2024-10-21 11:55 UTC (permalink / raw)
To: Dr. David Alan Gilbert; +Cc: agk, snitzer, msakai, dm-devel, linux-kernel
Hi
I've accepted these patches.
Mikulas
On Thu, 3 Oct 2024, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> 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.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
>
> 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(-)
>
> --
> 2.46.2
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/9] dm deadcoding
2024-10-21 11:55 ` [PATCH 0/9] dm deadcoding Mikulas Patocka
@ 2024-10-21 12:02 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 14+ messages in thread
From: Dr. David Alan Gilbert @ 2024-10-21 12:02 UTC (permalink / raw)
To: Mikulas Patocka; +Cc: agk, snitzer, msakai, dm-devel, linux-kernel
* Mikulas Patocka (mpatocka@redhat.com) wrote:
> Hi
>
> I've accepted these patches.
Thanks, yep I noticed them in -next :-)
Dave
> Mikulas
>
>
>
> On Thu, 3 Oct 2024, linux@treblig.org wrote:
>
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > 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.
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> >
> >
> > 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(-)
> >
> > --
> > 2.46.2
> >
>
>
--
-----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 |_______/
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-10-21 12:02 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03 1:15 [PATCH 0/9] dm deadcoding linux
2024-10-03 1:15 ` [PATCH 1/9] dm cache: Remove unused btracker_nr_writebacks_queued linux
2024-10-03 1:15 ` [PATCH 2/9] dm cache: Remove unused dm_cache_dump linux
2024-10-03 1:15 ` [PATCH 3/9] dm cache: Remove unused dm_cache_size linux
2024-10-03 1:15 ` [PATCH 4/9] dm cache: Remove unused functions in bio-prison-v1 linux
2024-10-03 1:15 ` [PATCH 5/9] dm: Remove unused dm_set_md_type linux
2024-10-03 1:15 ` [PATCH 6/9] dm: Remove unused dm_table_bio_based linux
2024-10-03 1:15 ` [PATCH 7/9] dm: zoned: Remove unused functions linux
2024-10-03 1:15 ` [PATCH 8/9] dm vdo: " linux
2024-10-03 15:43 ` Matthew Sakai
2024-10-03 1:15 ` [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size linux
2024-10-03 15:43 ` Matthew Sakai
2024-10-21 11:55 ` [PATCH 0/9] dm deadcoding Mikulas Patocka
2024-10-21 12:02 ` Dr. David Alan Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox