Re: [PATCH] mtd: fix broken name_to_dev_t() declaration

From: Herbert Poetzl
Date: Thu Mar 23 2006 - 18:49:00 EST


On Thu, Mar 23, 2006 at 03:46:25PM -0800, Andrew Morton wrote:
> Herbert Poetzl <herbert@xxxxxxxxxxxx> wrote:
> >
> > drivers/mtd/devices/blkmtd.c uses a local declaration
> > of name_to_dev_t() which is inconsistant with the real
> > one. the following patch fixes this by removing the
> > local declaration and including mount.h instead
>
> OK..
>
> Does that name_to_dev_t() call actually work? In my experience,
> name_to_dev_t() just doesn't work if called at times other than during
> early boot.
>
> #ifdef MODULE
> mode = (readonly) ? O_RDONLY : O_RDWR;
> bdev = open_bdev_excl(devname, mode, NULL);
> #else
> mode = (readonly) ? FMODE_READ : FMODE_WRITE;
> bdev = open_by_devnum(name_to_dev_t(devname), mode);
> #endif
>
> OK, I guess it still works at initcall-time. Still, the code is a bit,
> err, innovative.

ah, well, I was not judging the mtd code ...
just fixing an issue which popped up :)

best,
Herbert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/