From: Alasdair G Kergon <agk@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Will Drewry <wad@chromium.org>,
linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
Nick Piggin <npiggin@suse.de>, Tejun Heo <tj@kernel.org>,
Scott James Remnant <scott@ubuntu.com>,
Vegard Nossum <vegard.nossum@gmail.com>,
Harald Hoyer <harald@redhat.com>,
Christoph Lameter <cl@linux-foundation.org>,
agk@redhat.com, snitzer@redhat.com
Subject: Re: [PATCH 2/2] init, mount: export the name_to_dev_t symbol
Date: Tue, 25 May 2010 17:05:50 +0100 [thread overview]
Message-ID: <20100525160550.GC28588@agk-dp.fab.redhat.com> (raw)
In-Reply-To: <20100525155535.GA811@infradead.org>
On Tue, May 25, 2010 at 11:55:35AM -0400, Christoph Hellwig wrote:
> NACK. It's really a hack for the boot code, there's no offical name to
> dev_t mapping.
> What are you trying to use it for?
Device-mapper contains a subset of that code, so he's proposing we
use it here:
@@ -434,17 +435,13 @@ static int __table_get_device(struct dm_
int r;
dev_t uninitialized_var(dev);
struct dm_dev_internal *dd;
- unsigned int major, minor;
BUG_ON(!t);
- if (sscanf(path, "%u:%u", &major, &minor) == 2) {
- /* Extract the major/minor numbers */
- dev = MKDEV(major, minor);
- if (MAJOR(dev) != major || MINOR(dev) != minor)
- return -EOVERFLOW;
- } else {
- /* convert the path to a device */
+ /* lookup by major:minor or registered device name */
+ dev = name_to_dev_t(path);
+ if (!dev) {
+ /* convert the path to a device by finding its inode */
struct block_device *bdev = lookup_bdev(path);
if (IS_ERR(bdev))
Alasdair
next prev parent reply other threads:[~2010-05-25 16:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 15:46 [PATCH 1/2] init: make the path argument a const in name_to_dev_t Will Drewry
2010-05-25 15:46 ` [PATCH 2/2] init, mount: export the name_to_dev_t symbol Will Drewry
2010-05-25 15:55 ` Christoph Hellwig
2010-05-25 16:05 ` Alasdair G Kergon [this message]
2010-05-25 16:11 ` Will Drewry
2010-05-25 17:21 ` Christoph Hellwig
2010-05-25 18:30 ` Mike Snitzer
2010-06-08 16:02 ` Will Drewry
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=20100525160550.GC28588@agk-dp.fab.redhat.com \
--to=agk@redhat.com \
--cc=cl@linux-foundation.org \
--cc=harald@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=scott@ubuntu.com \
--cc=snitzer@redhat.com \
--cc=tj@kernel.org \
--cc=vegard.nossum@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=wad@chromium.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome