On 01/22/2018 02:28 AM, Joerg Schilling wrote:
Since you need to reserve space on the background storage before you can even write to the cached data for a file, you need to make stat() return the related state that includes the reserved space.
The implementation that you suggest requires the file system to remember how much reserved space that it initially allocated to the file, even if that number changes as a result of file system reorganization. This can place an undue burden on more-advanced implementations. Also, it isn't what most users want: users want to know how much space the file is consuming now, not how much space it was consuming last week.
If you still don't understand this, I recommend you to try to write an in kernel filesystem implementation.... I did this 30 years ago.
There's no need for this kind of comment. Other contributors to this thread are competent, and it does not help matters for you to flash your credentials.