Skip to content

Commit 4f186f8

Browse files
Kiyoshi Uedakergon
authored andcommitted
dm: rename dm_suspended to dm_suspended_md
This patch renames dm_suspended() to dm_suspended_md() and keeps it internal to dm. No functional change. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Cc: Mike Anderson <andmike@linux.vnet.ibm.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent 4d4471c commit 4f186f8

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎drivers/md/dm-ioctl.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static int __dev_status(struct mapped_device *md, struct dm_ioctl *param)
579579
param->flags &= ~(DM_SUSPEND_FLAG | DM_READONLY_FLAG |
580580
DM_ACTIVE_PRESENT_FLAG);
581581

582-
if (dm_suspended(md))
582+
if (dm_suspended_md(md))
583583
param->flags |= DM_SUSPEND_FLAG;
584584

585585
param->dev = huge_encode_dev(disk_devt(disk));
@@ -839,7 +839,7 @@ static int do_suspend(struct dm_ioctl *param)
839839
if (param->flags & DM_NOFLUSH_FLAG)
840840
suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG;
841841

842-
if (!dm_suspended(md))
842+
if (!dm_suspended_md(md))
843843
r = dm_suspend(md, suspend_flags);
844844

845845
if (!r)
@@ -881,7 +881,7 @@ static int do_resume(struct dm_ioctl *param)
881881
suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG;
882882
if (param->flags & DM_NOFLUSH_FLAG)
883883
suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG;
884-
if (!dm_suspended(md))
884+
if (!dm_suspended_md(md))
885885
dm_suspend(md, suspend_flags);
886886

887887
old_map = dm_swap_table(md, new_map);
@@ -897,7 +897,7 @@ static int do_resume(struct dm_ioctl *param)
897897
set_disk_ro(dm_disk(md), 1);
898898
}
899899

900-
if (dm_suspended(md))
900+
if (dm_suspended_md(md))
901901
r = dm_resume(md);
902902

903903
if (old_map)

‎drivers/md/dm-sysfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static ssize_t dm_attr_uuid_show(struct mapped_device *md, char *buf)
5959

6060
static ssize_t dm_attr_suspended_show(struct mapped_device *md, char *buf)
6161
{
62-
sprintf(buf, "%d\n", dm_suspended(md));
62+
sprintf(buf, "%d\n", dm_suspended_md(md));
6363

6464
return strlen(buf);
6565
}

‎drivers/md/dm.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode,
415415

416416
tgt = dm_table_get_target(map, 0);
417417

418-
if (dm_suspended(md)) {
418+
if (dm_suspended_md(md)) {
419419
r = -EAGAIN;
420420
goto out;
421421
}
@@ -2182,7 +2182,7 @@ void dm_put(struct mapped_device *md)
21822182
MINOR(disk_devt(dm_disk(md))));
21832183
set_bit(DMF_FREEING, &md->flags);
21842184
spin_unlock(&_minor_lock);
2185-
if (!dm_suspended(md)) {
2185+
if (!dm_suspended_md(md)) {
21862186
dm_table_presuspend_targets(map);
21872187
dm_table_postsuspend_targets(map);
21882188
}
@@ -2381,7 +2381,7 @@ struct dm_table *dm_swap_table(struct mapped_device *md, struct dm_table *table)
23812381
mutex_lock(&md->suspend_lock);
23822382

23832383
/* device must be suspended */
2384-
if (!dm_suspended(md))
2384+
if (!dm_suspended_md(md))
23852385
goto out;
23862386

23872387
r = dm_calculate_queue_limits(table, &limits);
@@ -2461,7 +2461,7 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
24612461

24622462
mutex_lock(&md->suspend_lock);
24632463

2464-
if (dm_suspended(md)) {
2464+
if (dm_suspended_md(md)) {
24652465
r = -EINVAL;
24662466
goto out_unlock;
24672467
}
@@ -2568,7 +2568,7 @@ int dm_resume(struct mapped_device *md)
25682568
struct dm_table *map = NULL;
25692569

25702570
mutex_lock(&md->suspend_lock);
2571-
if (!dm_suspended(md))
2571+
if (!dm_suspended_md(md))
25722572
goto out;
25732573

25742574
map = dm_get_live_table(md);
@@ -2679,7 +2679,7 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj)
26792679
return md;
26802680
}
26812681

2682-
int dm_suspended(struct mapped_device *md)
2682+
int dm_suspended_md(struct mapped_device *md)
26832683
{
26842684
return test_bit(DMF_SUSPENDED, &md->flags);
26852685
}

‎drivers/md/dm.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ int dm_split_args(int *argc, char ***argvp, char *input);
9393
*/
9494
int dm_deleting_md(struct mapped_device *md);
9595

96+
/*
97+
* Is this mapped_device suspended?
98+
*/
99+
int dm_suspended_md(struct mapped_device *md);
100+
96101
/*
97102
* The device-mapper can be driven through one of two interfaces;
98103
* ioctl or filesystem, depending which patch you have applied.

‎include/linux/device-mapper.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ void dm_uevent_add(struct mapped_device *md, struct list_head *elist);
235235
const char *dm_device_name(struct mapped_device *md);
236236
int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid);
237237
struct gendisk *dm_disk(struct mapped_device *md);
238-
int dm_suspended(struct mapped_device *md);
239238
int dm_noflush_suspending(struct dm_target *ti);
240239
union map_info *dm_get_mapinfo(struct bio *bio);
241240
union map_info *dm_get_rq_mapinfo(struct request *rq);

0 commit comments

Comments
 (0)