On 01/08/2018 08:06 AM, Joerg Schilling wrote:
blkcnt_t st_blocks Number of blocks allocated for this object.
I hope I do not need to explain the term "allocated".
I'm afraid that you do need to explain "allocated". Suppose, for
example, two files are clones: they have different inode numbers and are
different files from the POSIX point of view, but they have the same
contents and only one copy exists at the lower level. How many blocks
are "allocated" for each file?
The whole idea of "allocated" is not explained in the POSIX standard,
and it's up to each implementation to decide what it means. For example,
an implementation is perfectly free to spontaneously "allocate" one more
block for a file, as far as POSIX is concerned. I haven't yet seen any
reason why the behavior described for btrs fails to conform to POSIX.