From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Al Viro <viro@ftp.linux.org.uk>
Subject: [PATCH 001 of 4] Remove lock_key approach to managing nested bd_mutex locks.
Date: Wed, 11 Oct 2006 16:09:08 +1000 [thread overview]
Message-ID: <1061011060908.12435@suse.de> (raw)
In-Reply-To: 20061011155522.7915.patches@notabene
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>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./fs/block_dev.c | 9 ---------
1 file changed, 9 deletions(-)
diff .prev/fs/block_dev.c ./fs/block_dev.c
--- .prev/fs/block_dev.c 2006-10-11 15:37:05.000000000 +1000
+++ ./fs/block_dev.c 2006-10-11 15:37:10.000000000 +1000
@@ -357,14 +357,10 @@ static int bdev_set(struct inode *inode,
static LIST_HEAD(all_bdevs);
-static struct lock_class_key bdev_part_lock_key;
-
struct block_device *bdget(dev_t dev)
{
struct block_device *bdev;
struct inode *inode;
- struct gendisk *disk;
- int part = 0;
inode = iget5_locked(bd_mnt->mnt_sb, hash(dev),
bdev_test, bdev_set, &dev);
@@ -390,11 +386,6 @@ struct block_device *bdget(dev_t dev)
list_add(&bdev->bd_list, &all_bdevs);
spin_unlock(&bdev_lock);
unlock_new_inode(inode);
- mutex_init(&bdev->bd_mutex);
- disk = get_gendisk(dev, &part);
- if (part)
- lockdep_set_class(&bdev->bd_mutex, &bdev_part_lock_key);
- put_disk(disk);
}
return bdev;
}
next prev parent reply other threads:[~2006-10-11 6:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 6:09 [PATCH 000 of 4] Introduction NeilBrown
2006-10-11 6:09 ` NeilBrown [this message]
2006-10-11 6:09 ` [PATCH 002 of 4] Simplify some aspects of bd_mutex nesting NeilBrown
2006-10-11 6:09 ` [PATCH 003 of 4] Use mutex_lock_nested for bd_mutex to avoid lockdep warning NeilBrown
2006-10-11 6:09 ` [PATCH 004 of 4] Avoid lockdep warning in md NeilBrown
2006-10-11 8:44 ` [PATCH 000 of 4] Introduction Peter Zijlstra
2006-10-11 8:52 ` Ingo Molnar
2006-10-11 9:20 ` Neil Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1061011060908.12435@suse.de \
--to=neilb@suse.de \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.