diff options
author | NeilBrown <neilb@suse.de> | 2006-12-08 11:36:16 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 17:28:39 +0100 |
commit | 6796bf54a64df36f96a42ae222423fffe36c58a5 (patch) | |
tree | 50fa7f380469500a4419c5d88fcfb24c4c5ccae8 /fs/block_dev.c | |
parent | [PATCH] lockdep: simplify some aspects of bd_mutex nesting (diff) | |
download | linux-6796bf54a64df36f96a42ae222423fffe36c58a5.tar.xz linux-6796bf54a64df36f96a42ae222423fffe36c58a5.zip |
[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: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r-- | fs/block_dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 19f5f153ddb8..846f32d51be7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -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--; |