[Yaffs] How do you find the end of YAFFS data?

Top Page
Attachments:
Message as email
+ (text/plain)
+ readyaffs.c (application/octet-stream)
Delete this message
Reply to this message
Author: David Wuertele
Date:  
To: yaffs
Subject: [Yaffs] How do you find the end of YAFFS data?
I've written a program called "readyaffs" (see attached) --- well,
"written" is a little strong, basically I just copied mkyaffs.c over
to readyaffs.c and changed the reads to writes and the writes to
reads, and voila I have a system for taking a snapshot of a YAFFS
filesystem:

     readyaffs /dev/mtd/2 > yaffs.dump


verified that I can then reload this dump onto a different filesystem
elsewhere:

     mkyaffs /dev/mtd/2 yaffs.dump


My problem is that yaffs.dump is huge --- it is the same size as the
whole partition. But I know my data doesn't fill that partition. Is
there an easy way to discover where the end of the data is, and
truncate yaffs.dump to only be that long?

Thanks,
Dave