Skip to content
Snippets Groups Projects
  • James Simmons's avatar
    860e20e4
    LU-9325 obd: replace lprocfs_str_to_s64 · 860e20e4
    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: default avatarJames Simmons <uja.ornl@yahoo.com>
    Signed-off-by: default avatarMathias Rav <mathiasrav@gmail.com>
    Reviewed-on: https://review.whamcloud.com/30539
    
    
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: default avatarBen Evans <bevans@cray.com>
    Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
    860e20e4
    History
    LU-9325 obd: replace lprocfs_str_to_s64
    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: default avatarJames Simmons <uja.ornl@yahoo.com>
    Signed-off-by: default avatarMathias Rav <mathiasrav@gmail.com>
    Reviewed-on: https://review.whamcloud.com/30539
    
    
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: default avatarBen Evans <bevans@cray.com>
    Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>