Whamcloud - gitweb
LU-11721 utils: print used inodes ratio when using "lfs df -i" 36/34136/2
authorNikitas Angelinas <nangelinas@cray.com>
Thu, 29 Nov 2018 23:23:05 +0000 (15:23 -0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 19 Mar 2019 06:00:33 +0000 (06:00 +0000)
commit52a9419f7afaa31f8db922526ca78ef08d909ed4
tree694ea3e5536c84082b2d3e4735088f280ac5f079
parentb426c169590b3401ecad2ea744164812ee1ef934
LU-11721 utils: print used inodes ratio when using "lfs df -i"

"lfs df -i" prints the used blocks percentage, instead of the used
inodes percentage. Fix this by allowing obd_statfs_ratio() to
distinguish when "-i" is used.

Round up the ratio returned from obd_statfs_ratio() in a ceiling
manner, to match the output of df(1). Add a sanity test to check
that the outputs from df(1) and lfs df match.

Lustre-commit: 757403191c37db75ed35b02c971846dced5d5119
Lustre-change: https://review.whamcloud.com/33758

Signed-off-by: Nikitas Angelinas <nangelinas@cray.com>
Cray-bug-id: LUS-6748
Test-Parameters: trivial
Change-Id: I0b31ecb7371875c93bc07dda1f1c89e04d5b4576
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34136
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity.sh
lustre/utils/lfs.c