hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/net/ceph/debugfs.c
....@@ -46,7 +46,7 @@
4646
4747 seq_printf(s, "\t%s%lld\t%s\n",
4848 ENTITY_NAME(inst->name),
49
- ceph_pr_addr(&inst->addr.in_addr));
49
+ ceph_pr_addr(&inst->addr));
5050 }
5151 return 0;
5252 }
....@@ -81,11 +81,13 @@
8181 u32 state = map->osd_state[i];
8282 char sb[64];
8383
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),
8686 ((map->osd_weight[i]*100) >> 16),
8787 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));
8991 }
9092 for (n = rb_first(&map->pg_temp); n; n = rb_next(n)) {
9193 struct ceph_pg_mapping *pg =
....@@ -221,6 +223,9 @@
221223 if (op->op == CEPH_OSD_OP_WATCH)
222224 seq_printf(s, "-%s",
223225 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);
224229 }
225230
226231 seq_putc(s, '\n');
....@@ -375,7 +380,7 @@
375380 struct ceph_client *client = s->private;
376381 int ret;
377382
378
- ret = ceph_print_client_options(s, client);
383
+ ret = ceph_print_client_options(s, client, true);
379384 if (ret)
380385 return ret;
381386
....@@ -383,18 +388,15 @@
383388 return 0;
384389 }
385390
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);
391396
392
-int __init ceph_debugfs_init(void)
397
+void __init ceph_debugfs_init(void)
393398 {
394399 ceph_debugfs_dir = debugfs_create_dir("ceph", NULL);
395
- if (!ceph_debugfs_dir)
396
- return -ENOMEM;
397
- return 0;
398400 }
399401
400402 void ceph_debugfs_cleanup(void)
....@@ -402,9 +404,8 @@
402404 debugfs_remove(ceph_debugfs_dir);
403405 }
404406
405
-int ceph_debugfs_client_init(struct ceph_client *client)
407
+void ceph_debugfs_client_init(struct ceph_client *client)
406408 {
407
- int ret = -ENOMEM;
408409 char name[80];
409410
410411 snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
....@@ -412,56 +413,37 @@
412413
413414 dout("ceph_debugfs_client_init %p %s\n", client, name);
414415
415
- BUG_ON(client->debugfs_dir);
416416 client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
417
- if (!client->debugfs_dir)
418
- goto out;
419417
420418 client->monc.debugfs_file = debugfs_create_file("monc",
421419 0400,
422420 client->debugfs_dir,
423421 client,
424
- &monc_show_fops);
425
- if (!client->monc.debugfs_file)
426
- goto out;
422
+ &monc_fops);
427423
428424 client->osdc.debugfs_file = debugfs_create_file("osdc",
429425 0400,
430426 client->debugfs_dir,
431427 client,
432
- &osdc_show_fops);
433
- if (!client->osdc.debugfs_file)
434
- goto out;
428
+ &osdc_fops);
435429
436430 client->debugfs_monmap = debugfs_create_file("monmap",
437431 0400,
438432 client->debugfs_dir,
439433 client,
440
- &monmap_show_fops);
441
- if (!client->debugfs_monmap)
442
- goto out;
434
+ &monmap_fops);
443435
444436 client->debugfs_osdmap = debugfs_create_file("osdmap",
445437 0400,
446438 client->debugfs_dir,
447439 client,
448
- &osdmap_show_fops);
449
- if (!client->debugfs_osdmap)
450
- goto out;
440
+ &osdmap_fops);
451441
452442 client->debugfs_options = debugfs_create_file("client_options",
453443 0400,
454444 client->debugfs_dir,
455445 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);
465447 }
466448
467449 void ceph_debugfs_client_cleanup(struct ceph_client *client)
....@@ -477,18 +459,16 @@
477459
478460 #else /* CONFIG_DEBUG_FS */
479461
480
-int __init ceph_debugfs_init(void)
462
+void __init ceph_debugfs_init(void)
481463 {
482
- return 0;
483464 }
484465
485466 void ceph_debugfs_cleanup(void)
486467 {
487468 }
488469
489
-int ceph_debugfs_client_init(struct ceph_client *client)
470
+void ceph_debugfs_client_init(struct ceph_client *client)
490471 {
491
- return 0;
492472 }
493473
494474 void ceph_debugfs_client_cleanup(struct ceph_client *client)