brad@ltc.com said:> have maintained, on and off, a patch to crafms that supports> traditional cramfs decompress-and-read/run-from-RAM, plus direct> mmaping with no decompression and read/run straight out of ROM:

Cute, but not very generic. The approach I was contemplating was to allocate a set of 'struct page's for the pages containing XIP data, then add those pages to the page cache manually on read_inode().

It's a shame that ->readpage() doesn't get to say 'actually I used my own page for that, I didn't want one allocated for me'.

Extending the MTD API to return a set of pages representing a particulardevice, and handling the locking so that we don't try to write to the chipswhile pages are mapped, will also be necessary if we want to do it withflash chips that are used for anything else.