X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fsunrpc%2Fstats.c;h=74ba7d443dfc06ec7162c2d7b1735bc2bfc67e06;hb=40b77c943468236c6dfad3e7b94348fe70c70331;hp=15c2db26767bc5e5b6848d904078c9b0975dcfa4;hpb=d42510a0f58c2583c37c8e9b7548e3a68545863a;p=linux-2.6 diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 15c2db2676..74ba7d443d 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c @@ -16,7 +16,6 @@ #include #include -#include #include #include #include @@ -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); @@ -231,7 +225,7 @@ 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) { @@ -268,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); @@ -282,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);