JFFS2: real free capacity of the partition

David Woodhouse dwmw2 at infradead.org
Fri Jul 11 13:32:50 EDT 2008


On Mon, 2008-07-07 at 20:15 +0400, Sergei Poselenov wrote:
> Seems I found why is that happens.
> In jffs2_statfs() the wasted_size is excluded
> from calculation:
> ...
>     avail = c->dirty_size + c->free_size;
> ...
> 
> Could someone explain for what reason?
> Have I understand it right - on the certain conditions, the
> wasted space can be converted to dirty space?

Wasted space is just the same as dirty space, really. The only
difference is that we don't expect it to be reclaimed by garbage
collection. The small spaces at the end of an eraseblock, for example,
are still likely to be there when we write a new eraseblock full of
data. There'll still be a small amount of wasted space at the end of the
new block.

That's why we treat 'wasted' space differently from dirty space --
otherwise the GC might just keep going for ever and ever, trying to
reclaim 'dirty' space but always not quite managing to reclaim as much
as it needs.

-- 
dwmw2




More information about the linux-mtd mailing list