Re: cramfs and mtd

David Woodhouse
2001-04-19T11:34:31Z

bjorn.wesen@axis.com said:
> When using cramfs directly on a ROM chip like below.. can we make
> cramfs/inode.c talk to mtd to find a chip maybe instead of using
> direct pointers like I do in my small patch below ? That is, would it
> mess up inode.c to the degree that it would not be accepted in the
> mainline kernel ? :) Or is there a better way to do this ?

See the evil hack in jffs and jffs2 which uses the minor number of the
mtdblock device to get a handle on the underlying MTD device. Copy that and
then use the MTD device directly for read/write.

The real advantage of cramfs-on-mtd comes when you can set
CONFIG_BLK_DEV=n, though - which means the above evil hack is no longer
possible. We need to remove FS_REQUIRES_DEV from JFFS{,2} and pass the name
or number of the MTD device as a mount option instead. If you're doing the
same thing for cramfs, it's probably better to copy the cramfs code to a
new filesystem (cmtdfs?) and hack it there.

There are also vague plans to provide an 'xipfs', which has page-aligned
data, for the benefit of those with more flash space than sense.

--
dwmw2