aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 5f0f559d3b92..d16bb5b80789 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -73,7 +73,7 @@ union map_info *dm_get_mapinfo(struct bio *bio)
73 73
74struct mapped_device { 74struct mapped_device {
75 struct rw_semaphore io_lock; 75 struct rw_semaphore io_lock;
76 struct semaphore suspend_lock; 76 struct mutex suspend_lock;
77 spinlock_t pushback_lock; 77 spinlock_t pushback_lock;
78 rwlock_t map_lock; 78 rwlock_t map_lock;
79 atomic_t holders; 79 atomic_t holders;
@@ -994,7 +994,7 @@ static struct mapped_device *alloc_dev(int minor)
994 994
995 memset(md, 0, sizeof(*md)); 995 memset(md, 0, sizeof(*md));
996 init_rwsem(&md->io_lock); 996 init_rwsem(&md->io_lock);
997 init_MUTEX(&md->suspend_lock); 997 mutex_init(&md->suspend_lock);
998 spin_lock_init(&md->pushback_lock); 998 spin_lock_init(&md->pushback_lock);
999 rwlock_init(&md->map_lock); 999 rwlock_init(&md->map_lock);
1000 atomic_set(&md->holders, 1); 1000 atomic_set(&md->holders, 1);
@@ -1282,7 +1282,7 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table)
1282{ 1282{
1283 int r = -EINVAL; 1283 int r = -EINVAL;
1284 1284
1285 down(&md->suspend_lock); 1285 mutex_lock(&md->suspend_lock);
1286 1286
1287 /* device must be suspended */ 1287 /* device must be suspended */
1288 if (!dm_suspended(md)) 1288 if (!dm_suspended(md))
@@ -1297,7 +1297,7 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table)
1297 r = __bind(md, table); 1297 r = __bind(md, table);
1298 1298
1299out: 1299out:
1300 up(&md->suspend_lock); 1300 mutex_unlock(&md->suspend_lock);
1301 return r; 1301 return r;
1302} 1302}
1303 1303
@@ -1353,7 +1353,7 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
1353 int do_lockfs = suspend_flags & DM_SUSPEND_LOCKFS_FLAG ? 1 : 0; 1353 int do_lockfs = suspend_flags & DM_SUSPEND_LOCKFS_FLAG ? 1 : 0;
1354 int noflush = suspend_flags & DM_SUSPEND_NOFLUSH_FLAG ? 1 : 0; 1354 int noflush = suspend_flags & DM_SUSPEND_NOFLUSH_FLAG ? 1 : 0;
1355 1355
1356 down(&md->suspend_lock); 1356 mutex_lock(&md->suspend_lock);
1357 1357
1358 if (dm_suspended(md)) 1358 if (dm_suspended(md))
1359 goto out_unlock; 1359 goto out_unlock;
@@ -1475,7 +1475,7 @@ out:
1475 dm_table_put(map); 1475 dm_table_put(map);
1476 1476
1477out_unlock: 1477out_unlock:
1478 up(&md->suspend_lock); 1478 mutex_unlock(&md->suspend_lock);
1479 return r; 1479 return r;
1480} 1480}
1481 1481
@@ -1485,7 +1485,7 @@ int dm_resume(struct mapped_device *md)
1485 struct bio *def; 1485 struct bio *def;
1486 struct dm_table *map = NULL; 1486 struct dm_table *map = NULL;
1487 1487
1488 down(&md->suspend_lock); 1488 mutex_lock(&md->suspend_lock);
1489 if (!dm_suspended(md)) 1489 if (!dm_suspended(md))
1490 goto out; 1490 goto out;
1491 1491
@@ -1521,7 +1521,7 @@ int dm_resume(struct mapped_device *md)
1521 1521
1522out: 1522out:
1523 dm_table_put(map); 1523 dm_table_put(map);
1524 up(&md->suspend_lock); 1524 mutex_unlock(&md->suspend_lock);
1525 1525
1526 return r; 1526 return r;
1527} 1527}