#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include "orangefs-debugfs.h"
#include "protocol.h"
#include "orangefs-kernel.h"
#define DEBUG_HELP_STRING_SIZE …
#define HELP_STRING_UNINITIALIZED …
#define ORANGEFS_KMOD_DEBUG_HELP_FILE …
#define ORANGEFS_KMOD_DEBUG_FILE …
#define ORANGEFS_CLIENT_DEBUG_FILE …
#define ORANGEFS_VERBOSE …
#define ORANGEFS_ALL …
struct client_debug_mask { … };
static void orangefs_kernel_debug_init(void);
static int orangefs_debug_help_open(struct inode *, struct file *);
static void *help_start(struct seq_file *, loff_t *);
static void *help_next(struct seq_file *, void *, loff_t *);
static void help_stop(struct seq_file *, void *);
static int help_show(struct seq_file *, void *);
static int orangefs_debug_open(struct inode *, struct file *);
static ssize_t orangefs_debug_read(struct file *,
char __user *,
size_t,
loff_t *);
static ssize_t orangefs_debug_write(struct file *,
const char __user *,
size_t,
loff_t *);
static int orangefs_prepare_cdm_array(char *);
static void debug_mask_to_string(void *, int);
static void do_k_string(void *, int);
static void do_c_string(void *, int);
static int keyword_is_amalgam(char *);
static int check_amalgam_keyword(void *, int);
static void debug_string_to_mask(char *, void *, int);
static void do_c_mask(int, char *, struct client_debug_mask **);
static void do_k_mask(int, char *, __u64 **);
static char kernel_debug_string[ORANGEFS_MAX_DEBUG_STRING_LEN] = …;
static char *debug_help_string;
static char client_debug_string[ORANGEFS_MAX_DEBUG_STRING_LEN];
static char client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN];
static struct dentry *client_debug_dentry;
static struct dentry *debug_dir;
static unsigned int kernel_mask_set_mod_init;
static int orangefs_debug_disabled = …;
static int help_string_initialized;
static const struct seq_operations help_debug_ops = …;
static const struct file_operations debug_help_fops = …;
static const struct file_operations kernel_debug_fops = …;
static int client_all_index;
static int client_verbose_index;
static struct client_debug_mask *cdm_array;
static int cdm_element_count;
static struct client_debug_mask client_debug_mask;
static DEFINE_MUTEX(orangefs_debug_lock);
static DEFINE_MUTEX(orangefs_help_file_lock);
void orangefs_debugfs_init(int debug_mask)
{ … }
static void orangefs_kernel_debug_init(void)
{ … }
void orangefs_debugfs_cleanup(void)
{ … }
static int orangefs_debug_help_open(struct inode *inode, struct file *file)
{ … }
static void *help_start(struct seq_file *m, loff_t *pos)
{ … }
static void *help_next(struct seq_file *m, void *v, loff_t *pos)
{ … }
static void help_stop(struct seq_file *m, void *p)
{ … }
static int help_show(struct seq_file *m, void *v)
{ … }
static void orangefs_client_debug_init(void)
{ … }
static int orangefs_debug_open(struct inode *inode, struct file *file)
{ … }
static ssize_t orangefs_debug_read(struct file *file,
char __user *ubuf,
size_t count,
loff_t *ppos)
{ … }
static ssize_t orangefs_debug_write(struct file *file,
const char __user *ubuf,
size_t count,
loff_t *ppos)
{ … }
static int orangefs_prepare_cdm_array(char *debug_array_string)
{ … }
int orangefs_prepare_debugfs_help_string(int at_boot)
{ … }
static void debug_mask_to_string(void *mask, int type)
{ … }
static void do_k_string(void *k_mask, int index)
{ … }
static void do_c_string(void *c_mask, int index)
{ … }
static int keyword_is_amalgam(char *keyword)
{ … }
static int check_amalgam_keyword(void *mask, int type)
{ … }
static void debug_string_to_mask(char *debug_string, void *mask, int type)
{ … }
static void do_c_mask(int i, char *unchecked_keyword,
struct client_debug_mask **sane_mask)
{ … }
static void do_k_mask(int i, char *unchecked_keyword, __u64 **sane_mask)
{ … }
int orangefs_debugfs_new_client_mask(void __user *arg)
{ … }
int orangefs_debugfs_new_client_string(void __user *arg)
{ … }
int orangefs_debugfs_new_debug(void __user *arg)
{ … }