]> asedeno.scripts.mit.edu Git - linux.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)
commitc0abbb5791f1984350f1dac72c31c67010010a30
tree6d2c3a5c335517f57b25d512f35a1bdbb6dc27f2
parentb134d687dd9369bb2407a23c6ecc9e0a15d8bb20
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