aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-03 11:42:43 -0400
committerDavid Howells <dhowells@redhat.com>2009-04-03 11:42:43 -0400
commit6a51091d0775cdc4a923f2172c61925ad416aa32 (patch)
tree288fafe724eee5a0c67ff4c9bd437d35d3bbb9ab /fs/nfs/super.c
parentd599064a1bca7bcbaabe54b94fa73ea86952cae3 (diff)
NFS: Add some new I/O counters for FS-Cache doing things for NFS
Add some new NFS I/O counters for FS-Cache doing things for NFS. A new line is emitted into /proc/pid/mountstats if caching is enabled that looks like: fsc: <rok> <rfl> <wok> <wfl> <unc> Where <rok> is the number of pages read successfully from the cache, <rfl> is the number of failed page reads against the cache, <wok> is the number of successful page writes to the cache, <wfl> is the number of failed page writes to the cache, and <unc> is the number of NFS pages that have been disconnected from the cache. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 87f65ae07f32..b5fea776a0dc 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -642,6 +642,10 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
642 totals.events[i] += stats->events[i]; 642 totals.events[i] += stats->events[i];
643 for (i = 0; i < __NFSIOS_BYTESMAX; i++) 643 for (i = 0; i < __NFSIOS_BYTESMAX; i++)
644 totals.bytes[i] += stats->bytes[i]; 644 totals.bytes[i] += stats->bytes[i];
645#ifdef CONFIG_NFS_FSCACHE
646 for (i = 0; i < __NFSIOS_FSCACHEMAX; i++)
647 totals.fscache[i] += stats->fscache[i];
648#endif
645 649
646 preempt_enable(); 650 preempt_enable();
647 } 651 }
@@ -652,6 +656,13 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
652 seq_printf(m, "\n\tbytes:\t"); 656 seq_printf(m, "\n\tbytes:\t");
653 for (i = 0; i < __NFSIOS_BYTESMAX; i++) 657 for (i = 0; i < __NFSIOS_BYTESMAX; i++)
654 seq_printf(m, "%Lu ", totals.bytes[i]); 658 seq_printf(m, "%Lu ", totals.bytes[i]);
659#ifdef CONFIG_NFS_FSCACHE
660 if (nfss->options & NFS_OPTION_FSCACHE) {
661 seq_printf(m, "\n\tfsc:\t");
662 for (i = 0; i < __NFSIOS_FSCACHEMAX; i++)
663 seq_printf(m, "%Lu ", totals.bytes[i]);
664 }
665#endif
655 seq_printf(m, "\n"); 666 seq_printf(m, "\n");
656 667
657 rpc_print_iostats(m, nfss->client); 668 rpc_print_iostats(m, nfss->client);