]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
common: switch _get_{available,total}_space accounting to units of single bytes
authorAnthony Iliopoulos <ailiop@suse.com>
Wed, 29 Mar 2023 15:52:36 +0000 (17:52 +0200)
committerZorro Lang <zlang@kernel.org>
Thu, 6 Apr 2023 14:05:01 +0000 (22:05 +0800)
commitc91ff78d21f62ad3c54198df6d65234139cc3f4a
tree086f24d611e330253edca465cc5359d6a2a77e36
parentdc08f43f0fc91beba673d4aaa136d5122ae024f4
common: switch _get_{available,total}_space accounting to units of single bytes

xfs/220 relies on detecting free space changes after truncation of
single filesystem blocks, and this fails when the fs block size is 512b.

By default df is counting 1024b block units and as such is not reporting
any change in the number of available blocks after freeing just a 512b
block.

Switch the _get_available_space df reporting block size from units of
1024b blocks directly to single bytes in order to make free space
accounting fine-grained and independent of any fs block size
assumptions.

Do the same for _get_available_space, since there is no reason for
having an additional conversion step.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc