Message ID | 20200410012059.27210-1-cgxu519@mykernel.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] common: add a helper for setting module param | expand |
On Fri, Apr 10, 2020 at 09:20:58AM +0800, Chengguang Xu wrote: > Add a new helper _set_fs_module_param for setting > module param. > > Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> I think this could go with the test, so a single patch introduces both test case and the needed helper functions, and usually that's easier to review, as we could know how the helper be used from the context. Thanks, Eryu > --- > common/module | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/common/module b/common/module > index 39e4e793..148e8c8f 100644 > --- a/common/module > +++ b/common/module > @@ -81,3 +81,12 @@ _get_fs_module_param() > { > cat /sys/module/${FSTYP}/parameters/${1} 2>/dev/null > } > + # Set the value of a filesystem module parameter > + # at /sys/module/$FSTYP/parameters/$PARAM > + # > + # Usage example: > + # _set_fs_module_param param value > + _set_fs_module_param() > +{ > + echo ${2} > /sys/module/${FSTYP}/parameters/${1} 2>/dev/null > +} > -- > 2.20.1 > >
---- 在 星期日, 2020-04-12 19:20:34 Eryu Guan <guan@eryu.me> 撰写 ---- > On Fri, Apr 10, 2020 at 09:20:58AM +0800, Chengguang Xu wrote: > > Add a new helper _set_fs_module_param for setting > > module param. > > > > Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> > > I think this could go with the test, so a single patch introduces both > test case and the needed helper functions, and usually that's easier to > review, as we could know how the helper be used from the context. > Hi Eryu, OK, I'll put it into test patch in V2. Thanks, cgxu
diff --git a/common/module b/common/module index 39e4e793..148e8c8f 100644 --- a/common/module +++ b/common/module @@ -81,3 +81,12 @@ _get_fs_module_param() { cat /sys/module/${FSTYP}/parameters/${1} 2>/dev/null } + # Set the value of a filesystem module parameter + # at /sys/module/$FSTYP/parameters/$PARAM + # + # Usage example: + # _set_fs_module_param param value + _set_fs_module_param() +{ + echo ${2} > /sys/module/${FSTYP}/parameters/${1} 2>/dev/null +}
Add a new helper _set_fs_module_param for setting module param. Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> --- common/module | 9 +++++++++ 1 file changed, 9 insertions(+)