public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Changing the number of JFFS2 erasblocks?
@ 2004-04-08 12:38 Steven Scholz
  2004-04-08 12:54 ` Steven Scholz
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Scholz @ 2004-04-08 12:38 UTC (permalink / raw)
  To: MTD

Hi there,

I have 320KB of unused flash in our embedded systems. Now I want to make use 
of them using an read/write filesystem by updating the kernel.

Since it's flash I need some fs that's aware of the flash wearing problem. 
So I guess that leaves only JFFS2.

My problem is that the 5 erase blocks set by default will eat up the whole 
320KB and leaves no free space. And IIRC there's no way to pass the number 
of eraseblocks during mount.

Could I hardcode the number of eraseblocks to 1 in my new (but still old 
2.4.20) kernel? Where is it defined?
And what happens to my root fs which is JFFS2 when I change that?

Thanks a million,

Steven

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

* Re: Changing the number of JFFS2 erasblocks?
  2004-04-08 12:38 Changing the number of JFFS2 erasblocks? Steven Scholz
@ 2004-04-08 12:54 ` Steven Scholz
  2004-04-08 12:58   ` Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Scholz @ 2004-04-08 12:54 UTC (permalink / raw)
  Cc: MTD

Steven Scholz wrote:

> Hi there,
> 
> I have 320KB of unused flash in our embedded systems. Now I want to make 
> use of them using an read/write filesystem by updating the kernel.
> 
> Since it's flash I need some fs that's aware of the flash wearing 
> problem. So I guess that leaves only JFFS2.
> 
> My problem is that the 5 erase blocks set by default will eat up the 
> whole 320KB and leaves no free space. And IIRC there's no way to pass 
> the number of eraseblocks during mount.
> 
> Could I hardcode the number of eraseblocks to 1 in my new (but still old 
> 2.4.20) kernel? Where is it defined?
> And what happens to my root fs which is JFFS2 when I change that?


Is it enough and ok to just change the

/* Number of free blocks there must be before we... */
#define JFFS2_RESERVED_BLOCKS_BASE 3

in fs/jffs2/nodelist.h ???

Steven

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

* Re: Changing the number of JFFS2 erasblocks?
  2004-04-08 12:54 ` Steven Scholz
@ 2004-04-08 12:58   ` Thomas Gleixner
  2004-04-08 13:10     ` Steven Scholz
  2004-04-08 14:45     ` Jörn Engel
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Gleixner @ 2004-04-08 12:58 UTC (permalink / raw)
  To: Steven Scholz; +Cc: MTD

On Thursday 08 April 2004 14:54, Steven Scholz wrote:
> Steven Scholz wrote:
> > Hi there,
> >
> > I have 320KB of unused flash in our embedded systems. Now I want to make
> > use of them using an read/write filesystem by updating the kernel.
> >
> > Since it's flash I need some fs that's aware of the flash wearing
> > problem. So I guess that leaves only JFFS2.
> >
> > My problem is that the 5 erase blocks set by default will eat up the
> > whole 320KB and leaves no free space. And IIRC there's no way to pass
> > the number of eraseblocks during mount.
> >
> > Could I hardcode the number of eraseblocks to 1 in my new (but still old
> > 2.4.20) kernel? Where is it defined?
> > And what happens to my root fs which is JFFS2 when I change that?
>
> Is it enough and ok to just change the
>
> /* Number of free blocks there must be before we... */
> #define JFFS2_RESERVED_BLOCKS_BASE 3

You can do this, but it will break and it will break your root jffs2 too, as 
there is no way to have this per partition. This all is related to garbage 
collection and the neccecarity to have spare blocks for writing / deleting 
/modifying files. In a read only fs this would not hurt.

320K is not really useful for a filesystem IMHO. 
What do you want to do with it ?

-- 
Thomas
________________________________________________________________________
"Free software" is a matter of liberty, not price. To understand the concept,
you should think of "free" as in "free speech,'' not as in "free beer".
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

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

* Re: Changing the number of JFFS2 erasblocks?
  2004-04-08 12:58   ` Thomas Gleixner
@ 2004-04-08 13:10     ` Steven Scholz
  2004-04-08 13:19       ` Thomas Gleixner
  2004-04-08 14:45     ` Jörn Engel
  1 sibling, 1 reply; 7+ messages in thread
From: Steven Scholz @ 2004-04-08 13:10 UTC (permalink / raw)
  Cc: MTD

Thomas Gleixner wrote:

>>>Could I hardcode the number of eraseblocks to 1 in my new (but still old
>>>2.4.20) kernel? Where is it defined?
>>>And what happens to my root fs which is JFFS2 when I change that?
>>
>>Is it enough and ok to just change the
>>
>>/* Number of free blocks there must be before we... */
>>#define JFFS2_RESERVED_BLOCKS_BASE 3
> 
> You can do this, but it will break and it will break your root jffs2 too, as 
> there is no way to have this per partition...
:-(

> 320K is not really useful for a filesystem IMHO. 
> What do you want to do with it ?

We need some place to store a few configuration files (ca. 50KB compressed 
each) for our application. These 320KB are unused so I thought we could use 
it for this dedicated purpose instead of wasting space (and poluting) on our 
root fs...

Steven

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

* Re: Changing the number of JFFS2 erasblocks?
  2004-04-08 13:10     ` Steven Scholz
@ 2004-04-08 13:19       ` Thomas Gleixner
  2004-04-08 16:45         ` Steven Scholz
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2004-04-08 13:19 UTC (permalink / raw)
  To: Steven Scholz; +Cc: MTD

On Thursday 08 April 2004 15:10, Steven Scholz wrote:
>
> We need some place to store a few configuration files (ca. 50KB compressed
> each) for our application. These 320KB are unused so I thought we could use
> it for this dedicated purpose instead of wasting space (and poluting) on
> our root fs...
>
Is this data which changes a lot ? Do you really need a r/w filesystem ?

-- 
Thomas
________________________________________________________________________
"Free software" is a matter of liberty, not price. To understand the concept,
you should think of "free" as in "free speech,'' not as in "free beer".
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

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

* Re: Changing the number of JFFS2 erasblocks?
  2004-04-08 12:58   ` Thomas Gleixner
  2004-04-08 13:10     ` Steven Scholz
@ 2004-04-08 14:45     ` Jörn Engel
  1 sibling, 0 replies; 7+ messages in thread
From: Jörn Engel @ 2004-04-08 14:45 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: MTD, Steven Scholz

On Thu, 8 April 2004 14:58:56 +0200, Thomas Gleixner wrote:
> 
> You can do this, but it will break and it will break your root jffs2 too, as 
> there is no way to have this per partition. This all is related to garbage 
> collection and the neccecarity to have spare blocks for writing / deleting 
> /modifying files. In a read only fs this would not hurt.
> 
> 320K is not really useful for a filesystem IMHO. 
> What do you want to do with it ?

Here we go again...

2 Eraseblocks (in words: two) are enough to put a jffs2 filesystem on
it.  One eraseblock plus a few bytes have to be reserved for garbage
collection, but not two, much less five.

Jffs2 should:
- Switch from free blocks to free bytes.
- Make this per-mountpoint.
- Make the numbers depend on number and size of erase blocks.

Maybe I will even do this one day, but not before Redhat lawyers and
myself sort out some things.  Don't tell me "Show me the code.", since
it wouldn't get included anyway.

Jörn

-- 
Don't patch bad code, rewrite it.
-- Kernigham and Pike, according to Rusty

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

* Re: Changing the number of JFFS2 erasblocks?
  2004-04-08 13:19       ` Thomas Gleixner
@ 2004-04-08 16:45         ` Steven Scholz
  0 siblings, 0 replies; 7+ messages in thread
From: Steven Scholz @ 2004-04-08 16:45 UTC (permalink / raw)
  Cc: MTD

Thomas Gleixner wrote:

> On Thursday 08 April 2004 15:10, Steven Scholz wrote:
> 
>>We need some place to store a few configuration files (ca. 50KB compressed
>>each) for our application. These 320KB are unused so I thought we could use
>>it for this dedicated purpose instead of wasting space (and poluting) on
>>our root fs...
>>
> 
> Is this data which changes a lot ? Do you really need a r/w filesystem ?

I assumed we'll store up to 5 files. And change them at maximum once 
everyday. But this might be worst case. Maybe we (our costumers) change them 
once a week...

I think I need a r/w filesystem because we need easy random access. CRAMFS 
or ramdisk is no option.

-- 
Steven Scholz

imc Measurement & Control               imc Meßsysteme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland

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

end of thread, other threads:[~2004-04-08 16:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-08 12:38 Changing the number of JFFS2 erasblocks? Steven Scholz
2004-04-08 12:54 ` Steven Scholz
2004-04-08 12:58   ` Thomas Gleixner
2004-04-08 13:10     ` Steven Scholz
2004-04-08 13:19       ` Thomas Gleixner
2004-04-08 16:45         ` Steven Scholz
2004-04-08 14:45     ` Jörn Engel

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