public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Dominik Brodowski <linux@dominikbrodowski.de>, Greg KH <greg@kroah.com>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] [PATCH 1/2] export module parameters in sysfs for modules _and_ built-in code
Date: Mon, 02 Aug 2004 15:59:57 +1000	[thread overview]
Message-ID: <1091426395.430.13.camel@bach> (raw)
In-Reply-To: <20040801165407.GA8667@dominikbrodowski.de>

On Mon, 2004-08-02 at 02:54, Dominik Brodowski wrote:
> Create a new /sys top-level directory named "parameters", and make all
> to-be-sysfs-exported module parameters available as attributes to kobjects.
> Currently, only module parameters in _modules_ are exported in /sys/modules/,
> while those of "modules" built into the kernel can be set by the kernel command 
> line, but not read or set via sysfs.

Thanks for this Dominik!

One question from reading the code:


> diff -ruN linux-original/kernel/module.c linux/kernel/module.c
> --- linux-original/kernel/module.c	2004-08-01 18:40:25.939948264 +0200
> +++ linux/kernel/module.c	2004-08-01 18:39:01.097846224 +0200
> @@ -1131,6 +1131,12 @@
>  };
>  static decl_subsys(module, &module_ktype, NULL);
>  
> +extern int module_param_sysfs_setup(struct module *mod, 
> +				    struct kernel_param *kparam,
> +				    unsigned int num_params);
> +
> +extern void module_param_sysfs_remove(struct module *mod);

Put these in moduleparam.h please, otherwise AKPM will kill us both.

> +	kbuild_modname = kmalloc(sizeof(char) * (MAX_KBUILD_MODNAME + 1), GFP_KERNEL);
> +	if (!kbuild_modname)
> +		return -ENOMEM;
> +	memset(kbuild_modname, 0, sizeof(char) * (MAX_KBUILD_MODNAME + 1));

...

> +	kfree (kbuild_modname);

I would have thought this a good candidate for a stack variable?

> +/* Needs to be before __initcall(module_init) */
> +fs_initcall(param_sysfs_init);

That's horrible.  And I think the initcall in module.c should be removed
in your second patch, no?

Rusty,
-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


  reply	other threads:[~2004-08-02  6:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-01 16:54 [RFC] [PATCH 1/2] export module parameters in sysfs for modules _and_ built-in code Dominik Brodowski
2004-08-02  5:59 ` Rusty Russell [this message]
2004-08-02 21:47   ` [UPDATED PATCH " Dominik Brodowski
2004-08-03  0:27     ` Rusty Russell
2004-08-13 17:08     ` Patrick Mansfield
2004-08-18 19:55     ` Martin Schlemmer
2004-08-20 13:46       ` Tonnerre
2004-08-29 13:14       ` Dominik Brodowski
2004-08-29 13:49         ` [UPDATED PATCH 1/2] export module parameters in sysfs for modules _and_ built-in code [u] Martin Schlemmer [c]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1091426395.430.13.camel@bach \
    --to=rusty@rustcorp.com.au \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox