Commit 072eaf3c authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: drop CEPH_DEFINE_SHOW_FUNC

Although CEPH_DEFINE_SHOW_FUNC is much older, it now duplicates
DEFINE_SHOW_ATTRIBUTE from linux/seq_file.h.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
parent 525d15e8
...@@ -218,10 +218,10 @@ static int mds_sessions_show(struct seq_file *s, void *ptr) ...@@ -218,10 +218,10 @@ static int mds_sessions_show(struct seq_file *s, void *ptr)
return 0; return 0;
} }
CEPH_DEFINE_SHOW_FUNC(mdsmap_show) DEFINE_SHOW_ATTRIBUTE(mdsmap);
CEPH_DEFINE_SHOW_FUNC(mdsc_show) DEFINE_SHOW_ATTRIBUTE(mdsc);
CEPH_DEFINE_SHOW_FUNC(caps_show) DEFINE_SHOW_ATTRIBUTE(caps);
CEPH_DEFINE_SHOW_FUNC(mds_sessions_show) DEFINE_SHOW_ATTRIBUTE(mds_sessions);
/* /*
...@@ -281,25 +281,25 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) ...@@ -281,25 +281,25 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
0400, 0400,
fsc->client->debugfs_dir, fsc->client->debugfs_dir,
fsc, fsc,
&mdsmap_show_fops); &mdsmap_fops);
fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions", fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
0400, 0400,
fsc->client->debugfs_dir, fsc->client->debugfs_dir,
fsc, fsc,
&mds_sessions_show_fops); &mds_sessions_fops);
fsc->debugfs_mdsc = debugfs_create_file("mdsc", fsc->debugfs_mdsc = debugfs_create_file("mdsc",
0400, 0400,
fsc->client->debugfs_dir, fsc->client->debugfs_dir,
fsc, fsc,
&mdsc_show_fops); &mdsc_fops);
fsc->debugfs_caps = debugfs_create_file("caps", fsc->debugfs_caps = debugfs_create_file("caps",
0400, 0400,
fsc->client->debugfs_dir, fsc->client->debugfs_dir,
fsc, fsc,
&caps_show_fops); &caps_fops);
} }
......
...@@ -2,22 +2,8 @@ ...@@ -2,22 +2,8 @@
#ifndef _FS_CEPH_DEBUGFS_H #ifndef _FS_CEPH_DEBUGFS_H
#define _FS_CEPH_DEBUGFS_H #define _FS_CEPH_DEBUGFS_H
#include <linux/ceph/ceph_debug.h>
#include <linux/ceph/types.h> #include <linux/ceph/types.h>
#define CEPH_DEFINE_SHOW_FUNC(name) \
static int name##_open(struct inode *inode, struct file *file) \
{ \
return single_open(file, name, inode->i_private); \
} \
\
static const struct file_operations name##_fops = { \
.open = name##_open, \
.read = seq_read, \
.llseek = seq_lseek, \
.release = single_release, \
};
/* debugfs.c */ /* debugfs.c */
extern void ceph_debugfs_init(void); extern void ceph_debugfs_init(void);
extern void ceph_debugfs_cleanup(void); extern void ceph_debugfs_cleanup(void);
......
...@@ -383,11 +383,11 @@ static int client_options_show(struct seq_file *s, void *p) ...@@ -383,11 +383,11 @@ static int client_options_show(struct seq_file *s, void *p)
return 0; return 0;
} }
CEPH_DEFINE_SHOW_FUNC(monmap_show) DEFINE_SHOW_ATTRIBUTE(monmap);
CEPH_DEFINE_SHOW_FUNC(osdmap_show) DEFINE_SHOW_ATTRIBUTE(osdmap);
CEPH_DEFINE_SHOW_FUNC(monc_show) DEFINE_SHOW_ATTRIBUTE(monc);
CEPH_DEFINE_SHOW_FUNC(osdc_show) DEFINE_SHOW_ATTRIBUTE(osdc);
CEPH_DEFINE_SHOW_FUNC(client_options_show) DEFINE_SHOW_ATTRIBUTE(client_options);
void __init ceph_debugfs_init(void) void __init ceph_debugfs_init(void)
{ {
...@@ -414,31 +414,31 @@ void ceph_debugfs_client_init(struct ceph_client *client) ...@@ -414,31 +414,31 @@ void ceph_debugfs_client_init(struct ceph_client *client)
0400, 0400,
client->debugfs_dir, client->debugfs_dir,
client, client,
&monc_show_fops); &monc_fops);
client->osdc.debugfs_file = debugfs_create_file("osdc", client->osdc.debugfs_file = debugfs_create_file("osdc",
0400, 0400,
client->debugfs_dir, client->debugfs_dir,
client, client,
&osdc_show_fops); &osdc_fops);
client->debugfs_monmap = debugfs_create_file("monmap", client->debugfs_monmap = debugfs_create_file("monmap",
0400, 0400,
client->debugfs_dir, client->debugfs_dir,
client, client,
&monmap_show_fops); &monmap_fops);
client->debugfs_osdmap = debugfs_create_file("osdmap", client->debugfs_osdmap = debugfs_create_file("osdmap",
0400, 0400,
client->debugfs_dir, client->debugfs_dir,
client, client,
&osdmap_show_fops); &osdmap_fops);
client->debugfs_options = debugfs_create_file("client_options", client->debugfs_options = debugfs_create_file("client_options",
0400, 0400,
client->debugfs_dir, client->debugfs_dir,
client, client,
&client_options_show_fops); &client_options_fops);
} }
void ceph_debugfs_client_cleanup(struct ceph_client *client) void ceph_debugfs_client_cleanup(struct ceph_client *client)
......
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