[PATCH 8/9] pstore/blk: use the normal block device I/O path
Christoph Hellwig
hch at lst.de
Mon Nov 23 09:49:14 EST 2020
On Sun, Nov 08, 2020 at 10:43:29PM +0800, 廖威雄 wrote:
> > + const char devname[] = "/dev/pstore-blk";
> > + dev_t dev = name_to_dev_t(blkdev);
> > +
> > + if (!dev)
> > + return;
> > + init_unlink(devname);
> > + init_mknod(devname, S_IFBLK | 0600, new_encode_dev(dev));
> > + __pstore_blk_init(devname);
>
> How about pstore/blk making /dev/pstore-blk node no matter build-in
> or module. Then pstore/blk always opens /dev/pstore-blk. By this way,
> blkdev can also be a device number if pstore/blk built as a module.
Please read the comment above blkdev_get_by_dev on why no one should
add new interfaces based on the device number.
More information about the linux-mtd
mailing list