Re: [Yaffs] YAFFS2: Deletion files

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ross Younger
Date:  
To: yaffs
Subject: Re: [Yaffs] YAFFS2: Deletion files
On 18/07/12 16:27, S. K. wrote:
> How YAFFS2 manages the Deleted file until GC deletes them physically?
> How Does the logically deletion happen ?


There are quite a few edge cases, particularly in the case of hard
links, so I suggest you read the code for a full picture. It's in
yaffs_guts.c; look at yaffs_unlink_worker. (It's quite instructive to
follow through various calls from the high-level filesystem entrypoints
in yaffsfs.c.)

In short, a file is resized to size zero (so its data chunks will be
GCed), and it is moved so that it is in the "deleted" directory. This is
done through the regular filesystem operations so is written into the
filesystem log in the usual way. After that, the file's header and data
chunks no refer to a live file, so are free to be reclaimed by the GC at
some suitable point.

Ross