2 * linux/fs/nfsd/stats.c
4 * procfs-based user access to knfsd statistics
9 * rc <hits> <misses> <nocache>
10 * Statistsics for the reply cache
11 * plus generic RPC stats (see net/sunrpc/stats.c)
13 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
16 #include <linux/kernel.h>
17 #include <linux/sched.h>
18 #include <linux/proc_fs.h>
19 #include <linux/stat.h>
21 #include <linux/sunrpc/svc.h>
22 #include <linux/sunrpc/stats.h>
23 #include <linux/nfsd/nfsd.h>
24 #include <linux/nfsd/stats.h>
26 struct nfsd_stats nfsdstats
;
27 struct svc_stat nfsd_svcstats
= { &nfsd_program
, };
30 nfsd_proc_read(char *buffer
, char **start
, off_t offset
, int count
,
35 len
= sprintf(buffer
, "rc %d %d %d %d %d %d %d %d\n",
45 /* Assume we haven't hit EOF yet. Will be set by svc_proc_read. */
49 * Append generic nfsd RPC statistics if there's room for it.
52 len
= svc_proc_read(buffer
, start
, offset
- len
, count
,
58 len
+= svc_proc_read(buffer
+ len
, start
, 0, count
- len
,
67 *start
= buffer
+ offset
;
68 if ((len
-= offset
) > count
)
76 struct proc_dir_entry
*ent
;
78 if ((ent
= svc_proc_register(&nfsd_svcstats
)) != 0) {
79 ent
->read_proc
= nfsd_proc_read
;
81 ent
->fill_inode
= nfsd_modcount
;
87 nfsd_stat_shutdown(void)
89 svc_proc_unregister("nfsd");