Hello
I think this is no need, just "return (n_free_chunks > 0) ? 1 : 0;" is OK.
if not , we can not overwrite a file with an existent file
when the chunk was less than 20.
What do you think ?
Thanks you
Regards
chenjie
On 2015/7/31 6:13, Charles Manning wrote:
> The purpose of yaffs_hold_space() is to support the write_begin VFS method.
>
> write_begin asks the file system to commit enough space to do the actual write in write_end.
>
> Strictly speaking this should really be handled with counter of committed space that is incremented on every write_begin and decremented on every write_end.
>
> However, it is workable to just not expect there to be more than n writes in progress at a time. n=20 seems rather conservative.
>
> -- Charles
>
>
> On Thu, Jul 30, 2015 at 3:04 PM, chenjie <chenjie6@huawei.com <mailto:chenjie6@huawei.com>> wrote:
>
>
> Hi:
> why the yaffs_hold_space reserved 20 chunk?
> return (n_free_chunks > 20) ? 1 : 0;
>
>
>
>