[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: garbage collect



On Wed, 28 Jun 2000, Jason Gunthorpe wrote:
> > The location and extent of the partition is given in the partition table
> > (elsewhere)
> 
> Well, we don't have any partitioning ability in the MTD stuff yet.

That's what you need if you want partitions! :)

In our system, the different partitions show up as /dev/flash0,
/dev/flash1 etc. You can mount a different filesystem on any of them - the
partitioning has nothing to do with the filesystem or data in the sectors.
I think that's the cleanest way. After all, on a harddisk, partitioning
information is orthogonal to filesystem information.

> If all the nodes have a sector header that has the flash 'partition'
> geometry then it does help. 

That's like splitting the flash into "mini harddisks" of a sector in size
and having a tiny partition-table in each sector. You could do that but it
does not map nicely into the device/filesystem split-up.

I agree that a sector-header can have filesystem information. But I
disagree with that the filesystem (and thus sector-headers) should have
anything whatsoever to do with the entire flash-chip's partitioning.

> > > How do you locate the spare sector if you don't have any sector headers?
> > 
> > With the ptable. The sectors should not need to know about how they
> > themselves are grouped.
> 
> Er, I mean at all. What seperates the spare block from the others?

I think you lost me here - what is a "spare block" ?

JFFS considers any block inside the filesystem area not containing any
valid nodes to be spare (and thus erasable, if not already erased).

> > If you want to dedicate the entire flash to the flash filesystem, you can
> > just hardcode in the driver that the partition spans the entire flash of
> > course.
> 
> Yuk.

That is the normal way of accessing an entire physical device. Same thing
with /dev/hda as opposed to the partitioned entries /dev/hda1, /dev/hda2
etc. You can always access /dev/hda directly and treat it as a huge
block-device (that's what it physically is of course). Same thing with a
flash-chip. If you don't need any extra data except for the filesystem
itself, just use /dev/flash or whatever you might call it and make the
driver map it onto the entire flash-chip.

-Bjorn