+<H4>Resize Handling</H4>
+<P>In YAFFS, soft deletion is ued for everything but resizing
+(shrinking) a file which has some particularly ugly cases that can
+complicate garbage collection.</P>
+<P>As mentioned before, we write a new ObjectHeader to indicate the
+shrinking. However, it is important that this ObjectHeader does not
+get destroyed (erased) before the data chunks that were discarded
+during the shrink are destroyed (erased). If this precaution is not
+taken then it is possible that the deleted chunks might be brought
+back to life.</P>
+<P>The modification to the garbage collector is as follows:</P>
+<UL>
+ <LI><P>The block info flags are expanded as follows:</P>
+ <LI><P>containsShrinkObjectHeader: Indicates that one or more of the
+ chunks in the block are object headers to indicate a file shrink.</P>
+ <LI><P>containsShrinkDataChunks: Indicates that one or more of the
+ chunks in the block are data chunks discarded by a file shrink.</P>
+</UL>
+<UL>
+ <LI><P>Before we allow a block with containsShrinkObjectHeader set
+ to be erased (garbage collected), we must first ensure that all the
+ earlier blocks (ie according to the block sequence number) that have
+ containsShrinkDataChunks set are erased (garbage collected) which
+ ensures that the shrunk data chunks are deleted. The mechanisms to
+ do this are as follows:</P>
+ <LI><P>If the garbage collector attempts to select a block with
+ containsShrinkObjectHeader set, we check that the above criterion in
+ met before selecting the block.</P>
+ <LI><P>Periodically select the oldest block with
+ containsShrinkDataChunks for garbage collection.</P>
+</UL>
+<P><BR><BR>
+</P>
+<P><BR><BR>
+</P>