mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[PATCH] dm/md dependency tree in sysfs: convert bd_sem to bd_mutex
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>
This commit is contained in:
parent
f165921df4
commit
b4cf1b72ee
1 changed files with 4 additions and 4 deletions
|
@ -723,11 +723,11 @@ static int bd_claim_by_kobject(struct block_device *bdev, void *holder,
|
||||||
if (!bo)
|
if (!bo)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
down(&bdev->bd_sem);
|
mutex_lock(&bdev->bd_mutex);
|
||||||
res = bd_claim(bdev, holder);
|
res = bd_claim(bdev, holder);
|
||||||
if (res || !add_bd_holder(bdev, bo))
|
if (res || !add_bd_holder(bdev, bo))
|
||||||
free_bd_holder(bo);
|
free_bd_holder(bo);
|
||||||
up(&bdev->bd_sem);
|
mutex_unlock(&bdev->bd_mutex);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -748,11 +748,11 @@ static void bd_release_from_kobject(struct block_device *bdev,
|
||||||
if (!kobj)
|
if (!kobj)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
down(&bdev->bd_sem);
|
mutex_lock(&bdev->bd_mutex);
|
||||||
bd_release(bdev);
|
bd_release(bdev);
|
||||||
if ((bo = del_bd_holder(bdev, kobj)))
|
if ((bo = del_bd_holder(bdev, kobj)))
|
||||||
free_bd_holder(bo);
|
free_bd_holder(bo);
|
||||||
up(&bdev->bd_sem);
|
mutex_unlock(&bdev->bd_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue