~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/jfs/jfs_debug.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  *   Copyright (C) International Business Machines Corp., 2000-2004
  4  *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  5  */
  6 
  7 #include <linux/fs.h>
  8 #include <linux/ctype.h>
  9 #include <linux/module.h>
 10 #include <linux/proc_fs.h>
 11 #include <linux/seq_file.h>
 12 #include <linux/uaccess.h>
 13 #include "jfs_incore.h"
 14 #include "jfs_filsys.h"
 15 #include "jfs_debug.h"
 16 
 17 #ifdef PROC_FS_JFS /* see jfs_debug.h */
 18 
 19 #ifdef CONFIG_JFS_DEBUG
 20 static int jfs_loglevel_proc_show(struct seq_file *m, void *v)
 21 {
 22         seq_printf(m, "%d\n", jfsloglevel);
 23         return 0;
 24 }
 25 
 26 static int jfs_loglevel_proc_open(struct inode *inode, struct file *file)
 27 {
 28         return single_open(file, jfs_loglevel_proc_show, NULL);
 29 }
 30 
 31 static ssize_t jfs_loglevel_proc_write(struct file *file,
 32                 const char __user *buffer, size_t count, loff_t *ppos)
 33 {
 34         char c;
 35 
 36         if (get_user(c, buffer))
 37                 return -EFAULT;
 38 
 39         /* yes, I know this is an ASCIIism.  --hch */
 40         if (c < '' || c > '9')
 41                 return -EINVAL;
 42         jfsloglevel = c - '';
 43         return count;
 44 }
 45 
 46 static const struct proc_ops jfs_loglevel_proc_ops = {
 47         .proc_open      = jfs_loglevel_proc_open,
 48         .proc_read      = seq_read,
 49         .proc_lseek     = seq_lseek,
 50         .proc_release   = single_release,
 51         .proc_write     = jfs_loglevel_proc_write,
 52 };
 53 #endif
 54 
 55 void jfs_proc_init(void)
 56 {
 57         struct proc_dir_entry *base;
 58 
 59         base = proc_mkdir("fs/jfs", NULL);
 60         if (!base)
 61                 return;
 62 
 63 #ifdef CONFIG_JFS_STATISTICS
 64         proc_create_single("lmstats", 0, base, jfs_lmstats_proc_show);
 65         proc_create_single("txstats", 0, base, jfs_txstats_proc_show);
 66         proc_create_single("xtstat", 0, base, jfs_xtstat_proc_show);
 67         proc_create_single("mpstat", 0, base, jfs_mpstat_proc_show);
 68 #endif
 69 #ifdef CONFIG_JFS_DEBUG
 70         proc_create_single("TxAnchor", 0, base, jfs_txanchor_proc_show);
 71         proc_create("loglevel", 0, base, &jfs_loglevel_proc_ops);
 72 #endif
 73 }
 74 
 75 void jfs_proc_clean(void)
 76 {
 77         remove_proc_subtree("fs/jfs", NULL);
 78 }
 79 
 80 #endif /* PROC_FS_JFS */
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php