aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_txnmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/jfs_txnmgr.c')
-rw-r--r--fs/jfs/jfs_txnmgr.c68
1 files changed, 31 insertions, 37 deletions
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index e7c60ae6b5b2..f26e4d03ada5 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -49,6 +49,7 @@
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/moduleparam.h> 50#include <linux/moduleparam.h>
51#include <linux/kthread.h> 51#include <linux/kthread.h>
52#include <linux/seq_file.h>
52#include "jfs_incore.h" 53#include "jfs_incore.h"
53#include "jfs_inode.h" 54#include "jfs_inode.h"
54#include "jfs_filsys.h" 55#include "jfs_filsys.h"
@@ -3009,11 +3010,8 @@ int jfs_sync(void *arg)
3009} 3010}
3010 3011
3011#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_DEBUG) 3012#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_DEBUG)
3012int jfs_txanchor_read(char *buffer, char **start, off_t offset, int length, 3013static int jfs_txanchor_proc_show(struct seq_file *m, void *v)
3013 int *eof, void *data)
3014{ 3014{
3015 int len = 0;
3016 off_t begin;
3017 char *freewait; 3015 char *freewait;
3018 char *freelockwait; 3016 char *freelockwait;
3019 char *lowlockwait; 3017 char *lowlockwait;
@@ -3025,7 +3023,7 @@ int jfs_txanchor_read(char *buffer, char **start, off_t offset, int length,
3025 lowlockwait = 3023 lowlockwait =
3026 waitqueue_active(&TxAnchor.lowlockwait) ? "active" : "empty"; 3024 waitqueue_active(&TxAnchor.lowlockwait) ? "active" : "empty";
3027 3025
3028 len += sprintf(buffer, 3026 seq_printf(m,
3029 "JFS TxAnchor\n" 3027 "JFS TxAnchor\n"
3030 "============\n" 3028 "============\n"
3031 "freetid = %d\n" 3029 "freetid = %d\n"
@@ -3044,31 +3042,27 @@ int jfs_txanchor_read(char *buffer, char **start, off_t offset, int length,
3044 TxAnchor.tlocksInUse, 3042 TxAnchor.tlocksInUse,
3045 jfs_tlocks_low, 3043 jfs_tlocks_low,
3046 list_empty(&TxAnchor.unlock_queue) ? "" : "not "); 3044 list_empty(&TxAnchor.unlock_queue) ? "" : "not ");
3045 return 0;
3046}
3047 3047
3048 begin = offset; 3048static int jfs_txanchor_proc_open(struct inode *inode, struct file *file)
3049 *start = buffer + begin; 3049{
3050 len -= begin; 3050 return single_open(file, jfs_txanchor_proc_show, NULL);
3051
3052 if (len > length)
3053 len = length;
3054 else
3055 *eof = 1;
3056
3057 if (len < 0)
3058 len = 0;
3059
3060 return len;
3061} 3051}
3052
3053const struct file_operations jfs_txanchor_proc_fops = {
3054 .owner = THIS_MODULE,
3055 .open = jfs_txanchor_proc_open,
3056 .read = seq_read,
3057 .llseek = seq_lseek,
3058 .release = single_release,
3059};
3062#endif 3060#endif
3063 3061
3064#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_STATISTICS) 3062#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_STATISTICS)
3065int jfs_txstats_read(char *buffer, char **start, off_t offset, int length, 3063static int jfs_txstats_proc_show(struct seq_file *m, void *v)
3066 int *eof, void *data)
3067{ 3064{
3068 int len = 0; 3065 seq_printf(m,
3069 off_t begin;
3070
3071 len += sprintf(buffer,
3072 "JFS TxStats\n" 3066 "JFS TxStats\n"
3073 "===========\n" 3067 "===========\n"
3074 "calls to txBegin = %d\n" 3068 "calls to txBegin = %d\n"
@@ -3089,19 +3083,19 @@ int jfs_txstats_read(char *buffer, char **start, off_t offset, int length,
3089 TxStat.txBeginAnon_lockslow, 3083 TxStat.txBeginAnon_lockslow,
3090 TxStat.txLockAlloc, 3084 TxStat.txLockAlloc,
3091 TxStat.txLockAlloc_freelock); 3085 TxStat.txLockAlloc_freelock);
3086 return 0;
3087}
3092 3088
3093 begin = offset; 3089static int jfs_txstats_proc_open(struct inode *inode, struct file *file)
3094 *start = buffer + begin; 3090{
3095 len -= begin; 3091 return single_open(file, jfs_txstats_proc_show, NULL);
3096
3097 if (len > length)
3098 len = length;
3099 else
3100 *eof = 1;
3101
3102 if (len < 0)
3103 len = 0;
3104
3105 return len;
3106} 3092}
3093
3094const struct file_operations jfs_txstats_proc_fops = {
3095 .owner = THIS_MODULE,
3096 .open = jfs_txstats_proc_open,
3097 .read = seq_read,
3098 .llseek = seq_lseek,
3099 .release = single_release,
3100};
3107#endif 3101#endif