Commit f3aa79fb authored by Dmitry Eremin's avatar Dmitry Eremin Committed by Greg Kroah-Hartman

staging/lustre/fid: move all files from procfs to debugfs

Signed-off-by: default avatarDmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ed8ddb0
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
int seq_client_alloc_super(struct lu_client_seq *seq, int seq_client_alloc_super(struct lu_client_seq *seq,
const struct lu_env *env); const struct lu_env *env);
#if defined(CONFIG_PROC_FS) extern struct lprocfs_vars seq_client_debugfs_list[];
extern struct lprocfs_vars seq_client_proc_list[];
#endif
extern struct proc_dir_entry *seq_type_proc_dir;
#endif /* __FID_INTERNAL_H */ #endif /* __FID_INTERNAL_H */
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
#include "../include/lustre_mdc.h" #include "../include/lustre_mdc.h"
#include "fid_internal.h" #include "fid_internal.h"
static struct dentry *seq_debugfs_dir;
static int seq_client_rpc(struct lu_client_seq *seq, static int seq_client_rpc(struct lu_client_seq *seq,
struct lu_seq_range *output, __u32 opc, struct lu_seq_range *output, __u32 opc,
const char *opcname) const char *opcname)
...@@ -400,37 +402,32 @@ void seq_client_flush(struct lu_client_seq *seq) ...@@ -400,37 +402,32 @@ void seq_client_flush(struct lu_client_seq *seq)
} }
EXPORT_SYMBOL(seq_client_flush); EXPORT_SYMBOL(seq_client_flush);
static void seq_client_proc_fini(struct lu_client_seq *seq) static void seq_client_debugfs_fini(struct lu_client_seq *seq)
{ {
#if defined(CONFIG_PROC_FS) if (!IS_ERR_OR_NULL(seq->lcs_debugfs_entry))
if (seq->lcs_proc_dir) { ldebugfs_remove(&seq->lcs_debugfs_entry);
if (!IS_ERR(seq->lcs_proc_dir))
lprocfs_remove(&seq->lcs_proc_dir);
seq->lcs_proc_dir = NULL;
}
#endif /* CONFIG_PROC_FS */
} }
static int seq_client_proc_init(struct lu_client_seq *seq) static int seq_client_debugfs_init(struct lu_client_seq *seq)
{ {
#if defined(CONFIG_PROC_FS)
int rc; int rc;
seq->lcs_proc_dir = lprocfs_register(seq->lcs_name, seq->lcs_debugfs_entry = ldebugfs_register(seq->lcs_name,
seq_type_proc_dir, seq_debugfs_dir,
NULL, NULL); NULL, NULL);
if (IS_ERR(seq->lcs_proc_dir)) { if (IS_ERR_OR_NULL(seq->lcs_debugfs_entry)) {
CERROR("%s: LProcFS failed in seq-init\n", CERROR("%s: LdebugFS failed in seq-init\n", seq->lcs_name);
seq->lcs_name); rc = seq->lcs_debugfs_entry ? PTR_ERR(seq->lcs_debugfs_entry)
rc = PTR_ERR(seq->lcs_proc_dir); : -ENOMEM;
seq->lcs_debugfs_entry = NULL;
return rc; return rc;
} }
rc = lprocfs_add_vars(seq->lcs_proc_dir, rc = ldebugfs_add_vars(seq->lcs_debugfs_entry,
seq_client_proc_list, seq); seq_client_debugfs_list, seq);
if (rc) { if (rc) {
CERROR("%s: Can't init sequence manager proc, rc %d\n", CERROR("%s: Can't init sequence manager debugfs, rc %d\n",
seq->lcs_name, rc); seq->lcs_name, rc);
goto out_cleanup; goto out_cleanup;
} }
...@@ -438,12 +435,8 @@ static int seq_client_proc_init(struct lu_client_seq *seq) ...@@ -438,12 +435,8 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
return 0; return 0;
out_cleanup: out_cleanup:
seq_client_proc_fini(seq); seq_client_debugfs_fini(seq);
return rc; return rc;
#else /* CONFIG_PROC_FS */
return 0;
#endif
} }
int seq_client_init(struct lu_client_seq *seq, int seq_client_init(struct lu_client_seq *seq,
...@@ -478,7 +471,7 @@ int seq_client_init(struct lu_client_seq *seq, ...@@ -478,7 +471,7 @@ int seq_client_init(struct lu_client_seq *seq,
snprintf(seq->lcs_name, sizeof(seq->lcs_name), snprintf(seq->lcs_name, sizeof(seq->lcs_name),
"cli-%s", prefix); "cli-%s", prefix);
rc = seq_client_proc_init(seq); rc = seq_client_debugfs_init(seq);
if (rc) if (rc)
seq_client_fini(seq); seq_client_fini(seq);
return rc; return rc;
...@@ -487,7 +480,7 @@ EXPORT_SYMBOL(seq_client_init); ...@@ -487,7 +480,7 @@ EXPORT_SYMBOL(seq_client_init);
void seq_client_fini(struct lu_client_seq *seq) void seq_client_fini(struct lu_client_seq *seq)
{ {
seq_client_proc_fini(seq); seq_client_debugfs_fini(seq);
if (seq->lcs_exp != NULL) { if (seq->lcs_exp != NULL) {
class_export_put(seq->lcs_exp); class_export_put(seq->lcs_exp);
...@@ -545,22 +538,18 @@ int client_fid_fini(struct obd_device *obd) ...@@ -545,22 +538,18 @@ int client_fid_fini(struct obd_device *obd)
} }
EXPORT_SYMBOL(client_fid_fini); EXPORT_SYMBOL(client_fid_fini);
struct proc_dir_entry *seq_type_proc_dir;
static int __init fid_mod_init(void) static int __init fid_mod_init(void)
{ {
seq_type_proc_dir = lprocfs_register(LUSTRE_SEQ_NAME, seq_debugfs_dir = ldebugfs_register(LUSTRE_SEQ_NAME,
proc_lustre_root, debugfs_lustre_root,
NULL, NULL); NULL, NULL);
return PTR_ERR_OR_ZERO(seq_type_proc_dir); return PTR_ERR_OR_ZERO(seq_debugfs_dir);
} }
static void __exit fid_mod_exit(void) static void __exit fid_mod_exit(void)
{ {
if (seq_type_proc_dir != NULL && !IS_ERR(seq_type_proc_dir)) { if (!IS_ERR_OR_NULL(seq_debugfs_dir))
lprocfs_remove(&seq_type_proc_dir); ldebugfs_remove(&seq_debugfs_dir);
seq_type_proc_dir = NULL;
}
} }
MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>"); MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
* Note: this function is only used for testing, it is no safe for production * Note: this function is only used for testing, it is no safe for production
* use. * use.
*/ */
static int lprocfs_fid_write_common(const char __user *buffer, size_t count, static int
ldebugfs_fid_write_common(const char __user *buffer, size_t count,
struct lu_seq_range *range) struct lu_seq_range *range)
{ {
struct lu_seq_range tmp; struct lu_seq_range tmp;
...@@ -92,8 +93,9 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count, ...@@ -92,8 +93,9 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count,
return count; return count;
} }
/* Client side procfs stuff */ /* Client side debugfs stuff */
static ssize_t lprocfs_fid_space_seq_write(struct file *file, static ssize_t
ldebugfs_fid_space_seq_write(struct file *file,
const char __user *buffer, const char __user *buffer,
size_t count, loff_t *off) size_t count, loff_t *off)
{ {
...@@ -104,7 +106,7 @@ static ssize_t lprocfs_fid_space_seq_write(struct file *file, ...@@ -104,7 +106,7 @@ static ssize_t lprocfs_fid_space_seq_write(struct file *file,
LASSERT(seq != NULL); LASSERT(seq != NULL);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
rc = lprocfs_fid_write_common(buffer, count, &seq->lcs_space); rc = ldebugfs_fid_write_common(buffer, count, &seq->lcs_space);
if (rc == 0) { if (rc == 0) {
CDEBUG(D_INFO, "%s: Space: "DRANGE"\n", CDEBUG(D_INFO, "%s: Space: "DRANGE"\n",
...@@ -117,7 +119,7 @@ static ssize_t lprocfs_fid_space_seq_write(struct file *file, ...@@ -117,7 +119,7 @@ static ssize_t lprocfs_fid_space_seq_write(struct file *file,
} }
static int static int
lprocfs_fid_space_seq_show(struct seq_file *m, void *unused) ldebugfs_fid_space_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
...@@ -130,7 +132,8 @@ lprocfs_fid_space_seq_show(struct seq_file *m, void *unused) ...@@ -130,7 +132,8 @@ lprocfs_fid_space_seq_show(struct seq_file *m, void *unused)
return 0; return 0;
} }
static ssize_t lprocfs_fid_width_seq_write(struct file *file, static ssize_t
ldebugfs_fid_width_seq_write(struct file *file,
const char __user *buffer, const char __user *buffer,
size_t count, loff_t *off) size_t count, loff_t *off)
{ {
...@@ -166,7 +169,7 @@ static ssize_t lprocfs_fid_width_seq_write(struct file *file, ...@@ -166,7 +169,7 @@ static ssize_t lprocfs_fid_width_seq_write(struct file *file,
} }
static int static int
lprocfs_fid_width_seq_show(struct seq_file *m, void *unused) ldebugfs_fid_width_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
...@@ -180,7 +183,7 @@ lprocfs_fid_width_seq_show(struct seq_file *m, void *unused) ...@@ -180,7 +183,7 @@ lprocfs_fid_width_seq_show(struct seq_file *m, void *unused)
} }
static int static int
lprocfs_fid_fid_seq_show(struct seq_file *m, void *unused) ldebugfs_fid_fid_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
...@@ -194,7 +197,7 @@ lprocfs_fid_fid_seq_show(struct seq_file *m, void *unused) ...@@ -194,7 +197,7 @@ lprocfs_fid_fid_seq_show(struct seq_file *m, void *unused)
} }
static int static int
lprocfs_fid_server_seq_show(struct seq_file *m, void *unused) ldebugfs_fid_server_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
struct client_obd *cli; struct client_obd *cli;
...@@ -211,15 +214,15 @@ lprocfs_fid_server_seq_show(struct seq_file *m, void *unused) ...@@ -211,15 +214,15 @@ lprocfs_fid_server_seq_show(struct seq_file *m, void *unused)
return 0; return 0;
} }
LPROC_SEQ_FOPS(lprocfs_fid_space); LPROC_SEQ_FOPS(ldebugfs_fid_space);
LPROC_SEQ_FOPS(lprocfs_fid_width); LPROC_SEQ_FOPS(ldebugfs_fid_width);
LPROC_SEQ_FOPS_RO(lprocfs_fid_server); LPROC_SEQ_FOPS_RO(ldebugfs_fid_server);
LPROC_SEQ_FOPS_RO(lprocfs_fid_fid); LPROC_SEQ_FOPS_RO(ldebugfs_fid_fid);
struct lprocfs_vars seq_client_proc_list[] = { struct lprocfs_vars seq_client_debugfs_list[] = {
{ "space", &lprocfs_fid_space_fops }, { "space", &ldebugfs_fid_space_fops },
{ "width", &lprocfs_fid_width_fops }, { "width", &ldebugfs_fid_width_fops },
{ "server", &lprocfs_fid_server_fops }, { "server", &ldebugfs_fid_server_fops },
{ "fid", &lprocfs_fid_fid_fops }, { "fid", &ldebugfs_fid_fid_fops },
{ NULL } { NULL }
}; };
...@@ -346,7 +346,7 @@ struct lu_client_seq { ...@@ -346,7 +346,7 @@ struct lu_client_seq {
struct lu_seq_range lcs_space; struct lu_seq_range lcs_space;
/* Seq related proc */ /* Seq related proc */
struct proc_dir_entry *lcs_proc_dir; struct dentry *lcs_debugfs_entry;
/* This holds last allocated fid in last obtained seq */ /* This holds last allocated fid in last obtained seq */
struct lu_fid lcs_fid; struct lu_fid lcs_fid;
......
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