]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sunrpc/stats.c
[PATCH] remove many unneeded #includes of sched.h
[linux-2.6-omap-h63xx.git] / net / sunrpc / stats.c
index 790941e8af4daf6b77d6c549d6cba2c11c7d44ac..74ba7d443dfc06ec7162c2d7b1735bc2bfc67e06 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/sunrpc/clnt.h>
@@ -66,7 +65,7 @@ static int rpc_proc_open(struct inode *inode, struct file *file)
        return single_open(file, rpc_proc_show, PDE(inode)->data);
 }
 
-static struct file_operations rpc_proc_fops = {
+static const struct file_operations rpc_proc_fops = {
        .owner = THIS_MODULE,
        .open = rpc_proc_open,
        .read  = seq_read,
@@ -114,13 +113,8 @@ void svc_seq_show(struct seq_file *seq, const struct svc_stat *statp) {
  */
 struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt)
 {
-       unsigned int ops = clnt->cl_maxproc;
-       size_t size = ops * sizeof(struct rpc_iostats);
        struct rpc_iostats *new;
-
-       new = kmalloc(size, GFP_KERNEL);
-       if (new)
-               memset(new, 0 , size);
+       new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
        return new;
 }
 EXPORT_SYMBOL(rpc_alloc_iostats);
@@ -176,7 +170,8 @@ void rpc_count_iostats(struct rpc_task *task)
        op_metrics->om_execute += execute;
 }
 
-void _print_name(struct seq_file *seq, unsigned int op, struct rpc_procinfo *procs)
+static void _print_name(struct seq_file *seq, unsigned int op,
+                       struct rpc_procinfo *procs)
 {
        if (procs[op].p_name)
                seq_printf(seq, "\t%12s: ", procs[op].p_name);
@@ -225,12 +220,12 @@ EXPORT_SYMBOL(rpc_print_iostats);
  * Register/unregister RPC proc files
  */
 static inline struct proc_dir_entry *
-do_register(const char *name, void *data, struct file_operations *fops)
+do_register(const char *name, void *data, const struct file_operations *fops)
 {
        struct proc_dir_entry *ent;
 
        rpc_proc_init();
-       dprintk("RPC: registering /proc/net/rpc/%s\n", name);
+       dprintk("RPC:       registering /proc/net/rpc/%s\n", name);
 
        ent = create_proc_entry(name, 0, proc_net_rpc);
        if (ent) {
@@ -253,7 +248,7 @@ rpc_proc_unregister(const char *name)
 }
 
 struct proc_dir_entry *
-svc_proc_register(struct svc_stat *statp, struct file_operations *fops)
+svc_proc_register(struct svc_stat *statp, const struct file_operations *fops)
 {
        return do_register(statp->program->pg_name, statp, fops);
 }
@@ -267,7 +262,7 @@ svc_proc_unregister(const char *name)
 void
 rpc_proc_init(void)
 {
-       dprintk("RPC: registering /proc/net/rpc\n");
+       dprintk("RPC:       registering /proc/net/rpc\n");
        if (!proc_net_rpc) {
                struct proc_dir_entry *ent;
                ent = proc_mkdir("rpc", proc_net);
@@ -281,7 +276,7 @@ rpc_proc_init(void)
 void
 rpc_proc_exit(void)
 {
-       dprintk("RPC: unregistering /proc/net/rpc\n");
+       dprintk("RPC:       unregistering /proc/net/rpc\n");
        if (proc_net_rpc) {
                proc_net_rpc = NULL;
                remove_proc_entry("net/rpc", NULL);