aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-ioctl.c8
-rw-r--r--drivers/md/dm-sysfs.c2
-rw-r--r--drivers/md/dm.c12
-rw-r--r--drivers/md/dm.h5
4 files changed, 16 insertions, 11 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 63fd4de25bda..1d669322b27c 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -579,7 +579,7 @@ static int __dev_status(struct mapped_device *md, struct dm_ioctl *param)
579 param->flags &= ~(DM_SUSPEND_FLAG | DM_READONLY_FLAG | 579 param->flags &= ~(DM_SUSPEND_FLAG | DM_READONLY_FLAG |
580 DM_ACTIVE_PRESENT_FLAG); 580 DM_ACTIVE_PRESENT_FLAG);
581 581
582 if (dm_suspended(md)) 582 if (dm_suspended_md(md))
583 param->flags |= DM_SUSPEND_FLAG; 583 param->flags |= DM_SUSPEND_FLAG;
584 584
585 param->dev = huge_encode_dev(disk_devt(disk)); 585 param->dev = huge_encode_dev(disk_devt(disk));
@@ -839,7 +839,7 @@ static int do_suspend(struct dm_ioctl *param)
839 if (param->flags & DM_NOFLUSH_FLAG) 839 if (param->flags & DM_NOFLUSH_FLAG)
840 suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG; 840 suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG;
841 841
842 if (!dm_suspended(md)) 842 if (!dm_suspended_md(md))
843 r = dm_suspend(md, suspend_flags); 843 r = dm_suspend(md, suspend_flags);
844 844
845 if (!r) 845 if (!r)
@@ -881,7 +881,7 @@ static int do_resume(struct dm_ioctl *param)
881 suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG; 881 suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG;
882 if (param->flags & DM_NOFLUSH_FLAG) 882 if (param->flags & DM_NOFLUSH_FLAG)
883 suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG; 883 suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG;
884 if (!dm_suspended(md)) 884 if (!dm_suspended_md(md))
885 dm_suspend(md, suspend_flags); 885 dm_suspend(md, suspend_flags);
886 886
887 old_map = dm_swap_table(md, new_map); 887 old_map = dm_swap_table(md, new_map);
@@ -897,7 +897,7 @@ static int do_resume(struct dm_ioctl *param)
897 set_disk_ro(dm_disk(md), 1); 897 set_disk_ro(dm_disk(md), 1);
898 } 898 }
899 899
900 if (dm_suspended(md)) 900 if (dm_suspended_md(md))
901 r = dm_resume(md); 901 r = dm_resume(md);
902 902
903 if (old_map) 903 if (old_map)
diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index b000de38c99a..f53392df7b97 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -59,7 +59,7 @@ static ssize_t dm_attr_uuid_show(struct mapped_device *md, char *buf)
59 59
60static ssize_t dm_attr_suspended_show(struct mapped_device *md, char *buf) 60static ssize_t dm_attr_suspended_show(struct mapped_device *md, char *buf)
61{ 61{
62 sprintf(buf, "%d\n", dm_suspended(md)); 62 sprintf(buf, "%d\n", dm_suspended_md(md));
63 63
64 return strlen(buf); 64 return strlen(buf);
65} 65}
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index f2b993c43359..e0702bf37935 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -415,7 +415,7 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode,
415 415
416 tgt = dm_table_get_target(map, 0); 416 tgt = dm_table_get_target(map, 0);
417 417
418 if (dm_suspended(md)) { 418 if (dm_suspended_md(md)) {
419 r = -EAGAIN; 419 r = -EAGAIN;
420 goto out; 420 goto out;
421 } 421 }
@@ -2182,7 +2182,7 @@ void dm_put(struct mapped_device *md)
2182 MINOR(disk_devt(dm_disk(md)))); 2182 MINOR(disk_devt(dm_disk(md))));
2183 set_bit(DMF_FREEING, &md->flags); 2183 set_bit(DMF_FREEING, &md->flags);
2184 spin_unlock(&_minor_lock); 2184 spin_unlock(&_minor_lock);
2185 if (!dm_suspended(md)) { 2185 if (!dm_suspended_md(md)) {
2186 dm_table_presuspend_targets(map); 2186 dm_table_presuspend_targets(map);
2187 dm_table_postsuspend_targets(map); 2187 dm_table_postsuspend_targets(map);
2188 } 2188 }
@@ -2381,7 +2381,7 @@ struct dm_table *dm_swap_table(struct mapped_device *md, struct dm_table *table)
2381 mutex_lock(&md->suspend_lock); 2381 mutex_lock(&md->suspend_lock);
2382 2382
2383 /* device must be suspended */ 2383 /* device must be suspended */
2384 if (!dm_suspended(md)) 2384 if (!dm_suspended_md(md))
2385 goto out; 2385 goto out;
2386 2386
2387 r = dm_calculate_queue_limits(table, &limits); 2387 r = dm_calculate_queue_limits(table, &limits);
@@ -2461,7 +2461,7 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
2461 2461
2462 mutex_lock(&md->suspend_lock); 2462 mutex_lock(&md->suspend_lock);
2463 2463
2464 if (dm_suspended(md)) { 2464 if (dm_suspended_md(md)) {
2465 r = -EINVAL; 2465 r = -EINVAL;
2466 goto out_unlock; 2466 goto out_unlock;
2467 } 2467 }
@@ -2568,7 +2568,7 @@ int dm_resume(struct mapped_device *md)
2568 struct dm_table *map = NULL; 2568 struct dm_table *map = NULL;
2569 2569
2570 mutex_lock(&md->suspend_lock); 2570 mutex_lock(&md->suspend_lock);
2571 if (!dm_suspended(md)) 2571 if (!dm_suspended_md(md))
2572 goto out; 2572 goto out;
2573 2573
2574 map = dm_get_live_table(md); 2574 map = dm_get_live_table(md);
@@ -2679,7 +2679,7 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj)
2679 return md; 2679 return md;
2680} 2680}
2681 2681
2682int dm_suspended(struct mapped_device *md) 2682int dm_suspended_md(struct mapped_device *md)
2683{ 2683{
2684 return test_bit(DMF_SUSPENDED, &md->flags); 2684 return test_bit(DMF_SUSPENDED, &md->flags);
2685} 2685}
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 604a5f2a2383..8dadaa5bc396 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -94,6 +94,11 @@ int dm_split_args(int *argc, char ***argvp, char *input);
94int dm_deleting_md(struct mapped_device *md); 94int dm_deleting_md(struct mapped_device *md);
95 95
96/* 96/*
97 * Is this mapped_device suspended?
98 */
99int dm_suspended_md(struct mapped_device *md);
100
101/*
97 * The device-mapper can be driven through one of two interfaces; 102 * The device-mapper can be driven through one of two interfaces;
98 * ioctl or filesystem, depending which patch you have applied. 103 * ioctl or filesystem, depending which patch you have applied.
99 */ 104 */