Re: [Yaffs] Return value of yaffs_wr_file()

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Return value of yaffs_wr_file()

Sebastian

It looks like you are trying to use the yaffs guts functions without the
normal path of using yaffs direct. That is workable, but this interface is an
internal one and is more likely to change.

For a good idea on how to wrap the function and get good ENOSPC handling, have
a look at the yaffs2/direct/yaffsfs.c file.

Now to answer your specific questions:

> what does a return value of 0 from yaffs_wr_file() mean?


> Does this mean
> that there was no free space remaining on the device containing the file
> (ENOSPC)?


It means there is no more space on the device to accept data.

> If I delete enough content on this device will I be able to write
> again?


Yes

> Do I have to trigger some garbage collection to make free space?


No.

Garbage collection is performed by calling yaffs_wr_file() and other functions
at an equivalent layer. Once you make some space, yaffs_wr_file() will sort
things out in subsequent writes.

-- Charles