Lines Matching refs:opt

316 	struct ceph_options *opt;  in ceph_alloc_options()  local
318 opt = kzalloc(sizeof(*opt), GFP_KERNEL); in ceph_alloc_options()
319 if (!opt) in ceph_alloc_options()
322 opt->crush_locs = RB_ROOT; in ceph_alloc_options()
323 opt->mon_addr = kcalloc(CEPH_MAX_MON, sizeof(*opt->mon_addr), in ceph_alloc_options()
325 if (!opt->mon_addr) { in ceph_alloc_options()
326 kfree(opt); in ceph_alloc_options()
330 opt->flags = CEPH_OPT_DEFAULT; in ceph_alloc_options()
331 opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT; in ceph_alloc_options()
332 opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; in ceph_alloc_options()
333 opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT; in ceph_alloc_options()
334 opt->osd_request_timeout = CEPH_OSD_REQUEST_TIMEOUT_DEFAULT; in ceph_alloc_options()
335 opt->read_from_replica = CEPH_READ_FROM_REPLICA_DEFAULT; in ceph_alloc_options()
336 return opt; in ceph_alloc_options()
340 void ceph_destroy_options(struct ceph_options *opt) in ceph_destroy_options() argument
342 dout("destroy_options %p\n", opt); in ceph_destroy_options()
343 if (!opt) in ceph_destroy_options()
346 ceph_clear_crush_locs(&opt->crush_locs); in ceph_destroy_options()
347 kfree(opt->name); in ceph_destroy_options()
348 if (opt->key) { in ceph_destroy_options()
349 ceph_crypto_key_destroy(opt->key); in ceph_destroy_options()
350 kfree(opt->key); in ceph_destroy_options()
352 kfree(opt->mon_addr); in ceph_destroy_options()
353 kfree(opt); in ceph_destroy_options()
404 int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt, in ceph_parse_mon_ips() argument
411 ret = ceph_parse_ips(buf, buf + len, opt->mon_addr, CEPH_MAX_MON, in ceph_parse_mon_ips()
412 &opt->num_mon); in ceph_parse_mon_ips()
422 int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, in ceph_parse_param() argument
438 &opt->my_addr, in ceph_parse_param()
444 opt->flags |= CEPH_OPT_MYIP; in ceph_parse_param()
448 err = parse_fsid(param->string, &opt->fsid); in ceph_parse_param()
453 opt->flags |= CEPH_OPT_FSID; in ceph_parse_param()
456 kfree(opt->name); in ceph_parse_param()
457 opt->name = param->string; in ceph_parse_param()
461 ceph_crypto_key_destroy(opt->key); in ceph_parse_param()
462 kfree(opt->key); in ceph_parse_param()
464 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); in ceph_parse_param()
465 if (!opt->key) in ceph_parse_param()
467 err = ceph_crypto_key_unarmor(opt->key, param->string); in ceph_parse_param()
474 ceph_crypto_key_destroy(opt->key); in ceph_parse_param()
475 kfree(opt->key); in ceph_parse_param()
477 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); in ceph_parse_param()
478 if (!opt->key) in ceph_parse_param()
480 return get_secret(opt->key, param->string, &log); in ceph_parse_param()
482 ceph_clear_crush_locs(&opt->crush_locs); in ceph_parse_param()
484 &opt->crush_locs); in ceph_parse_param()
494 opt->read_from_replica = 0; in ceph_parse_param()
497 opt->read_from_replica = CEPH_OSD_FLAG_BALANCE_READS; in ceph_parse_param()
500 opt->read_from_replica = CEPH_OSD_FLAG_LOCALIZE_READS; in ceph_parse_param()
514 opt->osd_keepalive_timeout = in ceph_parse_param()
521 opt->osd_idle_ttl = msecs_to_jiffies(result.uint_32 * 1000); in ceph_parse_param()
527 opt->mount_timeout = msecs_to_jiffies(result.uint_32 * 1000); in ceph_parse_param()
533 opt->osd_request_timeout = in ceph_parse_param()
539 opt->flags &= ~CEPH_OPT_NOSHARE; in ceph_parse_param()
541 opt->flags |= CEPH_OPT_NOSHARE; in ceph_parse_param()
545 opt->flags &= ~CEPH_OPT_NOCRC; in ceph_parse_param()
547 opt->flags |= CEPH_OPT_NOCRC; in ceph_parse_param()
551 opt->flags &= ~CEPH_OPT_NOMSGAUTH; in ceph_parse_param()
553 opt->flags |= CEPH_OPT_NOMSGAUTH; in ceph_parse_param()
557 opt->flags &= ~CEPH_OPT_NOMSGSIGN; in ceph_parse_param()
559 opt->flags |= CEPH_OPT_NOMSGSIGN; in ceph_parse_param()
563 opt->flags |= CEPH_OPT_TCP_NODELAY; in ceph_parse_param()
565 opt->flags &= ~CEPH_OPT_TCP_NODELAY; in ceph_parse_param()
569 opt->flags |= CEPH_OPT_ABORT_ON_FULL; in ceph_parse_param()
586 struct ceph_options *opt = client->options; in ceph_print_client_options() local
590 if (opt->name) { in ceph_print_client_options()
592 seq_escape(m, opt->name, ", \t\n\\"); in ceph_print_client_options()
595 if (opt->key) in ceph_print_client_options()
598 if (!RB_EMPTY_ROOT(&opt->crush_locs)) { in ceph_print_client_options()
600 for (n = rb_first(&opt->crush_locs); ; ) { in ceph_print_client_options()
614 if (opt->read_from_replica == CEPH_OSD_FLAG_BALANCE_READS) { in ceph_print_client_options()
616 } else if (opt->read_from_replica == CEPH_OSD_FLAG_LOCALIZE_READS) { in ceph_print_client_options()
620 if (opt->flags & CEPH_OPT_FSID) in ceph_print_client_options()
621 seq_printf(m, "fsid=%pU,", &opt->fsid); in ceph_print_client_options()
622 if (opt->flags & CEPH_OPT_NOSHARE) in ceph_print_client_options()
624 if (opt->flags & CEPH_OPT_NOCRC) in ceph_print_client_options()
626 if (opt->flags & CEPH_OPT_NOMSGAUTH) in ceph_print_client_options()
628 if (opt->flags & CEPH_OPT_NOMSGSIGN) in ceph_print_client_options()
630 if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0) in ceph_print_client_options()
632 if (show_all && (opt->flags & CEPH_OPT_ABORT_ON_FULL)) in ceph_print_client_options()
635 if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT) in ceph_print_client_options()
637 jiffies_to_msecs(opt->mount_timeout) / 1000); in ceph_print_client_options()
638 if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT) in ceph_print_client_options()
640 jiffies_to_msecs(opt->osd_idle_ttl) / 1000); in ceph_print_client_options()
641 if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT) in ceph_print_client_options()
643 jiffies_to_msecs(opt->osd_keepalive_timeout) / 1000); in ceph_print_client_options()
644 if (opt->osd_request_timeout != CEPH_OSD_REQUEST_TIMEOUT_DEFAULT) in ceph_print_client_options()
646 jiffies_to_msecs(opt->osd_request_timeout) / 1000); in ceph_print_client_options()
671 struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private) in ceph_create_client() argument
686 client->options = opt; in ceph_create_client()