-
James Simmons authored
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>
James Simmons authoredThe 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>