Re: [Yaffs] How to delete a file or dir for yaffs2?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yy xuye, yaffs
Subject: Re: [Yaffs] How to delete a file or dir for yaffs2?
On Wednesday 01 June 2011 14:05:18 yy xuye wrote:
> > If the last entry for the object is a deletion record then we know the
>
> file was deleted.
>
> So we'll find "file2" then "deleted" then "file1", but not "deleted" then
> "file2" then "file1", right?
> BR.


If a file has been deleted then last entry for that file in the log will be
the deletion record. Since yaffs2 scans backwards, that will be the first
entry encountered. The scanning will thus know that this file is deleted and
further data or object headers associated with that file can be ignored.

>
> On Wed, Jun 1, 2011 at 9:31 AM, Charles Manning

<>wrote:
> > On Wednesday 01 June 2011 13:10:20 yy xuye wrote:
> > > Dear all,
> > > I read the file "HowYaffs works", but there is a detail description
> > > about this.
> > > For example, i create a file with object id 0x46d, then i delete it.
> > > Now it will add object named "deleted" with object id 0x46d parent id 3
> > > or 4, right?
> >
> > Yes.
> >
> > > Will it reallocate the object id 0x46d to a new object later?
> >
> > It will only reuse that object Id once the old file has been deleted.
> > This might change in the future.
> >
> > > If so, when scanning the flash data, how to judge the new file with obj
> > > id=0x46d is deleted or not?
> >
> > Since yaffs is log structured we know the order in which things happened.
> > yaffs scans backwards in time so the last thing that happened is scanned
> > first. If the last entry for the object is a deletion record then we know
> > the
> > file was deleted.
> >
> > In the future object Ids might be reused, but then we would see a history
> > that
> > shows the new file info after the old file info so it can be told apart.
> >
> > -- Charles
> >
> >
> >
> > _______________________________________________
> > yaffs mailing list
> >
> > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs