Skip to content

Commit 072eaf3

Browse files
committed
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: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Jeff Layton <jlayton@kernel.org>
1 parent 525d15e commit 072eaf3

3 files changed

Lines changed: 18 additions & 32 deletions

File tree

‎fs/ceph/debugfs.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ static int mds_sessions_show(struct seq_file *s, void *ptr)
218218
return 0;
219219
}
220220

221-
CEPH_DEFINE_SHOW_FUNC(mdsmap_show)
222-
CEPH_DEFINE_SHOW_FUNC(mdsc_show)
223-
CEPH_DEFINE_SHOW_FUNC(caps_show)
224-
CEPH_DEFINE_SHOW_FUNC(mds_sessions_show)
221+
DEFINE_SHOW_ATTRIBUTE(mdsmap);
222+
DEFINE_SHOW_ATTRIBUTE(mdsc);
223+
DEFINE_SHOW_ATTRIBUTE(caps);
224+
DEFINE_SHOW_ATTRIBUTE(mds_sessions);
225225

226226

227227
/*
@@ -281,25 +281,25 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
281281
0400,
282282
fsc->client->debugfs_dir,
283283
fsc,
284-
&mdsmap_show_fops);
284+
&mdsmap_fops);
285285

286286
fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
287287
0400,
288288
fsc->client->debugfs_dir,
289289
fsc,
290-
&mds_sessions_show_fops);
290+
&mds_sessions_fops);
291291

292292
fsc->debugfs_mdsc = debugfs_create_file("mdsc",
293293
0400,
294294
fsc->client->debugfs_dir,
295295
fsc,
296-
&mdsc_show_fops);
296+
&mdsc_fops);
297297

298298
fsc->debugfs_caps = debugfs_create_file("caps",
299299
0400,
300300
fsc->client->debugfs_dir,
301301
fsc,
302-
&caps_show_fops);
302+
&caps_fops);
303303
}
304304

305305

‎include/linux/ceph/debugfs.h‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,8 @@
22
#ifndef _FS_CEPH_DEBUGFS_H
33
#define _FS_CEPH_DEBUGFS_H
44

5-
#include <linux/ceph/ceph_debug.h>
65
#include <linux/ceph/types.h>
76

8-
#define CEPH_DEFINE_SHOW_FUNC(name) \
9-
static int name##_open(struct inode *inode, struct file *file) \
10-
{ \
11-
return single_open(file, name, inode->i_private); \
12-
} \
13-
\
14-
static const struct file_operations name##_fops = { \
15-
.open = name##_open, \
16-
.read = seq_read, \
17-
.llseek = seq_lseek, \
18-
.release = single_release, \
19-
};
20-
217
/* debugfs.c */
228
extern void ceph_debugfs_init(void);
239
extern void ceph_debugfs_cleanup(void);

‎net/ceph/debugfs.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@ static int client_options_show(struct seq_file *s, void *p)
383383
return 0;
384384
}
385385

386-
CEPH_DEFINE_SHOW_FUNC(monmap_show)
387-
CEPH_DEFINE_SHOW_FUNC(osdmap_show)
388-
CEPH_DEFINE_SHOW_FUNC(monc_show)
389-
CEPH_DEFINE_SHOW_FUNC(osdc_show)
390-
CEPH_DEFINE_SHOW_FUNC(client_options_show)
386+
DEFINE_SHOW_ATTRIBUTE(monmap);
387+
DEFINE_SHOW_ATTRIBUTE(osdmap);
388+
DEFINE_SHOW_ATTRIBUTE(monc);
389+
DEFINE_SHOW_ATTRIBUTE(osdc);
390+
DEFINE_SHOW_ATTRIBUTE(client_options);
391391

392392
void __init ceph_debugfs_init(void)
393393
{
@@ -414,31 +414,31 @@ void ceph_debugfs_client_init(struct ceph_client *client)
414414
0400,
415415
client->debugfs_dir,
416416
client,
417-
&monc_show_fops);
417+
&monc_fops);
418418

419419
client->osdc.debugfs_file = debugfs_create_file("osdc",
420420
0400,
421421
client->debugfs_dir,
422422
client,
423-
&osdc_show_fops);
423+
&osdc_fops);
424424

425425
client->debugfs_monmap = debugfs_create_file("monmap",
426426
0400,
427427
client->debugfs_dir,
428428
client,
429-
&monmap_show_fops);
429+
&monmap_fops);
430430

431431
client->debugfs_osdmap = debugfs_create_file("osdmap",
432432
0400,
433433
client->debugfs_dir,
434434
client,
435-
&osdmap_show_fops);
435+
&osdmap_fops);
436436

437437
client->debugfs_options = debugfs_create_file("client_options",
438438
0400,
439439
client->debugfs_dir,
440440
client,
441-
&client_options_show_fops);
441+
&client_options_fops);
442442
}
443443

444444
void ceph_debugfs_client_cleanup(struct ceph_client *client)

0 commit comments

Comments
 (0)