Whamcloud - gitweb
LU-18163 obdclass: add sysfs_memparse_total() string helper 34/56334/3
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Wed, 11 Sep 2024 18:31:37 +0000 (20:31 +0200)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2024 08:12:13 +0000 (08:12 +0000)
commitf62e51414712e1df6070f71b3d65933109c6252e
tree676481834a001e782738183cee0339bdfb071a46
parent4c72e3df768a38139562e8c519cca2a8c3da940c
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>
lustre/include/lprocfs_status.h
lustre/llite/lproc_llite.c
lustre/lod/lproc_lod.c
lustre/obdclass/class_obd.c
lustre/obdclass/lprocfs_status.c