aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/super.c40
-rw-r--r--include/linux/ceph/libceph.h1
-rw-r--r--net/ceph/ceph_common.c37
3 files changed, 53 insertions, 25 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 9f035ccb6191..34a779edd421 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -411,31 +411,20 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
411{ 411{
412 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); 412 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb);
413 struct ceph_mount_options *fsopt = fsc->mount_options; 413 struct ceph_mount_options *fsopt = fsc->mount_options;
414 struct ceph_options *opt = fsc->client->options; 414 size_t pos;
415 415 int ret;
416 if (opt->flags & CEPH_OPT_FSID) 416
417 seq_printf(m, ",fsid=%pU", &opt->fsid); 417 /* a comma between MNT/MS and client options */
418 if (opt->flags & CEPH_OPT_NOSHARE) 418 seq_putc(m, ',');
419 seq_puts(m, ",noshare"); 419 pos = m->count;
420 if (opt->flags & CEPH_OPT_NOCRC) 420
421 seq_puts(m, ",nocrc"); 421 ret = ceph_print_client_options(m, fsc->client);
422 if (opt->flags & CEPH_OPT_NOMSGAUTH) 422 if (ret)
423 seq_puts(m, ",nocephx_require_signatures"); 423 return ret;
424 if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0) 424
425 seq_puts(m, ",notcp_nodelay"); 425 /* retract our comma if no client options */
426 426 if (m->count == pos)
427 if (opt->name) 427 m->count--;
428 seq_printf(m, ",name=%s", opt->name);
429 if (opt->key)
430 seq_puts(m, ",secret=<hidden>");
431
432 if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT)
433 seq_printf(m, ",mount_timeout=%d", opt->mount_timeout);
434 if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT)
435 seq_printf(m, ",osd_idle_ttl=%d", opt->osd_idle_ttl);
436 if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT)
437 seq_printf(m, ",osdkeepalivetimeout=%d",
438 opt->osd_keepalive_timeout);
439 428
440 if (fsopt->flags & CEPH_MOUNT_OPT_DIRSTAT) 429 if (fsopt->flags & CEPH_MOUNT_OPT_DIRSTAT)
441 seq_puts(m, ",dirstat"); 430 seq_puts(m, ",dirstat");
@@ -482,6 +471,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
482 seq_printf(m, ",readdir_max_bytes=%d", fsopt->max_readdir_bytes); 471 seq_printf(m, ",readdir_max_bytes=%d", fsopt->max_readdir_bytes);
483 if (strcmp(fsopt->snapdir_name, CEPH_SNAPDIRNAME_DEFAULT)) 472 if (strcmp(fsopt->snapdir_name, CEPH_SNAPDIRNAME_DEFAULT))
484 seq_printf(m, ",snapdirname=%s", fsopt->snapdir_name); 473 seq_printf(m, ",snapdirname=%s", fsopt->snapdir_name);
474
485 return 0; 475 return 0;
486} 476}
487 477
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 16fff9608848..303be6ef7f94 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -191,6 +191,7 @@ extern struct ceph_options *ceph_parse_options(char *options,
191 const char *dev_name, const char *dev_name_end, 191 const char *dev_name, const char *dev_name_end,
192 int (*parse_extra_token)(char *c, void *private), 192 int (*parse_extra_token)(char *c, void *private),
193 void *private); 193 void *private);
194int ceph_print_client_options(struct seq_file *m, struct ceph_client *client);
194extern void ceph_destroy_options(struct ceph_options *opt); 195extern void ceph_destroy_options(struct ceph_options *opt);
195extern int ceph_compare_options(struct ceph_options *new_opt, 196extern int ceph_compare_options(struct ceph_options *new_opt,
196 struct ceph_client *client); 197 struct ceph_client *client);
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}
491EXPORT_SYMBOL(ceph_parse_options); 491EXPORT_SYMBOL(ceph_parse_options);
492 492
493int 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}
528EXPORT_SYMBOL(ceph_print_client_options);
529
493u64 ceph_client_id(struct ceph_client *client) 530u64 ceph_client_id(struct ceph_client *client)
494{ 531{
495 return client->monc.auth->global_id; 532 return client->monc.auth->global_id;