Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dm-bio-prison] rename some parameters to dm_bio_detain.
memory -> cell_prealloc
ref -> cell_result
  • Loading branch information
jthornber committed Jan 22, 2013
1 parent ed52136 commit cf5273f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions drivers/md/dm-bio-prison.c
Expand Up @@ -135,8 +135,8 @@ static void __setup_new_cell(struct dm_bio_prison *prison,
static int __bio_detain(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct bio *inmate,
struct dm_bio_prison_cell *memory,
struct dm_bio_prison_cell **ref)
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{
uint32_t hash = hash_key(prison, key);
struct dm_bio_prison_cell *cell;
Expand All @@ -145,26 +145,26 @@ static int __bio_detain(struct dm_bio_prison *prison,
if (cell) {
if (inmate)
bio_list_add(&cell->bios, inmate);
*ref = cell;
*cell_result = cell;
return 1;
}

__setup_new_cell(prison, key, inmate, hash, memory);
*ref = memory;
__setup_new_cell(prison, key, inmate, hash, cell_prealloc);
*cell_result = cell_prealloc;
return 0;
}

static int bio_detain(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct bio *inmate,
struct dm_bio_prison_cell *memory,
struct dm_bio_prison_cell **ref)
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{
int r;
unsigned long flags;

spin_lock_irqsave(&prison->lock, flags);
r = __bio_detain(prison, key, inmate, memory, ref);
r = __bio_detain(prison, key, inmate, cell_prealloc, cell_result);
spin_unlock_irqrestore(&prison->lock, flags);

return r;
Expand All @@ -173,10 +173,10 @@ static int bio_detain(struct dm_bio_prison *prison,
int dm_bio_detain(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct bio *inmate,
struct dm_bio_prison_cell *memory,
struct dm_bio_prison_cell **ref)
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{
return bio_detain(prison, key, inmate, memory, ref);
return bio_detain(prison, key, inmate, cell_prealloc, cell_result);
}
EXPORT_SYMBOL_GPL(dm_bio_detain);

Expand Down
6 changes: 3 additions & 3 deletions drivers/md/dm-bio-prison.h
Expand Up @@ -53,12 +53,12 @@ void dm_bio_prison_free_cell(struct dm_bio_prison *prison,
* Creates, or retrieves a cell for the given key.
*
* Returns 1 if pre-existing cell returned, zero if new cell created using
* @memory.
* @cell_prealloc.
*/
int dm_get_cell(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct dm_bio_prison_cell *memory,
struct dm_bio_prison_cell **ref);
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result);

/*
* An atomic op that combines retrieving a cell, and adding a bio to it.
Expand Down

0 comments on commit cf5273f

Please sign in to comment.