Skip to content

Commit 047b821

Browse files
Dr. David Alan GilbertMikulas Patocka
authored andcommitted
dm cache: Remove unused functions in bio-prison-v1
dm_cache_size() and dm_cache_dump() are unused since commit b29d498 ("dm cache: significant rework to leverage dm-bio-prison-v2") Remove them. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 0153b79 commit 047b821

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

drivers/md/dm-bio-prison-v1.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,6 @@ int dm_bio_detain(struct dm_bio_prison *prison,
198198
}
199199
EXPORT_SYMBOL_GPL(dm_bio_detain);
200200

201-
int dm_get_cell(struct dm_bio_prison *prison,
202-
struct dm_cell_key *key,
203-
struct dm_bio_prison_cell *cell_prealloc,
204-
struct dm_bio_prison_cell **cell_result)
205-
{
206-
return bio_detain(prison, key, NULL, cell_prealloc, cell_result);
207-
}
208-
EXPORT_SYMBOL_GPL(dm_get_cell);
209-
210201
/*
211202
* @inmates must have been initialised prior to this call
212203
*/
@@ -288,32 +279,6 @@ void dm_cell_visit_release(struct dm_bio_prison *prison,
288279
}
289280
EXPORT_SYMBOL_GPL(dm_cell_visit_release);
290281

291-
static int __promote_or_release(struct rb_root *root,
292-
struct dm_bio_prison_cell *cell)
293-
{
294-
if (bio_list_empty(&cell->bios)) {
295-
rb_erase(&cell->node, root);
296-
return 1;
297-
}
298-
299-
cell->holder = bio_list_pop(&cell->bios);
300-
return 0;
301-
}
302-
303-
int dm_cell_promote_or_release(struct dm_bio_prison *prison,
304-
struct dm_bio_prison_cell *cell)
305-
{
306-
int r;
307-
unsigned l = lock_nr(&cell->key, prison->num_locks);
308-
309-
spin_lock_irq(&prison->regions[l].lock);
310-
r = __promote_or_release(&prison->regions[l].cell, cell);
311-
spin_unlock_irq(&prison->regions[l].lock);
312-
313-
return r;
314-
}
315-
EXPORT_SYMBOL_GPL(dm_cell_promote_or_release);
316-
317282
/*----------------------------------------------------------------*/
318283

319284
#define DEFERRED_SET_SIZE 64

drivers/md/dm-bio-prison-v1.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison
7272
void dm_bio_prison_free_cell(struct dm_bio_prison *prison,
7373
struct dm_bio_prison_cell *cell);
7474

75-
/*
76-
* Creates, or retrieves a cell that overlaps the given key.
77-
*
78-
* Returns 1 if pre-existing cell returned, zero if new cell created using
79-
* @cell_prealloc.
80-
*/
81-
int dm_get_cell(struct dm_bio_prison *prison,
82-
struct dm_cell_key *key,
83-
struct dm_bio_prison_cell *cell_prealloc,
84-
struct dm_bio_prison_cell **cell_result);
85-
8675
/*
8776
* Returns false if key is beyond BIO_PRISON_MAX_RANGE or spans a boundary.
8877
*/
@@ -117,19 +106,6 @@ void dm_cell_visit_release(struct dm_bio_prison *prison,
117106
void (*visit_fn)(void *, struct dm_bio_prison_cell *),
118107
void *context, struct dm_bio_prison_cell *cell);
119108

120-
/*
121-
* Rather than always releasing the prisoners in a cell, the client may
122-
* want to promote one of them to be the new holder. There is a race here
123-
* though between releasing an empty cell, and other threads adding new
124-
* inmates. So this function makes the decision with its lock held.
125-
*
126-
* This function can have two outcomes:
127-
* i) An inmate is promoted to be the holder of the cell (return value of 0).
128-
* ii) The cell has no inmate for promotion and is released (return value of 1).
129-
*/
130-
int dm_cell_promote_or_release(struct dm_bio_prison *prison,
131-
struct dm_bio_prison_cell *cell);
132-
133109
/*----------------------------------------------------------------*/
134110

135111
/*

0 commit comments

Comments
 (0)