jfs: simplify procfs code

Use remove_proc_subtree to remove the whole subtree on cleanup, and
unwind the registration loop into individual calls.  Switch to use
proc_create_seq where applicable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Christoph Hellwig
2018-04-11 16:51:18 +02:00
rodzic 247dbed8c9
commit 07a3b8ed48
6 zmienionych plików z 24 dodań i 99 usunięć

Wyświetl plik

@@ -2998,7 +2998,7 @@ int jfs_sync(void *arg)
}
#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_DEBUG)
static int jfs_txanchor_proc_show(struct seq_file *m, void *v)
int jfs_txanchor_proc_show(struct seq_file *m, void *v)
{
char *freewait;
char *freelockwait;
@@ -3032,22 +3032,10 @@ static int jfs_txanchor_proc_show(struct seq_file *m, void *v)
list_empty(&TxAnchor.unlock_queue) ? "" : "not ");
return 0;
}
static int jfs_txanchor_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, jfs_txanchor_proc_show, NULL);
}
const struct file_operations jfs_txanchor_proc_fops = {
.open = jfs_txanchor_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif
#if defined(CONFIG_PROC_FS) && defined(CONFIG_JFS_STATISTICS)
static int jfs_txstats_proc_show(struct seq_file *m, void *v)
int jfs_txstats_proc_show(struct seq_file *m, void *v)
{
seq_printf(m,
"JFS TxStats\n"
@@ -3072,16 +3060,4 @@ static int jfs_txstats_proc_show(struct seq_file *m, void *v)
TxStat.txLockAlloc_freelock);
return 0;
}
static int jfs_txstats_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, jfs_txstats_proc_show, NULL);
}
const struct file_operations jfs_txstats_proc_fops = {
.open = jfs_txstats_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif