[PATCH] dm/md dependency tree in sysfs: convert bd_sem to bd_mutex
authorJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Mon, 27 Mar 2006 09:18:00 +0000 (01:18 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 27 Mar 2006 16:45:00 +0000 (08:45 -0800)
Convert bd_sem to bd_mutex

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/block_dev.c

index 3f36df7e037cc0f32e136b5dc314185cd2b9981d..17c76182f389849c657cd60a791e1435411214f4 100644 (file)
@@ -723,11 +723,11 @@ static int bd_claim_by_kobject(struct block_device *bdev, void *holder,
        if (!bo)
                return -ENOMEM;
 
-       down(&bdev->bd_sem);
+       mutex_lock(&bdev->bd_mutex);
        res = bd_claim(bdev, holder);
        if (res || !add_bd_holder(bdev, bo))
                free_bd_holder(bo);
-       up(&bdev->bd_sem);
+       mutex_unlock(&bdev->bd_mutex);
 
        return res;
 }
@@ -748,11 +748,11 @@ static void bd_release_from_kobject(struct block_device *bdev,
        if (!kobj)
                return;
 
-       down(&bdev->bd_sem);
+       mutex_lock(&bdev->bd_mutex);
        bd_release(bdev);
        if ((bo = del_bd_holder(bdev, kobj)))
                free_bd_holder(bo);
-       up(&bdev->bd_sem);
+       mutex_unlock(&bdev->bd_mutex);
 }
 
 /**