/* Tries to open block device by device number. Use it ONLY if you really do not have anything better - i.e. when you are behind a truly sucky interface and all you are given is a device number.  */
struct block_device* open_by_devnum(dev_t dev, fmode_t mode)
/* Tries to open block device by device number. Use it ONLY if you really do not have anything better - i.e. when you are behind a truly sucky interface and all you are given is a device number.  */
struct block_device* open_by_devnum(dev_t dev, fmode_t mode)
{
	struct block_device *bdev = bdget(dev);
	int err = -ENOMEM;
	if (bdev)
		err = blkdev_get(bdev, mode);
	return err ? ERR_PTR(err) : bdev;
}