Lines Matching refs:opt
310 struct ceph_options *opt;
312 opt = kzalloc(sizeof(*opt), GFP_KERNEL);
313 if (!opt)
316 opt->crush_locs = RB_ROOT;
317 opt->mon_addr = kcalloc(CEPH_MAX_MON, sizeof(*opt->mon_addr),
319 if (!opt->mon_addr) {
320 kfree(opt);
324 opt->flags = CEPH_OPT_DEFAULT;
325 opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
326 opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT;
327 opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT;
328 opt->osd_request_timeout = CEPH_OSD_REQUEST_TIMEOUT_DEFAULT;
329 opt->read_from_replica = CEPH_READ_FROM_REPLICA_DEFAULT;
330 opt->con_modes[0] = CEPH_CON_MODE_UNKNOWN;
331 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN;
332 return opt;
336 void ceph_destroy_options(struct ceph_options *opt)
338 dout("destroy_options %p\n", opt);
339 if (!opt)
342 ceph_clear_crush_locs(&opt->crush_locs);
343 kfree(opt->name);
344 if (opt->key) {
345 ceph_crypto_key_destroy(opt->key);
346 kfree(opt->key);
348 kfree(opt->mon_addr);
349 kfree(opt);
400 int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,
407 ret = ceph_parse_ips(buf, buf + len, opt->mon_addr, CEPH_MAX_MON,
408 &opt->num_mon, delim);
418 int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
434 &opt->my_addr, 1, NULL, ',');
439 opt->flags |= CEPH_OPT_MYIP;
443 err = ceph_parse_fsid(param->string, &opt->fsid);
448 opt->flags |= CEPH_OPT_FSID;
451 kfree(opt->name);
452 opt->name = param->string;
456 ceph_crypto_key_destroy(opt->key);
457 kfree(opt->key);
459 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
460 if (!opt->key)
462 err = ceph_crypto_key_unarmor(opt->key, param->string);
469 ceph_crypto_key_destroy(opt->key);
470 kfree(opt->key);
472 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
473 if (!opt->key)
475 return get_secret(opt->key, param->string, &log);
477 ceph_clear_crush_locs(&opt->crush_locs);
479 &opt->crush_locs);
489 opt->read_from_replica = 0;
492 opt->read_from_replica = CEPH_OSD_FLAG_BALANCE_READS;
495 opt->read_from_replica = CEPH_OSD_FLAG_LOCALIZE_READS;
504 opt->con_modes[0] = CEPH_CON_MODE_UNKNOWN;
505 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN;
508 opt->con_modes[0] = CEPH_CON_MODE_CRC;
509 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN;
512 opt->con_modes[0] = CEPH_CON_MODE_SECURE;
513 opt->con_modes[1] = CEPH_CON_MODE_UNKNOWN;
516 opt->con_modes[0] = CEPH_CON_MODE_CRC;
517 opt->con_modes[1] = CEPH_CON_MODE_SECURE;
520 opt->con_modes[0] = CEPH_CON_MODE_SECURE;
521 opt->con_modes[1] = CEPH_CON_MODE_CRC;
532 opt->osd_keepalive_timeout =
539 opt->osd_idle_ttl = msecs_to_jiffies(result.uint_32 * 1000);
545 opt->mount_timeout = msecs_to_jiffies(result.uint_32 * 1000);
551 opt->osd_request_timeout =
557 opt->flags &= ~CEPH_OPT_NOSHARE;
559 opt->flags |= CEPH_OPT_NOSHARE;
563 opt->flags &= ~CEPH_OPT_NOCRC;
565 opt->flags |= CEPH_OPT_NOCRC;
575 opt->flags &= ~CEPH_OPT_NOMSGSIGN;
577 opt->flags |= CEPH_OPT_NOMSGSIGN;
581 opt->flags |= CEPH_OPT_TCP_NODELAY;
583 opt->flags &= ~CEPH_OPT_TCP_NODELAY;
587 opt->flags |= CEPH_OPT_ABORT_ON_FULL;
590 opt->flags |= CEPH_OPT_RXBOUNCE;
607 struct ceph_options *opt = client->options;
611 if (opt->name) {
613 seq_escape(m, opt->name, ", \t\n\\");
616 if (opt->key)
619 if (!RB_EMPTY_ROOT(&opt->crush_locs)) {
621 for (n = rb_first(&opt->crush_locs); ; ) {
635 if (opt->read_from_replica == CEPH_OSD_FLAG_BALANCE_READS) {
637 } else if (opt->read_from_replica == CEPH_OSD_FLAG_LOCALIZE_READS) {
640 if (opt->con_modes[0] != CEPH_CON_MODE_UNKNOWN) {
641 if (opt->con_modes[0] == CEPH_CON_MODE_CRC &&
642 opt->con_modes[1] == CEPH_CON_MODE_UNKNOWN) {
644 } else if (opt->con_modes[0] == CEPH_CON_MODE_SECURE &&
645 opt->con_modes[1] == CEPH_CON_MODE_UNKNOWN) {
647 } else if (opt->con_modes[0] == CEPH_CON_MODE_CRC &&
648 opt->con_modes[1] == CEPH_CON_MODE_SECURE) {
650 } else if (opt->con_modes[0] == CEPH_CON_MODE_SECURE &&
651 opt->con_modes[1] == CEPH_CON_MODE_CRC) {
656 if (opt->flags & CEPH_OPT_FSID)
657 seq_printf(m, "fsid=%pU,", &opt->fsid);
658 if (opt->flags & CEPH_OPT_NOSHARE)
660 if (opt->flags & CEPH_OPT_NOCRC)
662 if (opt->flags & CEPH_OPT_NOMSGSIGN)
664 if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0)
666 if (show_all && (opt->flags & CEPH_OPT_ABORT_ON_FULL))
668 if (opt->flags & CEPH_OPT_RXBOUNCE)
671 if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT)
673 jiffies_to_msecs(opt->mount_timeout) / 1000);
674 if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT)
676 jiffies_to_msecs(opt->osd_idle_ttl) / 1000);
677 if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT)
679 jiffies_to_msecs(opt->osd_keepalive_timeout) / 1000);
680 if (opt->osd_request_timeout != CEPH_OSD_REQUEST_TIMEOUT_DEFAULT)
682 jiffies_to_msecs(opt->osd_request_timeout) / 1000);
707 struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private)
722 client->options = opt;