Commit 4ef0602f authored by Dave Kleikamp's avatar Dave Kleikamp

procfs entries should be created when CONFIG_JFS_STATISTICS is set.

Currently, if CONFIG_JFS_DEBUG is not set, no entries are created
under /proc/fs/jfs, even if CONFIG_JFS_STATISTICS is set.
parent a40a7505
......@@ -52,8 +52,14 @@ void dump_mem(char *label, void *data, int length)
printk("%s\n", line);
}
}
#endif
#ifdef PROC_FS_JFS /* see jfs_debug.h */
static struct proc_dir_entry *base;
#ifdef CONFIG_JFS_DEBUG
extern read_proc_t jfs_txanchor_read;
#ifdef CONFIG_PROC_FS
static int loglevel_read(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
......@@ -89,28 +95,29 @@ static int loglevel_write(struct file *file, const char *buffer,
jfsloglevel = c - '0';
return count;
}
#endif
extern read_proc_t jfs_txanchor_read;
#ifdef CONFIG_JFS_STATISTICS
extern read_proc_t jfs_lmstats_read;
extern read_proc_t jfs_xtstat_read;
extern read_proc_t jfs_mpstat_read;
#endif
static struct proc_dir_entry *base;
static struct {
const char *name;
read_proc_t *read_fn;
write_proc_t *write_fn;
} Entries[] = {
{ "TxAnchor", jfs_txanchor_read, },
#ifdef CONFIG_JFS_STATISTICS
{ "lmstats", jfs_lmstats_read, },
{ "xtstat", jfs_xtstat_read, },
{ "mpstat", jfs_mpstat_read, },
#endif
#ifdef CONFIG_JFS_DEBUG
{ "TxAnchor", jfs_txanchor_read, },
{ "loglevel", loglevel_read, loglevel_write }
#endif
};
#define NPROCENT (sizeof(Entries)/sizeof(Entries[0]))
......@@ -142,5 +149,4 @@ void jfs_proc_clean(void)
}
}
#endif /* CONFIG_PROC_FS */
#endif /* CONFIG_JFS_DEBUG */
#endif /* PROC_FS_JFS */
......@@ -26,6 +26,14 @@
* under control of CONFIG_JFS_DEBUG, CONFIG_JFS_STATISTICS;
*/
/*
* Create /proc/fs/jfs if procfs is enabled andeither
* CONFIG_JFS_DEBUG or CONFIG_JFS_STATISTICS is defined
*/
#if defined(CONFIG_PROC_FS) && (defined(CONFIG_JFS_DEBUG) || defined(CONFIG_JFS_STATISTICS))
#define PROC_FS_JFS
#endif
/*
* assert with traditional printf/panic
*/
......
......@@ -2992,7 +2992,7 @@ int jfs_sync(void)
return 0;
}
#if CONFIG_PROC_FS
#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_DEBUG)
int jfs_txanchor_read(char *buffer, char **start, off_t offset, int length,
int *eof, void *data)
{
......
......@@ -68,7 +68,7 @@ extern void jfs_write_inode(struct inode *inode, int wait);
extern struct dentry *jfs_get_parent(struct dentry *dentry);
#if defined(CONFIG_JFS_DEBUG) && defined(CONFIG_PROC_FS)
#ifdef PROC_FS_JFS /* see jfs_debug.h */
extern void jfs_proc_init(void);
extern void jfs_proc_clean(void);
#endif
......@@ -448,7 +448,7 @@ static int __init init_jfs_fs(void)
}
wait_for_completion(&jfsIOwait); /* Wait until IO thread starts */
#if defined(CONFIG_JFS_DEBUG) && defined(CONFIG_PROC_FS)
#ifdef PROC_FS_JFS
jfs_proc_init();
#endif
......@@ -485,7 +485,7 @@ static void __exit exit_jfs_fs(void)
wait_for_completion(&jfsIOwait); /* Wait until Commit thread exits */
wake_up(&jfs_sync_thread_wait);
wait_for_completion(&jfsIOwait); /* Wait until Sync thread exits */
#if defined(CONFIG_JFS_DEBUG) && defined(CONFIG_PROC_FS)
#ifdef PROC_FS_JFS
jfs_proc_clean();
#endif
unregister_filesystem(&jfs_fs_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment