Although CEPH_DEFINE_SHOW_FUNC is much older, it now duplicates DEFINE_SHOW_ATTRIBUTE from linux/seq_file.h.
Unified · Split
| @@ -218,10 +218,10 @@ static int mds_sessions_show(struct seq_file *s, void *ptr) · 217 unmodified lines | ||
| 218 | 218 | return 0; |
| 219 | 219 | } |
| 220 | 220 | |
| 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); | |
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | /* |
| @@ -281,25 +281,25 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) · 53 unmodified lines | ||
| 281 | 281 | 0400, |
| 282 | 282 | fsc->client->debugfs_dir, |
| 283 | 283 | fsc, |
| 284 | − &mdsmap_show_fops); | |
| 284 | + &mdsmap_fops); | |
| 285 | 285 | |
| 286 | 286 | fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions", |
| 287 | 287 | 0400, |
| 288 | 288 | fsc->client->debugfs_dir, |
| 289 | 289 | fsc, |
| 290 | − &mds_sessions_show_fops); | |
| 290 | + &mds_sessions_fops); | |
| 291 | 291 | |
| 292 | 292 | fsc->debugfs_mdsc = debugfs_create_file("mdsc", |
| 293 | 293 | 0400, |
| 294 | 294 | fsc->client->debugfs_dir, |
| 295 | 295 | fsc, |
| 296 | − &mdsc_show_fops); | |
| 296 | + &mdsc_fops); | |
| 297 | 297 | |
| 298 | 298 | fsc->debugfs_caps = debugfs_create_file("caps", |
| 299 | 299 | 0400, |
| 300 | 300 | fsc->client->debugfs_dir, |
| 301 | 301 | fsc, |
| 302 | − &caps_show_fops); | |
| 302 | + &caps_fops); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| @@ -2,22 +2,8 @@ · 1 unmodified line | ||
| 2 | 2 | #ifndef _FS_CEPH_DEBUGFS_H |
| 3 | 3 | #define _FS_CEPH_DEBUGFS_H |
| 4 | 4 | |
| 5 | −#include <linux/ceph/ceph_debug.h> | |
| 6 | 5 | #include <linux/ceph/types.h> |
| 7 | 6 | |
| 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 | − | |
| 21 | 7 | /* debugfs.c */ |
| 22 | 8 | extern void ceph_debugfs_init(void); |
| 23 | 9 | extern void ceph_debugfs_cleanup(void); |
| @@ -383,11 +383,11 @@ static int client_options_show(struct seq_file *s, void *p) · 382 unmodified lines | ||
| 383 | 383 | return 0; |
| 384 | 384 | } |
| 385 | 385 | |
| 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); | |
| 391 | 391 | |
| 392 | 392 | void __init ceph_debugfs_init(void) |
| 393 | 393 | { |
| @@ -414,31 +414,31 @@ void ceph_debugfs_client_init(struct ceph_client *client) · 20 unmodified lines | ||
| 414 | 414 | 0400, |
| 415 | 415 | client->debugfs_dir, |
| 416 | 416 | client, |
| 417 | − &monc_show_fops); | |
| 417 | + &monc_fops); | |
| 418 | 418 | |
| 419 | 419 | client->osdc.debugfs_file = debugfs_create_file("osdc", |
| 420 | 420 | 0400, |
| 421 | 421 | client->debugfs_dir, |
| 422 | 422 | client, |
| 423 | − &osdc_show_fops); | |
| 423 | + &osdc_fops); | |
| 424 | 424 | |
| 425 | 425 | client->debugfs_monmap = debugfs_create_file("monmap", |
| 426 | 426 | 0400, |
| 427 | 427 | client->debugfs_dir, |
| 428 | 428 | client, |
| 429 | − &monmap_show_fops); | |
| 429 | + &monmap_fops); | |
| 430 | 430 | |
| 431 | 431 | client->debugfs_osdmap = debugfs_create_file("osdmap", |
| 432 | 432 | 0400, |
| 433 | 433 | client->debugfs_dir, |
| 434 | 434 | client, |
| 435 | − &osdmap_show_fops); | |
| 435 | + &osdmap_fops); | |
| 436 | 436 | |
| 437 | 437 | client->debugfs_options = debugfs_create_file("client_options", |
| 438 | 438 | 0400, |
| 439 | 439 | client->debugfs_dir, |
| 440 | 440 | client, |
| 441 | − &client_options_show_fops); | |
| 441 | + &client_options_fops); | |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | void ceph_debugfs_client_cleanup(struct ceph_client *client) |