Skip to content

Commit

Permalink
dm: rename dm_get_table to dm_get_live_table
Browse files Browse the repository at this point in the history
Rename dm_get_table to dm_get_live_table.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Alasdair G Kergon committed Dec 10, 2009
1 parent d0bcb87 commit 7c66641
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static void __hash_remove(struct hash_cell *hc)
dm_set_mdptr(hc->md, NULL);
mutex_unlock(&dm_hash_cells_mutex);

table = dm_get_table(hc->md);
table = dm_get_live_table(hc->md);
if (table) {
dm_table_event(table);
dm_table_put(table);
Expand Down Expand Up @@ -338,7 +338,7 @@ static int dm_hash_rename(uint32_t cookie, const char *old, const char *new)
/*
* Wake up any dm event waiters.
*/
table = dm_get_table(hc->md);
table = dm_get_live_table(hc->md);
if (table) {
dm_table_event(table);
dm_table_put(table);
Expand Down Expand Up @@ -564,7 +564,7 @@ static int __dev_status(struct mapped_device *md, struct dm_ioctl *param)

param->event_nr = dm_get_event_nr(md);

table = dm_get_table(md);
table = dm_get_live_table(md);
if (table) {
param->flags |= DM_ACTIVE_PRESENT_FLAG;
param->target_count = dm_table_get_num_targets(table);
Expand Down Expand Up @@ -993,7 +993,7 @@ static int dev_wait(struct dm_ioctl *param, size_t param_size)
if (r)
goto out;

table = dm_get_table(md);
table = dm_get_live_table(md);
if (table) {
retrieve_status(table, param, param_size);
dm_table_put(table);
Expand Down Expand Up @@ -1226,7 +1226,7 @@ static int table_deps(struct dm_ioctl *param, size_t param_size)
if (r)
goto out;

table = dm_get_table(md);
table = dm_get_live_table(md);
if (table) {
retrieve_deps(table, param, param_size);
dm_table_put(table);
Expand Down Expand Up @@ -1255,7 +1255,7 @@ static int table_status(struct dm_ioctl *param, size_t param_size)
if (r)
goto out;

table = dm_get_table(md);
table = dm_get_live_table(md);
if (table) {
retrieve_status(table, param, param_size);
dm_table_put(table);
Expand Down Expand Up @@ -1299,7 +1299,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
goto out;
}

table = dm_get_table(md);
table = dm_get_live_table(md);
if (!table)
goto out_argv;

Expand Down
24 changes: 12 additions & 12 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
struct mapped_device *md = bdev->bd_disk->private_data;
struct dm_table *map = dm_get_table(md);
struct dm_table *map = dm_get_live_table(md);
struct dm_target *tgt;
int r = -ENOTTY;

Expand Down Expand Up @@ -528,7 +528,7 @@ static void queue_io(struct mapped_device *md, struct bio *bio)
* function to access the md->map field, and make sure they call
* dm_table_put() when finished.
*/
struct dm_table *dm_get_table(struct mapped_device *md)
struct dm_table *dm_get_live_table(struct mapped_device *md)
{
struct dm_table *t;
unsigned long flags;
Expand Down Expand Up @@ -1294,7 +1294,7 @@ static void __split_and_process_bio(struct mapped_device *md, struct bio *bio)
struct clone_info ci;
int error = 0;

ci.map = dm_get_table(md);
ci.map = dm_get_live_table(md);
if (unlikely(!ci.map)) {
if (!bio_rw_flagged(bio, BIO_RW_BARRIER))
bio_io_error(bio);
Expand Down Expand Up @@ -1335,7 +1335,7 @@ static int dm_merge_bvec(struct request_queue *q,
struct bio_vec *biovec)
{
struct mapped_device *md = q->queuedata;
struct dm_table *map = dm_get_table(md);
struct dm_table *map = dm_get_live_table(md);
struct dm_target *ti;
sector_t max_sectors;
int max_size = 0;
Expand Down Expand Up @@ -1638,7 +1638,7 @@ static void map_request(struct dm_target *ti, struct request *clone,
static void dm_request_fn(struct request_queue *q)
{
struct mapped_device *md = q->queuedata;
struct dm_table *map = dm_get_table(md);
struct dm_table *map = dm_get_live_table(md);
struct dm_target *ti;
struct request *rq, *clone;

Expand Down Expand Up @@ -1697,7 +1697,7 @@ static int dm_lld_busy(struct request_queue *q)
{
int r;
struct mapped_device *md = q->queuedata;
struct dm_table *map = dm_get_table(md);
struct dm_table *map = dm_get_live_table(md);

if (!map || test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags))
r = 1;
Expand All @@ -1712,7 +1712,7 @@ static int dm_lld_busy(struct request_queue *q)
static void dm_unplug_all(struct request_queue *q)
{
struct mapped_device *md = q->queuedata;
struct dm_table *map = dm_get_table(md);
struct dm_table *map = dm_get_live_table(md);

if (map) {
if (dm_request_based(md))
Expand All @@ -1730,7 +1730,7 @@ static int dm_any_congested(void *congested_data, int bdi_bits)
struct dm_table *map;

if (!test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) {
map = dm_get_table(md);
map = dm_get_live_table(md);
if (map) {
/*
* Request-based dm cares about only own queue for
Expand Down Expand Up @@ -2166,7 +2166,7 @@ void dm_put(struct mapped_device *md)
BUG_ON(test_bit(DMF_FREEING, &md->flags));

if (atomic_dec_and_lock(&md->holders, &_minor_lock)) {
map = dm_get_table(md);
map = dm_get_live_table(md);
idr_replace(&_minor_idr, MINOR_ALLOCED,
MINOR(disk_devt(dm_disk(md))));
set_bit(DMF_FREEING, &md->flags);
Expand Down Expand Up @@ -2302,7 +2302,7 @@ static void dm_rq_set_flush_nr(struct request *clone, unsigned flush_nr)
static int dm_rq_barrier(struct mapped_device *md)
{
int i, j;
struct dm_table *map = dm_get_table(md);
struct dm_table *map = dm_get_live_table(md);
unsigned num_targets = dm_table_get_num_targets(map);
struct dm_target *ti;
struct request *clone;
Expand Down Expand Up @@ -2453,7 +2453,7 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
goto out_unlock;
}

map = dm_get_table(md);
map = dm_get_live_table(md);

/*
* DMF_NOFLUSH_SUSPENDING must be set before presuspend.
Expand Down Expand Up @@ -2558,7 +2558,7 @@ int dm_resume(struct mapped_device *md)
if (!dm_suspended(md))
goto out;

map = dm_get_table(md);
map = dm_get_live_table(md);
if (!map || !dm_table_get_size(map))
goto out;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/device-mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void dm_table_unplug_all(struct dm_table *t);
/*
* Table reference counting.
*/
struct dm_table *dm_get_table(struct mapped_device *md);
struct dm_table *dm_get_live_table(struct mapped_device *md);
void dm_table_get(struct dm_table *t);
void dm_table_put(struct dm_table *t);

Expand Down

0 comments on commit 7c66641

Please sign in to comment.