History

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.

Ilya Dryomov committed 6 years ago

Commit 072eaf31 parent 525d15e3 files · +18 −32Browse files

Unified · Split

3 files
  1. fs/ceph/debugfs.c +8 −8
  2. include/linux/ceph/debugfs.h +0 −14
  3. net/ceph/debugfs.c +10 −10
fs/ceph/debugfs.c+8−8
@@ -218,10 +218,10 @@ static int mds_sessions_show(struct seq_file *s, void *ptr) · 217 unmodified lines
218 return 0;218 return 0;
219}219}
220 220
221CEPH_DEFINE_SHOW_FUNC(mdsmap_show)221DEFINE_SHOW_ATTRIBUTE(mdsmap);
222CEPH_DEFINE_SHOW_FUNC(mdsc_show)222DEFINE_SHOW_ATTRIBUTE(mdsc);
223CEPH_DEFINE_SHOW_FUNC(caps_show)223DEFINE_SHOW_ATTRIBUTE(caps);
224CEPH_DEFINE_SHOW_FUNC(mds_sessions_show)224DEFINE_SHOW_ATTRIBUTE(mds_sessions);
225 225
226 226
227/*227/*
@@ -281,25 +281,25 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) · 53 unmodified lines
281 0400,281 0400,
282 fsc->client->debugfs_dir,282 fsc->client->debugfs_dir,
283 fsc,283 fsc,
284 &mdsmap_show_fops);284 &mdsmap_fops);
285 285
286 fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",286 fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
287 0400,287 0400,
288 fsc->client->debugfs_dir,288 fsc->client->debugfs_dir,
289 fsc,289 fsc,
290 &mds_sessions_show_fops);290 &mds_sessions_fops);
291 291
292 fsc->debugfs_mdsc = debugfs_create_file("mdsc",292 fsc->debugfs_mdsc = debugfs_create_file("mdsc",
293 0400,293 0400,
294 fsc->client->debugfs_dir,294 fsc->client->debugfs_dir,
295 fsc,295 fsc,
296 &mdsc_show_fops);296 &mdsc_fops);
297 297
298 fsc->debugfs_caps = debugfs_create_file("caps",298 fsc->debugfs_caps = debugfs_create_file("caps",
299 0400,299 0400,
300 fsc->client->debugfs_dir,300 fsc->client->debugfs_dir,
301 fsc,301 fsc,
302 &caps_show_fops);302 &caps_fops);
303}303}
304 304
305 305
include/linux/ceph/debugfs.h+0−14
@@ -2,22 +2,8 @@ · 1 unmodified line
2#ifndef _FS_CEPH_DEBUGFS_H2#ifndef _FS_CEPH_DEBUGFS_H
3#define _FS_CEPH_DEBUGFS_H3#define _FS_CEPH_DEBUGFS_H
4 4
5#include <linux/ceph/ceph_debug.h>
6#include <linux/ceph/types.h>5#include <linux/ceph/types.h>
7 6
8#define CEPH_DEFINE_SHOW_FUNC(name) \
9static int name##_open(struct inode *inode, struct file *file) \
10{ \
11 return single_open(file, name, inode->i_private); \
12} \
13 \
14static const struct file_operations name##_fops = { \
15 .open = name##_open, \
16 .read = seq_read, \
17 .llseek = seq_lseek, \
18 .release = single_release, \
19};
20
21/* debugfs.c */7/* debugfs.c */
22extern void ceph_debugfs_init(void);8extern void ceph_debugfs_init(void);
23extern void ceph_debugfs_cleanup(void);9extern void ceph_debugfs_cleanup(void);
net/ceph/debugfs.c+10−10
@@ -383,11 +383,11 @@ static int client_options_show(struct seq_file *s, void *p) · 382 unmodified lines
383 return 0;383 return 0;
384}384}
385 385
386CEPH_DEFINE_SHOW_FUNC(monmap_show)386DEFINE_SHOW_ATTRIBUTE(monmap);
387CEPH_DEFINE_SHOW_FUNC(osdmap_show)387DEFINE_SHOW_ATTRIBUTE(osdmap);
388CEPH_DEFINE_SHOW_FUNC(monc_show)388DEFINE_SHOW_ATTRIBUTE(monc);
389CEPH_DEFINE_SHOW_FUNC(osdc_show)389DEFINE_SHOW_ATTRIBUTE(osdc);
390CEPH_DEFINE_SHOW_FUNC(client_options_show)390DEFINE_SHOW_ATTRIBUTE(client_options);
391 391
392void __init ceph_debugfs_init(void)392void __init ceph_debugfs_init(void)
393{393{
@@ -414,31 +414,31 @@ void ceph_debugfs_client_init(struct ceph_client *client) · 20 unmodified lines
414 0400,414 0400,
415 client->debugfs_dir,415 client->debugfs_dir,
416 client,416 client,
417 &monc_show_fops);417 &monc_fops);
418 418
419 client->osdc.debugfs_file = debugfs_create_file("osdc",419 client->osdc.debugfs_file = debugfs_create_file("osdc",
420 0400,420 0400,
421 client->debugfs_dir,421 client->debugfs_dir,
422 client,422 client,
423 &osdc_show_fops);423 &osdc_fops);
424 424
425 client->debugfs_monmap = debugfs_create_file("monmap",425 client->debugfs_monmap = debugfs_create_file("monmap",
426 0400,426 0400,
427 client->debugfs_dir,427 client->debugfs_dir,
428 client,428 client,
429 &monmap_show_fops);429 &monmap_fops);
430 430
431 client->debugfs_osdmap = debugfs_create_file("osdmap",431 client->debugfs_osdmap = debugfs_create_file("osdmap",
432 0400,432 0400,
433 client->debugfs_dir,433 client->debugfs_dir,
434 client,434 client,
435 &osdmap_show_fops);435 &osdmap_fops);
436 436
437 client->debugfs_options = debugfs_create_file("client_options",437 client->debugfs_options = debugfs_create_file("client_options",
438 0400,438 0400,
439 client->debugfs_dir,439 client->debugfs_dir,
440 client,440 client,
441 &client_options_show_fops);441 &client_options_fops);
442}442}
443 443
444void ceph_debugfs_client_cleanup(struct ceph_client *client)444void ceph_debugfs_client_cleanup(struct ceph_client *client)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t