summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2008-08-12 15:54:15 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2008-08-12 15:54:15 +1000
commit2b43ec707db79b5c59ac018d34d17dc5f9774aef (patch)
tree291828cefed5dab2f2a08692660ba034061e6329 /net
parentbd6245005323bfa988a9e896a7938a7809797d49 (diff)
parent9ac2f04936e1140d7a28a01b84e086458e191b49 (diff)
Merge commit 'semaphore-removal/semaphore-removal'
Diffstat (limited to 'net')
-rw-r--r--net/9p/trans_virtio.c21
-rw-r--r--net/bluetooth/hci_core.c2
2 files changed, 12 insertions, 11 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 42adc052b149..a6084becf971 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -34,6 +34,7 @@
#include <linux/ipv6.h>
#include <linux/errno.h>
#include <linux/kernel.h>
+#include <linux/spinlock.h>
#include <linux/un.h>
#include <linux/uaccess.h>
#include <linux/inet.h>
@@ -48,8 +49,8 @@
#define VIRTQUEUE_NUM 128
-/* a single mutex to manage channel initialization and attachment */
-static DEFINE_MUTEX(virtio_9p_lock);
+/* a single lock to manage channel initialization and attachment */
+static DEFINE_SPINLOCK(virtio_9p_lock);
/* global which tracks highest initialized channel */
static int chan_index;
@@ -211,9 +212,9 @@ static void p9_virtio_close(struct p9_trans *trans)
chan->max_tag = 0;
spin_unlock_irqrestore(&chan->lock, flags);
- mutex_lock(&virtio_9p_lock);
+ spin_lock(&virtio_9p_lock);
chan->inuse = false;
- mutex_unlock(&virtio_9p_lock);
+ spin_unlock(&virtio_9p_lock);
kfree(trans);
}
@@ -381,10 +382,10 @@ static int p9_virtio_probe(struct virtio_device *vdev)
struct virtio_chan *chan;
int index;
- mutex_lock(&virtio_9p_lock);
+ spin_lock(&virtio_9p_lock);
index = chan_index++;
chan = &channels[index];
- mutex_unlock(&virtio_9p_lock);
+ spin_unlock(&virtio_9p_lock);
if (chan_index > MAX_9P_CHAN) {
printk(KERN_ERR "9p: virtio: Maximum channels exceeded\n");
@@ -413,9 +414,9 @@ static int p9_virtio_probe(struct virtio_device *vdev)
out_free_vq:
vdev->config->del_vq(chan->vq);
fail:
- mutex_lock(&virtio_9p_lock);
+ spin_lock(&virtio_9p_lock);
chan_index--;
- mutex_unlock(&virtio_9p_lock);
+ spin_unlock(&virtio_9p_lock);
return err;
}
@@ -449,7 +450,7 @@ p9_virtio_create(const char *devname, char *args, int msize,
struct virtio_chan *chan = channels;
int index = 0;
- mutex_lock(&virtio_9p_lock);
+ spin_lock(&virtio_9p_lock);
while (index < MAX_9P_CHAN) {
if (chan->initialized && !chan->inuse) {
chan->inuse = true;
@@ -459,7 +460,7 @@ p9_virtio_create(const char *devname, char *args, int msize,
chan = &channels[index];
}
}
- mutex_unlock(&virtio_9p_lock);
+ spin_unlock(&virtio_9p_lock);
if (index >= MAX_9P_CHAN) {
printk(KERN_ERR "9p: no channels available\n");
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index f5b21cb93699..286942a79a40 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -888,7 +888,7 @@ int hci_register_dev(struct hci_dev *hdev)
hdev->reassembly[i] = NULL;
init_waitqueue_head(&hdev->req_wait_q);
- init_MUTEX(&hdev->req_lock);
+ mutex_init(&hdev->req_lock);
inquiry_cache_init(hdev);