Writing an mtd user module

Jörn Engel joern at wohnheim.fh-wedel.de
Sun Sep 8 13:36:35 EDT 2002


On Sun, 8 September 2002 17:26:50 +0100, adr wrote:
> Having written a driver module for the Dreamcast flash cartridge/vmu, I am now 
> attempting to write a user module that works with the default fs on the 
> Dreamcast flash (see http://mc.pp.se/dc/vms/flashmem.html if you are 
> interested in knowing more about that).
> 
> Anyway, I am struggling with the documentaion (which, as I found with the 
> driver was way out of date) and the code.
> 
> Looking at the mtdblock driver, register_mtd_user(&notifier); only seems to 
> get called when devfs is being used, yet the documentation implies it should 
> be called every time.
> 
> What have I missed here?

The block devices don't need to be notified of any changes, devfs
does. When you "ls /dev/mtdblock", you want to see all the devices
currently registered.
To reach that goal, on 'insmod slram something", which creates a new
device, mtdblock has to be notified of the change in order to change
the devfs entries.

Now, for an fs, you only need one device, known from mount to umount,
so register_mtd_user() is pointless for that purpose.

Jörn

-- 
Measure. Don't tune for speed until you've measured, and even then
don't unless one part of the code overwhelms the rest.
-- Rob Pike




More information about the linux-mtd mailing list