aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-12-08 05:36:14 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:38 -0500
commitfd27c7a1bfa9801544ca961cdb4ca0b4998580b8 (patch)
tree44749ea9d81931cbe5a753b972f6b9fde92a6496
parent35a6027f1ab6594068cb8bca7705e4567753946b (diff)
[PATCH] lockdep: remove lock_key approach to managing nested bd_mutex locks
The extra call to get_gendisk is not good. It causes a ->probe and possible module load before it is really appropriate to do this. 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.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 528cf053ce96..36c38f48a4ed 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -355,14 +355,10 @@ static int bdev_set(struct inode *inode, void *data)
355 355
356static LIST_HEAD(all_bdevs); 356static LIST_HEAD(all_bdevs);
357 357
358static struct lock_class_key bdev_part_lock_key;
359
360struct block_device *bdget(dev_t dev) 358struct block_device *bdget(dev_t dev)
361{ 359{
362 struct block_device *bdev; 360 struct block_device *bdev;
363 struct inode *inode; 361 struct inode *inode;
364 struct gendisk *disk;
365 int part = 0;
366 362
367 inode = iget5_locked(bd_mnt->mnt_sb, hash(dev), 363 inode = iget5_locked(bd_mnt->mnt_sb, hash(dev),
368 bdev_test, bdev_set, &dev); 364 bdev_test, bdev_set, &dev);
@@ -388,11 +384,6 @@ struct block_device *bdget(dev_t dev)
388 list_add(&bdev->bd_list, &all_bdevs); 384 list_add(&bdev->bd_list, &all_bdevs);
389 spin_unlock(&bdev_lock); 385 spin_unlock(&bdev_lock);
390 unlock_new_inode(inode); 386 unlock_new_inode(inode);
391 mutex_init(&bdev->bd_mutex);
392 disk = get_gendisk(dev, &part);
393 if (part)
394 lockdep_set_class(&bdev->bd_mutex, &bdev_part_lock_key);
395 put_disk(disk);
396 } 387 }
397 return bdev; 388 return bdev;
398} 389}