Writing an mtd user module
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(¬ifier); 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?
Quoted 5 lines · adr
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).
Quoted 8 lines
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(¬ifier); 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
Signature · 3 lines
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
Quoted 15 lines · Jörn Engel
Quoted 5 lines · adr
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).
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.
Quoted 4 lines
Now, for an fs, you only need one device, known from mount to umount, so
register_mtd_user()is pointless for that purpose.Jrn
I'm not sure I fully understand this :-<
What was wrong, the documentation on the websiste or my interpretation of it? Am I to take it the notification functions are irrelevant except when devfs is being used?
Adrian
Quoted 3 lines · [email protected] said:
What was wrong, the documentation on the websiste or my
interpretation of it? Am I to take it the notification functions are irrelevant except when devfs is being used?
The notification functions are irrelevant if you don't want to be notified when new devices are added or when devices go away.
In the case of the mtdblock device, yes that means they're irrelevant when devfs is not used. Only in the case where devfs is used do you need to do anything (change contents of /dev/mtdblock/) on addition/removal of devices.
You probably want something like JFFS2's read_super() or get_sb() functions to allow you to mount a single device.
--
dwmw2