[Yaffs] Yaffs memory full handling

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: 曾炫錡
Date:  
To: yaffs
Subject: [Yaffs] Yaffs memory full handling
Hi, I am developing YAFFS2 on ThreadX, in my application it need report
error
message for user when flash memory storage full, how could I detect this
error
by YAFFS service ? Is it suitable to check yaffs_freespace("mount_path")
before
yaffs_write such as:

fwrite(int fd, u8* buf, int size)
{
    if( size>yaffs_freespace("mount_path"))
       SetMemFullErr( );


yaffs_write(fd, (const void*)buf, size);
}

Best Regards,
Ski Tseng