aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_metapage.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-05-13 09:22:10 -0400
committerDave Kleikamp <shaggy@linux.vnet.ibm.com>2008-05-13 09:22:10 -0400
commitb2e03ca7485cac033a0667d9e45e28d32fdee9a5 (patch)
treec439fb22c543027143cebe17512b77964bd0ec20 /fs/jfs/jfs_metapage.c
parent88f85a55c0645c2b7e03bf34d2a90eddf6de34fa (diff)
JFS: switch to seq_files
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Diffstat (limited to 'fs/jfs/jfs_metapage.c')
-rw-r--r--fs/jfs/jfs_metapage.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index d1e64f2f2fcd..854ff0ec574f 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -19,10 +19,12 @@
19 19
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/module.h>
22#include <linux/bio.h> 23#include <linux/bio.h>
23#include <linux/init.h> 24#include <linux/init.h>
24#include <linux/buffer_head.h> 25#include <linux/buffer_head.h>
25#include <linux/mempool.h> 26#include <linux/mempool.h>
27#include <linux/seq_file.h>
26#include "jfs_incore.h" 28#include "jfs_incore.h"
27#include "jfs_superblock.h" 29#include "jfs_superblock.h"
28#include "jfs_filsys.h" 30#include "jfs_filsys.h"
@@ -804,13 +806,9 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len)
804} 806}
805 807
806#ifdef CONFIG_JFS_STATISTICS 808#ifdef CONFIG_JFS_STATISTICS
807int jfs_mpstat_read(char *buffer, char **start, off_t offset, int length, 809static int jfs_mpstat_proc_show(struct seq_file *m, void *v)
808 int *eof, void *data)
809{ 810{
810 int len = 0; 811 seq_printf(m,
811 off_t begin;
812
813 len += sprintf(buffer,
814 "JFS Metapage statistics\n" 812 "JFS Metapage statistics\n"
815 "=======================\n" 813 "=======================\n"
816 "page allocations = %d\n" 814 "page allocations = %d\n"
@@ -819,19 +817,19 @@ int jfs_mpstat_read(char *buffer, char **start, off_t offset, int length,
819 mpStat.pagealloc, 817 mpStat.pagealloc,
820 mpStat.pagefree, 818 mpStat.pagefree,
821 mpStat.lockwait); 819 mpStat.lockwait);
820 return 0;
821}
822 822
823 begin = offset; 823static int jfs_mpstat_proc_open(struct inode *inode, struct file *file)
824 *start = buffer + begin; 824{
825 len -= begin; 825 return single_open(file, jfs_mpstat_proc_show, NULL);
826
827 if (len > length)
828 len = length;
829 else
830 *eof = 1;
831
832 if (len < 0)
833 len = 0;
834
835 return len;
836} 826}
827
828const struct file_operations jfs_mpstat_proc_fops = {
829 .owner = THIS_MODULE,
830 .open = jfs_mpstat_proc_open,
831 .read = seq_read,
832 .llseek = seq_lseek,
833 .release = single_release,
834};
837#endif 835#endif