From: Christoph Hellwig <hch@infradead.org>
To: Ravikiran G Thirumalai <kiran@in.ibm.com>
Cc: Andrew Morton <akpm@zip.com.au>,
linux-kernel@vger.kernel.org, dipankar@in.ibm.com
Subject: Re: [patch] Scalable statistics counters using seq_file interfaces
Date: Wed, 14 Aug 2002 19:37:02 +0100 [thread overview]
Message-ID: <20020814193702.A22887@infradead.org> (raw)
In-Reply-To: <20020814165049.I27366@in.ibm.com>; from kiran@in.ibm.com on Wed, Aug 14, 2002 at 04:50:49PM +0530
On Wed, Aug 14, 2002 at 04:50:49PM +0530, Ravikiran G Thirumalai wrote:
> Christoph, since statctr_pentry describes only a proc entry for a
> set of counters, I thought it'd be more descriptive to use
> statctr_proc_entry or statctr_pentry...something to indicate it is
> for proc reporting only.
My educated guess is that I will rewrite the code to not depend on procfs
before 2.6 is out.. But as you use other procfs types it's just one more
search and replace, so..
> diff -ruN -X dontdiff linux-2.5.31/fs/proc/root.c statctr-2.5.31/fs/proc/root.c
> --- linux-2.5.31/fs/proc/root.c Sun Aug 11 07:11:50 2002
> +++ statctr-2.5.31/fs/proc/root.c Tue Aug 13 10:14:46 2002
> @@ -19,6 +19,7 @@
> #include <linux/smp_lock.h>
>
> struct proc_dir_entry *proc_net, *proc_bus, *proc_root_fs, *proc_root_driver;
> +struct proc_dir_entry *proc_statistics;
>
> #ifdef CONFIG_SYSCTL
> struct proc_dir_entry *proc_sys_root;
> @@ -77,6 +78,7 @@
> proc_rtas_init();
> #endif
> proc_bus = proc_mkdir("bus", 0);
> + proc_statistics = proc_mkdir("statistics", 0);
Any reason you don't do this in kernel/statctr.c?
> +#ifndef _LINUX_STATCTR_H
> +#define _LINUX_STATCTR_H
> +
> +#ifdef __KERNEL__
Is this needed?
> +static inline struct statctr_pentry
> +*create_statctr_pentry(struct proc_dir_entry *parent, const char *name)
Shouldn't this be:
static inline struct statctr_pentry *
create_statctr_pentry(struct proc_dir_entry *parent, const char *name)
> +{
> + return(NULL);
> +}
return is not function-like and the additional braces are heavily disliked
in the kernel (at least for new code)
> +static inline int __statctr_init(statctr_t *stctr, int gfp_mask)
> +{
> + stctr->ctr = kmalloc_percpu(sizeof(*(stctr->ctr)), gfp_mask);
> + if(!stctr->ctr)
Kernel coding style has a space after the if.
> + return -1;
-ENOMEM?
> +void free_statctr_pentry(struct statctr_pentry *pentry)
> +{
> + if(!list_empty(&pentry->head))
Add an unlikely?
It might be worth to rework the code to follow Documentation/CodingStyle
next prev parent reply other threads:[~2002-08-14 18:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-14 11:20 [patch] Scalable statistics counters using seq_file interfaces Ravikiran G Thirumalai
2002-08-14 18:37 ` Christoph Hellwig [this message]
2002-08-16 13:18 ` Ravikiran G Thirumalai
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=20020814193702.A22887@infradead.org \
--to=hch@infradead.org \
--cc=akpm@zip.com.au \
--cc=dipankar@in.ibm.com \
--cc=kiran@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/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