public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Writing an mtd user module
@ 2002-09-08 16:26 adr
  2002-09-08 17:36 ` Jörn Engel
  0 siblings, 1 reply; 4+ messages in thread
From: adr @ 2002-09-08 16:26 UTC (permalink / raw)
  To: Mtd

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Writing an mtd user module
  2002-09-08 16:26 Writing an mtd user module adr
@ 2002-09-08 17:36 ` Jörn Engel
  2002-09-08 19:49   ` adr
  0 siblings, 1 reply; 4+ messages in thread
From: Jörn Engel @ 2002-09-08 17:36 UTC (permalink / raw)
  To: adr; +Cc: Mtd

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Writing an mtd user module
  2002-09-08 17:36 ` Jörn Engel
@ 2002-09-08 19:49   ` adr
  2002-09-09  7:35     ` David Woodhouse
  0 siblings, 1 reply; 4+ messages in thread
From: adr @ 2002-09-08 19:49 UTC (permalink / raw)
  To: Jörn Engel; +Cc: Mtd

On Sunday 08 Sep 2002 6:36 pm, Jörn Engel wrote:
> 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).
> >

>
> 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.
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Writing an mtd user module
  2002-09-08 19:49   ` adr
@ 2002-09-09  7:35     ` David Woodhouse
  0 siblings, 0 replies; 4+ messages in thread
From: David Woodhouse @ 2002-09-09  7:35 UTC (permalink / raw)
  To: adr; +Cc: Jörn Engel, Mtd

mtd@mcmen.demon.co.uk 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-09-09  7:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-08 16:26 Writing an mtd user module adr
2002-09-08 17:36 ` Jörn Engel
2002-09-08 19:49   ` adr
2002-09-09  7:35     ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox