diff options
author | NeilBrown <neilb@suse.de> | 2006-12-08 05:36:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:39 -0500 |
commit | 6796bf54a64df36f96a42ae222423fffe36c58a5 (patch) | |
tree | 50fa7f380469500a4419c5d88fcfb24c4c5ccae8 | |
parent | 37be41241f43109c55d92cdbf303399eea642f14 (diff) |
[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>
-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) | |||
920 | } | 920 | } |
921 | owner = disk->fops->owner; | 921 | owner = disk->fops->owner; |
922 | 922 | ||
923 | mutex_lock(&bdev->bd_mutex); | 923 | mutex_lock_nested(&bdev->bd_mutex, for_part); |
924 | if (!bdev->bd_openers) { | 924 | if (!bdev->bd_openers) { |
925 | bdev->bd_disk = disk; | 925 | bdev->bd_disk = disk; |
926 | bdev->bd_contains = bdev; | 926 | bdev->bd_contains = bdev; |
@@ -1062,7 +1062,7 @@ static int __blkdev_put(struct block_device *bdev, int for_part) | |||
1062 | struct gendisk *disk = bdev->bd_disk; | 1062 | struct gendisk *disk = bdev->bd_disk; |
1063 | struct block_device *victim = NULL; | 1063 | struct block_device *victim = NULL; |
1064 | 1064 | ||
1065 | mutex_lock(&bdev->bd_mutex); | 1065 | mutex_lock_nested(&bdev->bd_mutex, for_part); |
1066 | lock_kernel(); | 1066 | lock_kernel(); |
1067 | if (for_part) | 1067 | if (for_part) |
1068 | bdev->bd_part_count--; | 1068 | bdev->bd_part_count--; |