Whamcloud - gitweb
LU-9325 obd: replace lprocfs_str_to_s64 39/30539/16
authorJames Simmons <uja.ornl@yahoo.com>
Fri, 9 Feb 2018 23:46:39 +0000 (18:46 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 3 Mar 2018 04:29:54 +0000 (04:29 +0000)
commit860e20e42ddc45bf5521cbd5f53d35a310b34ded
treeecf0f0995c45a120be54a7f84951b086362cb827
parentc98a51f2cebd3417956f5823a0531311e2895028
LU-9325 obd: replace lprocfs_str_to_s64

The original goal of lprocfs_str_to_s64[_with_units] was to allow
passing in values of different unit sizes i.e 64K to a proc file.
Their are a few problems with the implementation that prevents its
direct use with sysfs/debugfs. The first problem is that
lprocfs_str_to_s64() was used for a lot of cases where it doesn't
make sense to use it. Often it was used for bool values passing
in or after retrieving a value as signed 64 bit it ensures its in
range of some other unit size. For these cases we can simply move
to kstrtoXXX_from_user(). To handle the case of bool values we
add in supoort for kstrtobool_from_user().

Replace the lprocfs_rd_uint() and lprocfs_wr_uint() generic callbacks
with a simpler, more direct implementation of ldlm_rw_uint_fops.

There's a slight change in lustre debugfs write semantics: Using kstrtox
causes EINVAL when the written number is followed by other (garbage)
characters, whereas previously the garbage would be ignored and such a
write would succeed.

Linux-commit: 8b23093269c84b0da1201e1949c91d0beb9892ef

Change-Id: I39f0ba3dc72685fe6e29c7077f37ad4e69a20b4a
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Mathias Rav <mathiasrav@gmail.com>
Reviewed-on: https://review.whamcloud.com/30539
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
33 files changed:
contrib/scripts/spelling.txt
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/linux-misc.h
libcfs/libcfs/linux/linux-prim.c
lustre/fid/lproc_fid.c
lustre/include/lprocfs_status.h
lustre/include/lustre_lfsck.h
lustre/ldlm/ldlm_resource.c
lustre/lfsck/lfsck_lib.c
lustre/llite/lproc_llite.c
lustre/lod/lproc_lod.c
lustre/lov/lproc_lov.c
lustre/mdc/lproc_mdc.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_lproc.c
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lproc.c
lustre/mgs/mgs_nids.c
lustre/obdclass/lprocfs_jobstats.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/ofd/lproc_ofd.c
lustre/osc/lproc_osc.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_lproc.c
lustre/osp/lproc_osp.c
lustre/ptlrpc/gss/lproc_gss.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/quota/qmt_pool.c
lustre/quota/qsd_lib.c
lustre/target/tgt_grant.c