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: yaffs
Subject: Re: [Yaffs] How to delete a file or dir for yaffs2?
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