Whamcloud - gitweb
LU-18163 obdclass: add sysfs_memparse_total() string helper
Add sysfs_memparse_total() to parse '%' unit. The size returned is
computed based on a total size argument.
If the parsed size exceeds the total value (> 100% of total size),
the function returns -ERANGE.
The following string format are accepted: "1.0%", "0.1%", ".1%"
It adds some unit tests for sysfs_memparse_total()
in obd_init_checks().
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: Ic9390f2dbb64f0c2ca8756e78ba4100346e08f3f
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56334
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>