]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dm cache: Remove unused functions in bio-prison-v1
authorDr. David Alan Gilbert <linux@treblig.org>
Thu, 3 Oct 2024 01:15:49 +0000 (02:15 +0100)
committerMikulas Patocka <mpatocka@redhat.com>
Wed, 20 Nov 2024 10:38:04 +0000 (11:38 +0100)
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>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-bio-prison-v1.c
drivers/md/dm-bio-prison-v1.h

index bca0f39e15b87acf6f4da69163ba09551f29f287..b4d1c4329df34e1bd99d3d3dc329e60b8a924231 100644 (file)
@@ -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
index 2a097ed0d85e9b4296323e35183a30e484faabcb..d39706c484476a5b8c9eb24097ae1705a6d2e79d 100644 (file)
@@ -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);
-
 /*----------------------------------------------------------------*/
 
 /*