[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] dm-mpath: Change _mpath_lock to a semaphore



Change _mpath_lock from a spinlock to a semaphore.

--- diff/drivers/md/dm-mpath.c	2004-02-12 13:58:08.000000000 -0600
+++ source/drivers/md/dm-mpath.c	2004-02-12 13:55:30.000000000 -0600
@@ -304,7 +304,7 @@
 static struct dm_daemon _kmpathd;
 
 static LIST_HEAD(_mpaths);
-static spinlock_t _mpath_lock = SPIN_LOCK_UNLOCKED;
+static DECLARE_MUTEX(_mpath_lock);
 
 static void submit_ios(struct bio *bio)
 {
@@ -409,7 +409,7 @@
 	struct multipath *m;
 	unsigned interval = 0;
 
-	spin_lock(&_mpath_lock);
+	down(&_mpath_lock);
 	list_for_each_entry (m, &_mpaths, list) {
 		dispatch_failed_ios(m);
 		iterate_paths(m, test_path);
@@ -424,7 +424,7 @@
 
 		interval = min_not_zero(interval, m->test_interval);
 	}
-	spin_unlock(&_mpath_lock);
+	up(&_mpath_lock);
 
 	blk_run_queues();
 
@@ -689,9 +689,9 @@
 	ti->private = m;
 	m->ti = ti;
 
-	spin_lock(&_mpath_lock);
+	down(&_mpath_lock);
 	list_add(&m->list, &_mpaths);
-	spin_unlock(&_mpath_lock);
+	up(&_mpath_lock);
 
 	return 0;
 
@@ -704,9 +704,9 @@
 {
 	struct multipath *m = (struct multipath *) ti->private;
 
-	spin_lock(&_mpath_lock);
+	down(&_mpath_lock);
 	list_del(&m->list);
-	spin_unlock(&_mpath_lock);
+	up(&_mpath_lock);
 
 	free_multipath(m);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]