提交 6796bf54 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] lockdep: use mutex_lock_nested for bd_mutex to avoid lockdep warning

Now that the nesting in blkdev_{get,put} is simpler, adding mutex_lock_nested
is trivial.

Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 37be4124
......@@ -920,7 +920,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
}
owner = disk->fops->owner;
mutex_lock(&bdev->bd_mutex);
mutex_lock_nested(&bdev->bd_mutex, for_part);
if (!bdev->bd_openers) {
bdev->bd_disk = disk;
bdev->bd_contains = bdev;
......@@ -1062,7 +1062,7 @@ static int __blkdev_put(struct block_device *bdev, int for_part)
struct gendisk *disk = bdev->bd_disk;
struct block_device *victim = NULL;
mutex_lock(&bdev->bd_mutex);
mutex_lock_nested(&bdev->bd_mutex, for_part);
lock_kernel();
if (for_part)
bdev->bd_part_count--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册