Lines Matching refs:lun

175 	if (strcmp(name, "lun") == 0) {
177 log_errx(1, "%s: improper lun element nesting",
250 } else if (strcmp(name, "lun") == 0) {
408 struct lun *cl;
412 struct cctl_lun *lun;
603 STAILQ_FOREACH(lun, &devlist.lun_list, links) {
606 if (lun->ctld_name == NULL) {
607 log_debugx("CTL lun %ju wasn't managed by ctld; "
608 "ignoring", (uintmax_t)lun->lun_id);
612 cl = lun_find(conf, lun->ctld_name);
614 log_warnx("found CTL lun %ju \"%s\", "
615 "also backed by CTL lun %d; ignoring",
616 (uintmax_t)lun->lun_id, lun->ctld_name,
621 log_debugx("found CTL lun %ju \"%s\"",
622 (uintmax_t)lun->lun_id, lun->ctld_name);
624 cl = lun_new(conf, lun->ctld_name);
629 lun_set_backend(cl, lun->backend_type);
630 lun_set_device_type(cl, lun->device_type);
631 lun_set_blocksize(cl, lun->blocksize);
632 lun_set_device_id(cl, lun->device_id);
633 lun_set_serial(cl, lun->serial_number);
634 lun_set_size(cl, lun->size_blocks * cl->l_blocksize);
635 lun_set_ctl_lun(cl, lun->lun_id);
637 STAILQ_FOREACH(nv, &lun->attr_list, links) {
645 log_warnx("unable to add CTL lun option %s "
646 "for CTL lun %ju \"%s\"",
647 nv->name, (uintmax_t) lun->lun_id,
667 kernel_lun_add(struct lun *lun)
675 strlcpy(req.backend, lun->l_backend, sizeof(req.backend));
678 req.reqdata.create.blocksize_bytes = lun->l_blocksize;
680 if (lun->l_size != 0)
681 req.reqdata.create.lun_size_bytes = lun->l_size;
683 if (lun->l_ctl_lun >= 0) {
684 req.reqdata.create.req_lun_id = lun->l_ctl_lun;
689 req.reqdata.create.device_type = lun->l_device_type;
691 if (lun->l_serial != NULL) {
692 strncpy(req.reqdata.create.serial_num, lun->l_serial,
697 if (lun->l_device_id != NULL) {
698 strncpy(req.reqdata.create.device_id, lun->l_device_id,
703 if (lun->l_path != NULL) {
704 o = option_find(&lun->l_options, "file");
706 option_set(o, lun->l_path);
708 o = option_new(&lun->l_options, "file", lun->l_path);
713 o = option_find(&lun->l_options, "ctld_name");
715 option_set(o, lun->l_name);
717 o = option_new(&lun->l_options, "ctld_name", lun->l_name);
721 o = option_find(&lun->l_options, "scsiname");
722 if (o == NULL && lun->l_scsiname != NULL) {
723 o = option_new(&lun->l_options, "scsiname", lun->l_scsiname);
728 TAILQ_FOREACH(o, &lun->l_options, o_next)
741 TAILQ_FOREACH(o, &lun->l_options, o_next) {
770 lun_set_ctl_lun(lun, req.reqdata.create.req_lun_id);
775 kernel_lun_modify(struct lun *lun)
783 strlcpy(req.backend, lun->l_backend, sizeof(req.backend));
786 req.reqdata.modify.lun_id = lun->l_ctl_lun;
787 req.reqdata.modify.lun_size_bytes = lun->l_size;
790 TAILQ_FOREACH(o, &lun->l_options, o_next)
803 TAILQ_FOREACH(o, &lun->l_options, o_next) {
836 kernel_lun_remove(struct lun *lun)
842 strlcpy(req.backend, lun->l_backend, sizeof(req.backend));
845 req.reqdata.rm.lun_id = lun->l_ctl_lun;
1032 lm.lun = 0;
1043 lm.lun = targ->t_luns[i]->l_ctl_lun;
1075 lm.lun = UINT32_MAX;
1077 lm.lun = targ->t_luns[i]->l_ctl_lun;
1082 if (lm.lun == olun)
1143 lm.lun = UINT32_MAX;