]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Calculate i_blocks based on file size
authorMarc Dionne <marc.dionne@auristor.com>
Thu, 25 Apr 2019 15:04:37 +0000 (12:04 -0300)
committerDavid Howells <dhowells@redhat.com>
Tue, 7 May 2019 15:48:44 +0000 (16:48 +0100)
commitbea1d7f295ad132b88cfb9e2096cf5f84f91c98b
tree6d2c3a5c335517f57b25d512f35a1bdbb6dc27f2
parent667ba0bf2cba17fa963ce4972cd063e693447a91
afs: Calculate i_blocks based on file size

While it's not possible to give an accurate number for the blocks
used on the server, populate i_blocks based on the file size so
that 'du' can give a reasonable estimate.

The value is rounded up to 1K granularity, for consistency with
what other AFS clients report, and the servers' 1K usage quota
unit.  Note that the value calculated by 'du' at the root of a
volume can still be slightly lower than the quota usage on the
server, as 0-length files are charged 1 quota block, but are
reported as occupying 0 blocks.  Again, this is consistent with
other AFS clients.

Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/inode.c