[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100525160550.GC28588@agk-dp.fab.redhat.com>
Date: Tue, 25 May 2010 17:05:50 +0100
From: Alasdair G Kergon <agk@...hat.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Will Drewry <wad@...omium.org>, linux-kernel@...r.kernel.org,
Al Viro <viro@...iv.linux.org.uk>,
Nick Piggin <npiggin@...e.de>, Tejun Heo <tj@...nel.org>,
Scott James Remnant <scott@...ntu.com>,
Vegard Nossum <vegard.nossum@...il.com>,
Harald Hoyer <harald@...hat.com>,
Christoph Lameter <cl@...ux-foundation.org>, agk@...hat.com,
snitzer@...hat.com
Subject: Re: [PATCH 2/2] init, mount: export the name_to_dev_t symbol
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists