Lines Matching refs:opt
334 struct ceph_options *opt; in ceph_alloc_options() local
336 opt = kzalloc(sizeof(*opt), GFP_KERNEL); in ceph_alloc_options()
337 if (!opt) in ceph_alloc_options()
340 opt->crush_locs = RB_ROOT; in ceph_alloc_options()
341 opt->mon_addr = kcalloc(CEPH_MAX_MON, sizeof(*opt->mon_addr), in ceph_alloc_options()
343 if (!opt->mon_addr) { in ceph_alloc_options()
344 kfree(opt); in ceph_alloc_options()
348 opt->flags = CEPH_OPT_DEFAULT; in ceph_alloc_options()
349 opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT; in ceph_alloc_options()
350 opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; in ceph_alloc_options()
351 opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT; in ceph_alloc_options()
352 opt->osd_request_timeout = CEPH_OSD_REQUEST_TIMEOUT_DEFAULT; in ceph_alloc_options()
353 opt->read_from_replica = CEPH_READ_FROM_REPLICA_DEFAULT; in ceph_alloc_options()
354 opt->con_modes[0] = CEPH_CON_MODE_UNKNOWN; in ceph_alloc_options()
355 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN; in ceph_alloc_options()
356 return opt; in ceph_alloc_options()
360 void ceph_destroy_options(struct ceph_options *opt) in ceph_destroy_options() argument
362 dout("destroy_options %p\n", opt); in ceph_destroy_options()
363 if (!opt) in ceph_destroy_options()
366 ceph_clear_crush_locs(&opt->crush_locs); in ceph_destroy_options()
367 kfree(opt->name); in ceph_destroy_options()
368 if (opt->key) { in ceph_destroy_options()
369 ceph_crypto_key_destroy(opt->key); in ceph_destroy_options()
370 kfree(opt->key); in ceph_destroy_options()
372 kfree(opt->mon_addr); in ceph_destroy_options()
373 kfree(opt); in ceph_destroy_options()
424 int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt, in ceph_parse_mon_ips() argument
431 ret = ceph_parse_ips(buf, buf + len, opt->mon_addr, CEPH_MAX_MON, in ceph_parse_mon_ips()
432 &opt->num_mon); in ceph_parse_mon_ips()
442 int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, in ceph_parse_param() argument
458 &opt->my_addr, in ceph_parse_param()
464 opt->flags |= CEPH_OPT_MYIP; in ceph_parse_param()
468 err = parse_fsid(param->string, &opt->fsid); in ceph_parse_param()
473 opt->flags |= CEPH_OPT_FSID; in ceph_parse_param()
476 kfree(opt->name); in ceph_parse_param()
477 opt->name = param->string; in ceph_parse_param()
481 ceph_crypto_key_destroy(opt->key); in ceph_parse_param()
482 kfree(opt->key); in ceph_parse_param()
484 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); in ceph_parse_param()
485 if (!opt->key) in ceph_parse_param()
487 err = ceph_crypto_key_unarmor(opt->key, param->string); in ceph_parse_param()
494 ceph_crypto_key_destroy(opt->key); in ceph_parse_param()
495 kfree(opt->key); in ceph_parse_param()
497 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); in ceph_parse_param()
498 if (!opt->key) in ceph_parse_param()
500 return get_secret(opt->key, param->string, &log); in ceph_parse_param()
502 ceph_clear_crush_locs(&opt->crush_locs); in ceph_parse_param()
504 &opt->crush_locs); in ceph_parse_param()
514 opt->read_from_replica = 0; in ceph_parse_param()
517 opt->read_from_replica = CEPH_OSD_FLAG_BALANCE_READS; in ceph_parse_param()
520 opt->read_from_replica = CEPH_OSD_FLAG_LOCALIZE_READS; in ceph_parse_param()
529 opt->con_modes[0] = CEPH_CON_MODE_UNKNOWN; in ceph_parse_param()
530 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN; in ceph_parse_param()
533 opt->con_modes[0] = CEPH_CON_MODE_CRC; in ceph_parse_param()
534 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN; in ceph_parse_param()
537 opt->con_modes[0] = CEPH_CON_MODE_SECURE; in ceph_parse_param()
538 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN; in ceph_parse_param()
541 opt->con_modes[0] = CEPH_CON_MODE_CRC; in ceph_parse_param()
542 opt->con_modes[1] = CEPH_CON_MODE_SECURE; in ceph_parse_param()
545 opt->con_modes[0] = CEPH_CON_MODE_SECURE; in ceph_parse_param()
546 opt->con_modes[1] = CEPH_CON_MODE_CRC; in ceph_parse_param()
557 opt->osd_keepalive_timeout = in ceph_parse_param()
564 opt->osd_idle_ttl = msecs_to_jiffies(result.uint_32 * 1000); in ceph_parse_param()
570 opt->mount_timeout = msecs_to_jiffies(result.uint_32 * 1000); in ceph_parse_param()
576 opt->osd_request_timeout = in ceph_parse_param()
582 opt->flags &= ~CEPH_OPT_NOSHARE; in ceph_parse_param()
584 opt->flags |= CEPH_OPT_NOSHARE; in ceph_parse_param()
588 opt->flags &= ~CEPH_OPT_NOCRC; in ceph_parse_param()
590 opt->flags |= CEPH_OPT_NOCRC; in ceph_parse_param()
600 opt->flags &= ~CEPH_OPT_NOMSGSIGN; in ceph_parse_param()
602 opt->flags |= CEPH_OPT_NOMSGSIGN; in ceph_parse_param()
606 opt->flags |= CEPH_OPT_TCP_NODELAY; in ceph_parse_param()
608 opt->flags &= ~CEPH_OPT_TCP_NODELAY; in ceph_parse_param()
612 opt->flags |= CEPH_OPT_ABORT_ON_FULL; in ceph_parse_param()
629 struct ceph_options *opt = client->options; in ceph_print_client_options() local
633 if (opt->name) { in ceph_print_client_options()
635 seq_escape(m, opt->name, ", \t\n\\"); in ceph_print_client_options()
638 if (opt->key) in ceph_print_client_options()
641 if (!RB_EMPTY_ROOT(&opt->crush_locs)) { in ceph_print_client_options()
643 for (n = rb_first(&opt->crush_locs); ; ) { in ceph_print_client_options()
657 if (opt->read_from_replica == CEPH_OSD_FLAG_BALANCE_READS) { in ceph_print_client_options()
659 } else if (opt->read_from_replica == CEPH_OSD_FLAG_LOCALIZE_READS) { in ceph_print_client_options()
662 if (opt->con_modes[0] != CEPH_CON_MODE_UNKNOWN) { in ceph_print_client_options()
663 if (opt->con_modes[0] == CEPH_CON_MODE_CRC && in ceph_print_client_options()
664 opt->con_modes[1] == CEPH_CON_MODE_UNKNOWN) { in ceph_print_client_options()
666 } else if (opt->con_modes[0] == CEPH_CON_MODE_SECURE && in ceph_print_client_options()
667 opt->con_modes[1] == CEPH_CON_MODE_UNKNOWN) { in ceph_print_client_options()
669 } else if (opt->con_modes[0] == CEPH_CON_MODE_CRC && in ceph_print_client_options()
670 opt->con_modes[1] == CEPH_CON_MODE_SECURE) { in ceph_print_client_options()
672 } else if (opt->con_modes[0] == CEPH_CON_MODE_SECURE && in ceph_print_client_options()
673 opt->con_modes[1] == CEPH_CON_MODE_CRC) { in ceph_print_client_options()
678 if (opt->flags & CEPH_OPT_FSID) in ceph_print_client_options()
679 seq_printf(m, "fsid=%pU,", &opt->fsid); in ceph_print_client_options()
680 if (opt->flags & CEPH_OPT_NOSHARE) in ceph_print_client_options()
682 if (opt->flags & CEPH_OPT_NOCRC) in ceph_print_client_options()
684 if (opt->flags & CEPH_OPT_NOMSGSIGN) in ceph_print_client_options()
686 if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0) in ceph_print_client_options()
688 if (show_all && (opt->flags & CEPH_OPT_ABORT_ON_FULL)) in ceph_print_client_options()
691 if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT) in ceph_print_client_options()
693 jiffies_to_msecs(opt->mount_timeout) / 1000); in ceph_print_client_options()
694 if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT) in ceph_print_client_options()
696 jiffies_to_msecs(opt->osd_idle_ttl) / 1000); in ceph_print_client_options()
697 if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT) in ceph_print_client_options()
699 jiffies_to_msecs(opt->osd_keepalive_timeout) / 1000); in ceph_print_client_options()
700 if (opt->osd_request_timeout != CEPH_OSD_REQUEST_TIMEOUT_DEFAULT) in ceph_print_client_options()
702 jiffies_to_msecs(opt->osd_request_timeout) / 1000); in ceph_print_client_options()
727 struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private) in ceph_create_client() argument
742 client->options = opt; in ceph_create_client()