Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752198AbbGNDwL (ORCPT ); Mon, 13 Jul 2015 23:52:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41501 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbbGNDwK (ORCPT ); Mon, 13 Jul 2015 23:52:10 -0400 Date: Mon, 13 Jul 2015 20:52:09 -0700 From: Greg Kroah-Hartman To: Oleg Drokin Cc: devel@driverdev.osuosl.org, Andreas Dilger , Linux Kernel Mailing List Subject: Re: [PATCH 18/20] staging/lustre/libcfs: get rid of debugfs/lnet/debug_mb Message-ID: <20150714035209.GB2199@kroah.com> References: <1436201338-14263-1-git-send-email-green@linuxhacker.ru> <1436201338-14263-19-git-send-email-green@linuxhacker.ru> <20150714024655.GA24863@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2916 Lines: 82 On Mon, Jul 13, 2015 at 10:51:00PM -0400, Oleg Drokin wrote: > > On Jul 13, 2015, at 10:46 PM, Greg Kroah-Hartman wrote: > > > On Mon, Jul 06, 2015 at 12:48:56PM -0400, green@linuxhacker.ru wrote: > >> From: Oleg Drokin > >> > >> It's just a fancy libcfs_debug_mb module parameter wrapper, > >> so just add debug buffer size check and resizing and the same > >> functionality now would be accessible via > >> /sys/module/libcfs/parameters/libcfs_debug_mb > >> > >> Also add a symlink for backwards compatibility. > >> > >> Signed-off-by: Oleg Drokin > >> --- > >> drivers/staging/lustre/lustre/libcfs/debug.c | 37 ++++++++++++++++++++++-- > >> drivers/staging/lustre/lustre/libcfs/module.c | 32 ++------------------ > >> drivers/staging/lustre/lustre/libcfs/tracefile.c | 12 -------- > >> drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 - > >> 4 files changed, 37 insertions(+), 45 deletions(-) > >> > >> diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c > >> index 5ae7b65..e4c7129 100644 > >> --- a/drivers/staging/lustre/lustre/libcfs/debug.c > >> +++ b/drivers/staging/lustre/lustre/libcfs/debug.c > >> @@ -57,8 +57,39 @@ module_param(libcfs_debug, int, 0644); > >> MODULE_PARM_DESC(libcfs_debug, "Lustre kernel debug mask"); > >> EXPORT_SYMBOL(libcfs_debug); > >> > >> +static int libcfs_param_debug_mb_set(const char *val, > >> + const struct kernel_param *kp) > >> +{ > >> + int rc; > >> + unsigned num; > >> + > >> + rc = kstrtouint(val, 0, &num); > >> + if (rc == -EINVAL) > >> + return -EINVAL; > >> + > >> + if (!*((unsigned int *)kp->arg)) { > >> + *((unsigned int *)kp->arg) = num; > >> + return 0; > >> + } > >> + > >> + rc = cfs_trace_set_debug_mb(num); > >> + > >> + if (!rc) > >> + *((unsigned int *)kp->arg) = cfs_trace_get_debug_mb(); > >> + > >> + return rc; > >> +} > >> + > >> +static struct kernel_param_ops param_ops_debugmb = { > >> + .set = libcfs_param_debug_mb_set, > >> + .get = param_get_uint, > >> +}; > >> + > >> +#define param_check_debugmb(name, p) \ > >> + __param_check(name, p, unsigned int) > >> + > >> static unsigned int libcfs_debug_mb; > >> -module_param(libcfs_debug_mb, uint, 0644); > >> +module_param(libcfs_debug_mb, debugmb, 0644); > > > > module_param wants a variable type as the second option, not a variable > > name, how is this working? > > debugmb IS the type, that I just declared above. > See all the param_ops_XXX and param_check_XXX thing? Ah, missed that, sorry, my fault. Ok, I see you resent this with a better comment, thanks for that, I'll go queue it up now. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/