[PATCH 2/3] ubifs: add ubifs_mount_fixup_lebs()

Matthew L. Creech mlcreech at gmail.com
Thu May 5 16:36:46 EDT 2011


On Thu, May 5, 2011 at 7:49 AM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
>
> The area which go _fefore_ the main are are special case.
>
> The lprops area are LEBs from number c->lpt_first to number c->lpt_last.
> For those you need to look at the ltab:
>
> c->ltab[lnum - c->lpt_first].free is what you need, where lnum is the
> LEB number you need the amount of free space for.
>
> For the orphans area [c->orph_first, c->orph_last] - you may to just
> unmap them all, because when after mount this area does not contain any
> useful data.
>
> Master area - LEBs UBIFS_MST_LNUM and UBIFS_MST_LNUM + 1 - you know the
> free space start at c->mst_offs + c->mst_node_alsz. So the amount of
> used space there is c->mst_offs + c->mst_node_alsz and free space is
> c->leb_size - c->mst_offs - c->mst_node_alsz; And it is the same for
> both master area LEBs.
>
> And finally the SB area (1 LEB) - you can skip this, but for
> consistency, you can also fix it up. Amount of used space there is
> always UBIFS_SB_NODE_SZ.
>

OK, I've separated these out in the v3 patch.  I also ignored the log
LEBs, since you didn't mention those, and I wasn't sure how to handle
them - are they OK to leave alone?  Or could they cause similar
problems if not cleaned up?

-- 
Matthew L. Creech



More information about the linux-mtd mailing list