From: Tejun Heo <tj@home-tj.org>
To: greg@kroah.com, rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.10-rc2 2/4] module sysfs: expand module_attribute methods
Date: Tue, 23 Nov 2004 11:47:52 +0900 [thread overview]
Message-ID: <20041123024752.GC7326@home-tj.org> (raw)
In-Reply-To: <20041123024537.GA7326@home-tj.org>
On Tue, Nov 23, 2004 at 11:45:37AM +0900, Tejun Heo wrote:
> 02_module_attribute_extension.patch
> Modify module_attribute show/store methods to accept self
> argument to enable further extensions.
Signed-off-by: Tejun Heo <tj@home-tj.org>
Index: linux-export/include/linux/module.h
===================================================================
--- linux-export.orig/include/linux/module.h 2004-11-23 11:31:32.000000000 +0900
+++ linux-export/include/linux/module.h 2004-11-23 11:32:13.000000000 +0900
@@ -48,8 +48,9 @@ struct module;
struct module_attribute {
struct attribute attr;
- ssize_t (*show)(struct module *, char *);
- ssize_t (*store)(struct module *, const char *, size_t count);
+ ssize_t (*show)(struct module_attribute *, struct module *, char *);
+ ssize_t (*store)(struct module_attribute *, struct module *,
+ const char *, size_t count);
};
struct module_kobject
Index: linux-export/kernel/module.c
===================================================================
--- linux-export.orig/kernel/module.c 2004-11-23 11:31:32.000000000 +0900
+++ linux-export/kernel/module.c 2004-11-23 11:32:13.000000000 +0900
@@ -651,7 +651,8 @@ void symbol_put_addr(void *addr)
}
EXPORT_SYMBOL_GPL(symbol_put_addr);
-static ssize_t show_refcnt(struct module *mod, char *buffer)
+static ssize_t show_refcnt(struct module_attribute *mattr,
+ struct module *mod, char *buffer)
{
/* sysfs holds a reference */
return sprintf(buffer, "%u\n", module_refcount(mod)-1);
Index: linux-export/kernel/params.c
===================================================================
--- linux-export.orig/kernel/params.c 2004-11-23 11:31:32.000000000 +0900
+++ linux-export/kernel/params.c 2004-11-23 11:32:13.000000000 +0900
@@ -691,7 +691,7 @@ static ssize_t module_attr_show(struct k
if (!try_module_get(mk->mod))
return -ENODEV;
- ret = attribute->show(mk->mod, buf);
+ ret = attribute->show(attribute, mk->mod, buf);
module_put(mk->mod);
next prev parent reply other threads:[~2004-11-23 3:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-23 2:45 [PATCH 2.6.10-rc2 0/4] module sysfs: module sysfs related clean ups Tejun Heo
2004-11-23 2:46 ` [PATCH 2.6.10-rc2 1/4] module sysfs: make module.mkobj inline Tejun Heo
2004-11-23 2:47 ` Tejun Heo [this message]
2004-11-23 3:04 ` [PATCH 2.6.10-rc2 3/4] module sysfs: sections attr reimplemented using attr group Tejun Heo
2004-11-23 3:05 ` [PATCH 2.6.10-rc2 4/4] module sysfs: module parameters " Tejun Heo
2004-11-23 3:58 ` [PATCH 2.6.10-rc2 0/4] module sysfs: module sysfs related clean ups Rusty Russell
2004-11-23 4:31 ` Greg KH
2004-11-23 5:25 ` Rusty Russell
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=20041123024752.GC7326@home-tj.org \
--to=tj@home-tj.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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
all inboxes | Powered by JetHome®