.. | .. |
---|
46 | 46 | |
---|
47 | 47 | seq_printf(s, "\t%s%lld\t%s\n", |
---|
48 | 48 | ENTITY_NAME(inst->name), |
---|
49 | | - ceph_pr_addr(&inst->addr.in_addr)); |
---|
| 49 | + ceph_pr_addr(&inst->addr)); |
---|
50 | 50 | } |
---|
51 | 51 | return 0; |
---|
52 | 52 | } |
---|
.. | .. |
---|
81 | 81 | u32 state = map->osd_state[i]; |
---|
82 | 82 | char sb[64]; |
---|
83 | 83 | |
---|
84 | | - seq_printf(s, "osd%d\t%s\t%3d%%\t(%s)\t%3d%%\n", |
---|
85 | | - i, ceph_pr_addr(&addr->in_addr), |
---|
| 84 | + seq_printf(s, "osd%d\t%s\t%3d%%\t(%s)\t%3d%%\t%2d\n", |
---|
| 85 | + i, ceph_pr_addr(addr), |
---|
86 | 86 | ((map->osd_weight[i]*100) >> 16), |
---|
87 | 87 | ceph_osdmap_state_str(sb, sizeof(sb), state), |
---|
88 | | - ((ceph_get_primary_affinity(map, i)*100) >> 16)); |
---|
| 88 | + ((ceph_get_primary_affinity(map, i)*100) >> 16), |
---|
| 89 | + ceph_get_crush_locality(map, i, |
---|
| 90 | + &client->options->crush_locs)); |
---|
89 | 91 | } |
---|
90 | 92 | for (n = rb_first(&map->pg_temp); n; n = rb_next(n)) { |
---|
91 | 93 | struct ceph_pg_mapping *pg = |
---|
.. | .. |
---|
221 | 223 | if (op->op == CEPH_OSD_OP_WATCH) |
---|
222 | 224 | seq_printf(s, "-%s", |
---|
223 | 225 | ceph_osd_watch_op_name(op->watch.op)); |
---|
| 226 | + else if (op->op == CEPH_OSD_OP_CALL) |
---|
| 227 | + seq_printf(s, "-%s/%s", op->cls.class_name, |
---|
| 228 | + op->cls.method_name); |
---|
224 | 229 | } |
---|
225 | 230 | |
---|
226 | 231 | seq_putc(s, '\n'); |
---|
.. | .. |
---|
375 | 380 | struct ceph_client *client = s->private; |
---|
376 | 381 | int ret; |
---|
377 | 382 | |
---|
378 | | - ret = ceph_print_client_options(s, client); |
---|
| 383 | + ret = ceph_print_client_options(s, client, true); |
---|
379 | 384 | if (ret) |
---|
380 | 385 | return ret; |
---|
381 | 386 | |
---|
.. | .. |
---|
383 | 388 | return 0; |
---|
384 | 389 | } |
---|
385 | 390 | |
---|
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) |
---|
| 391 | +DEFINE_SHOW_ATTRIBUTE(monmap); |
---|
| 392 | +DEFINE_SHOW_ATTRIBUTE(osdmap); |
---|
| 393 | +DEFINE_SHOW_ATTRIBUTE(monc); |
---|
| 394 | +DEFINE_SHOW_ATTRIBUTE(osdc); |
---|
| 395 | +DEFINE_SHOW_ATTRIBUTE(client_options); |
---|
391 | 396 | |
---|
392 | | -int __init ceph_debugfs_init(void) |
---|
| 397 | +void __init ceph_debugfs_init(void) |
---|
393 | 398 | { |
---|
394 | 399 | ceph_debugfs_dir = debugfs_create_dir("ceph", NULL); |
---|
395 | | - if (!ceph_debugfs_dir) |
---|
396 | | - return -ENOMEM; |
---|
397 | | - return 0; |
---|
398 | 400 | } |
---|
399 | 401 | |
---|
400 | 402 | void ceph_debugfs_cleanup(void) |
---|
.. | .. |
---|
402 | 404 | debugfs_remove(ceph_debugfs_dir); |
---|
403 | 405 | } |
---|
404 | 406 | |
---|
405 | | -int ceph_debugfs_client_init(struct ceph_client *client) |
---|
| 407 | +void ceph_debugfs_client_init(struct ceph_client *client) |
---|
406 | 408 | { |
---|
407 | | - int ret = -ENOMEM; |
---|
408 | 409 | char name[80]; |
---|
409 | 410 | |
---|
410 | 411 | snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid, |
---|
.. | .. |
---|
412 | 413 | |
---|
413 | 414 | dout("ceph_debugfs_client_init %p %s\n", client, name); |
---|
414 | 415 | |
---|
415 | | - BUG_ON(client->debugfs_dir); |
---|
416 | 416 | client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir); |
---|
417 | | - if (!client->debugfs_dir) |
---|
418 | | - goto out; |
---|
419 | 417 | |
---|
420 | 418 | client->monc.debugfs_file = debugfs_create_file("monc", |
---|
421 | 419 | 0400, |
---|
422 | 420 | client->debugfs_dir, |
---|
423 | 421 | client, |
---|
424 | | - &monc_show_fops); |
---|
425 | | - if (!client->monc.debugfs_file) |
---|
426 | | - goto out; |
---|
| 422 | + &monc_fops); |
---|
427 | 423 | |
---|
428 | 424 | client->osdc.debugfs_file = debugfs_create_file("osdc", |
---|
429 | 425 | 0400, |
---|
430 | 426 | client->debugfs_dir, |
---|
431 | 427 | client, |
---|
432 | | - &osdc_show_fops); |
---|
433 | | - if (!client->osdc.debugfs_file) |
---|
434 | | - goto out; |
---|
| 428 | + &osdc_fops); |
---|
435 | 429 | |
---|
436 | 430 | client->debugfs_monmap = debugfs_create_file("monmap", |
---|
437 | 431 | 0400, |
---|
438 | 432 | client->debugfs_dir, |
---|
439 | 433 | client, |
---|
440 | | - &monmap_show_fops); |
---|
441 | | - if (!client->debugfs_monmap) |
---|
442 | | - goto out; |
---|
| 434 | + &monmap_fops); |
---|
443 | 435 | |
---|
444 | 436 | client->debugfs_osdmap = debugfs_create_file("osdmap", |
---|
445 | 437 | 0400, |
---|
446 | 438 | client->debugfs_dir, |
---|
447 | 439 | client, |
---|
448 | | - &osdmap_show_fops); |
---|
449 | | - if (!client->debugfs_osdmap) |
---|
450 | | - goto out; |
---|
| 440 | + &osdmap_fops); |
---|
451 | 441 | |
---|
452 | 442 | client->debugfs_options = debugfs_create_file("client_options", |
---|
453 | 443 | 0400, |
---|
454 | 444 | client->debugfs_dir, |
---|
455 | 445 | client, |
---|
456 | | - &client_options_show_fops); |
---|
457 | | - if (!client->debugfs_options) |
---|
458 | | - goto out; |
---|
459 | | - |
---|
460 | | - return 0; |
---|
461 | | - |
---|
462 | | -out: |
---|
463 | | - ceph_debugfs_client_cleanup(client); |
---|
464 | | - return ret; |
---|
| 446 | + &client_options_fops); |
---|
465 | 447 | } |
---|
466 | 448 | |
---|
467 | 449 | void ceph_debugfs_client_cleanup(struct ceph_client *client) |
---|
.. | .. |
---|
477 | 459 | |
---|
478 | 460 | #else /* CONFIG_DEBUG_FS */ |
---|
479 | 461 | |
---|
480 | | -int __init ceph_debugfs_init(void) |
---|
| 462 | +void __init ceph_debugfs_init(void) |
---|
481 | 463 | { |
---|
482 | | - return 0; |
---|
483 | 464 | } |
---|
484 | 465 | |
---|
485 | 466 | void ceph_debugfs_cleanup(void) |
---|
486 | 467 | { |
---|
487 | 468 | } |
---|
488 | 469 | |
---|
489 | | -int ceph_debugfs_client_init(struct ceph_client *client) |
---|
| 470 | +void ceph_debugfs_client_init(struct ceph_client *client) |
---|
490 | 471 | { |
---|
491 | | - return 0; |
---|
492 | 472 | } |
---|
493 | 473 | |
---|
494 | 474 | void ceph_debugfs_client_cleanup(struct ceph_client *client) |
---|