diff options
Diffstat (limited to 'net/ceph/ceph_common.c')
-rw-r--r-- | net/ceph/ceph_common.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index ec565508e904..79e8f71aef5b 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c | |||
@@ -490,6 +490,43 @@ out: | |||
490 | } | 490 | } |
491 | EXPORT_SYMBOL(ceph_parse_options); | 491 | EXPORT_SYMBOL(ceph_parse_options); |
492 | 492 | ||
493 | int ceph_print_client_options(struct seq_file *m, struct ceph_client *client) | ||
494 | { | ||
495 | struct ceph_options *opt = client->options; | ||
496 | size_t pos = m->count; | ||
497 | |||
498 | if (opt->name) | ||
499 | seq_printf(m, "name=%s,", opt->name); | ||
500 | if (opt->key) | ||
501 | seq_puts(m, "secret=<hidden>,"); | ||
502 | |||
503 | if (opt->flags & CEPH_OPT_FSID) | ||
504 | seq_printf(m, "fsid=%pU,", &opt->fsid); | ||
505 | if (opt->flags & CEPH_OPT_NOSHARE) | ||
506 | seq_puts(m, "noshare,"); | ||
507 | if (opt->flags & CEPH_OPT_NOCRC) | ||
508 | seq_puts(m, "nocrc,"); | ||
509 | if (opt->flags & CEPH_OPT_NOMSGAUTH) | ||
510 | seq_puts(m, "nocephx_require_signatures,"); | ||
511 | if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0) | ||
512 | seq_puts(m, "notcp_nodelay,"); | ||
513 | |||
514 | if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT) | ||
515 | seq_printf(m, "mount_timeout=%d,", opt->mount_timeout); | ||
516 | if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT) | ||
517 | seq_printf(m, "osd_idle_ttl=%d,", opt->osd_idle_ttl); | ||
518 | if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT) | ||
519 | seq_printf(m, "osdkeepalivetimeout=%d,", | ||
520 | opt->osd_keepalive_timeout); | ||
521 | |||
522 | /* drop redundant comma */ | ||
523 | if (m->count != pos) | ||
524 | m->count--; | ||
525 | |||
526 | return 0; | ||
527 | } | ||
528 | EXPORT_SYMBOL(ceph_print_client_options); | ||
529 | |||
493 | u64 ceph_client_id(struct ceph_client *client) | 530 | u64 ceph_client_id(struct ceph_client *client) |
494 | { | 531 | { |
495 | return client->monc.auth->global_id; | 532 | return client->monc.auth->global_id; |