X-Git-Url: http://bbs.cooldavid.org/git/?a=blobdiff_plain;f=drivers%2Fblock%2Faoe%2Faoeblk.c;h=f21c237a9e5e124a07c205c9770379831df6d8a4;hb=2a48fc0ab24241755dc93bfd4f01d68efab47f5a;hp=a946929735a5818e525c14e97b9011913f9e54f9;hpb=613655fa39ff6957754fa8ceb8559980920eb8ee;p=net-next-2.6.git diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index a946929735a..f21c237a9e5 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c @@ -12,9 +12,10 @@ #include #include #include -#include +#include #include "aoe.h" +static DEFINE_MUTEX(aoeblk_mutex); static struct kmem_cache *buf_pool_cache; static ssize_t aoedisk_show_state(struct device *dev, @@ -125,16 +126,16 @@ aoeblk_open(struct block_device *bdev, fmode_t mode) struct aoedev *d = bdev->bd_disk->private_data; ulong flags; - lock_kernel(); + mutex_lock(&aoeblk_mutex); spin_lock_irqsave(&d->lock, flags); if (d->flags & DEVFL_UP) { d->nopen++; spin_unlock_irqrestore(&d->lock, flags); - unlock_kernel(); + mutex_unlock(&aoeblk_mutex); return 0; } spin_unlock_irqrestore(&d->lock, flags); - unlock_kernel(); + mutex_unlock(&aoeblk_mutex); return -ENODEV; }