Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+18 -32
+8 -8
fs/ceph/debugfs.c
··· 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 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
-14
include/linux/ceph/debugfs.h
··· 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 - 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 6 21 7 /* debugfs.c */ 22 8 extern void ceph_debugfs_init(void);
+10 -10
net/ceph/debugfs.c
··· 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 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)