Lines Matching defs:be_lun

404 			 struct ctl_be_lun *be_lun);
406 static void ctl_create_lun(struct ctl_be_lun *be_lun);
3234 lun->be_lun->lun_type);
3247 (lun->be_lun->maxlba > 0) ?
3248 lun->be_lun->maxlba + 1 : 0);
3254 lun->be_lun->blocksize);
3265 lun->be_lun->serial_num,
3266 sizeof(lun->be_lun->serial_num));
3282 lun->be_lun->device_id,
3283 sizeof(lun->be_lun->device_id));
3294 retval = lun->backend->lun_info(lun->be_lun->be_lun, sb);
3298 STAILQ_FOREACH(opt, &lun->be_lun->options, links) {
4067 if ((lun->be_lun->lun_type != T_DIRECT)
4116 scsi_ulto2b(lun->be_lun->blocksize,
4121 scsi_ulto2b(lun->be_lun->blocksize,
4126 scsi_ulto2b(lun->be_lun->blocksize,
4179 cylinders = (lun->be_lun->maxlba + 1) /
4186 cylinders = (lun->be_lun->maxlba + 1) >> shift;
4201 if ((value = ctl_get_opt(&lun->be_lun->options,
4235 value = ctl_get_opt(&lun->be_lun->options, "writecache");
4238 value = ctl_get_opt(&lun->be_lun->options, "readcache");
4266 value = ctl_get_opt(&lun->be_lun->options, "reordering");
4310 value = ctl_get_opt(&lun->be_lun->options,
4316 if (lun->be_lun->blocksize)
4317 ival /= lun->be_lun->blocksize;
4323 value = ctl_get_opt(&lun->be_lun->options,
4329 if (lun->be_lun->blocksize)
4330 ival /= lun->be_lun->blocksize;
4336 value = ctl_get_opt(&lun->be_lun->options,
4342 if (lun->be_lun->blocksize)
4343 ival /= lun->be_lun->blocksize;
4349 value = ctl_get_opt(&lun->be_lun->options,
4355 if (lun->be_lun->blocksize)
4356 ival /= lun->be_lun->blocksize;
4441 if ((lun->be_lun->lun_type != T_DIRECT)
4507 * - be_lun is set if the LUN has a backend (needed for disk LUNs)
4513 struct ctl_be_lun *const be_lun)
4522 if (be_lun == NULL)
4528 switch (be_lun->lun_type) {
4536 be_lun->lun_config_status(be_lun->be_lun,
4554 strnlen(be_lun->device_id, CTL_DEVID_LEN));
4557 scsiname = ctl_get_opt(&be_lun->options, "scsiname");
4562 eui = ctl_get_opt(&be_lun->options, "eui");
4566 naa = ctl_get_opt(&be_lun->options, "naa");
4578 if ((vendor = ctl_get_opt(&be_lun->options, "vendor")) == NULL) {
4585 (char *)be_lun->device_id, devidlen);
4623 if (be_lun->flags & CTL_LUN_FLAG_ID_REQ) {
4624 if ((be_lun->req_lun_id > (CTL_MAX_LUNS - 1))
4625 || (ctl_is_set(ctl_softc->ctl_lun_mask, be_lun->req_lun_id))) {
4627 if (be_lun->req_lun_id > (CTL_MAX_LUNS - 1)) {
4630 be_lun->req_lun_id, CTL_MAX_LUNS - 1);
4637 "in use\n", be_lun->req_lun_id);
4641 be_lun->lun_config_status(be_lun->be_lun,
4645 lun_number = be_lun->req_lun_id;
4653 be_lun->lun_config_status(be_lun->be_lun,
4662 lun->be_lun = be_lun;
4668 lun->backend = be_lun->be;
4669 be_lun->ctl_lun = lun;
4670 be_lun->lun_id = lun_number;
4671 atomic_add_int(&be_lun->be->num_luns, 1);
4672 if (be_lun->flags & CTL_LUN_FLAG_OFFLINE)
4675 if (be_lun->flags & CTL_LUN_FLAG_POWERED_OFF)
4678 if (be_lun->flags & CTL_LUN_FLAG_INOPERABLE)
4681 if (be_lun->flags & CTL_LUN_FLAG_PRIMARY)
4684 value = ctl_get_opt(&be_lun->options, "readonly");
4689 if (be_lun->flags & CTL_LUN_FLAG_SERSEQ_READ)
4691 value = ctl_get_opt(&be_lun->options, "serseq");
4731 lun->stats.device_type = be_lun->lun_type;
4734 lun->stats.blocksize = be_lun->blocksize;
4742 lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK);
4777 atomic_subtract_int(&lun->be_lun->be->num_luns, 1);
4778 lun->be_lun->lun_shutdown(lun->be_lun->be_lun);
4801 ctl_create_lun(struct ctl_be_lun *be_lun)
4810 ctl_alloc_lun(softc, NULL, be_lun);
4814 ctl_add_lun(struct ctl_be_lun *be_lun)
4819 STAILQ_INSERT_TAIL(&softc->pending_lun_queue, be_lun, links);
4827 ctl_enable_lun(struct ctl_be_lun *be_lun)
4834 lun = (struct ctl_lun *)be_lun->ctl_lun;
4879 ctl_disable_lun(struct ctl_be_lun *be_lun)
4886 lun = (struct ctl_lun *)be_lun->ctl_lun;
4927 ctl_start_lun(struct ctl_be_lun *be_lun)
4929 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
4938 ctl_stop_lun(struct ctl_be_lun *be_lun)
4940 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
4949 ctl_lun_offline(struct ctl_be_lun *be_lun)
4951 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
4960 ctl_lun_online(struct ctl_be_lun *be_lun)
4962 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
4971 ctl_invalidate_lun(struct ctl_be_lun *be_lun)
4976 lun = (struct ctl_lun *)be_lun->ctl_lun;
5010 ctl_lun_inoperable(struct ctl_be_lun *be_lun)
5012 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
5021 ctl_lun_operable(struct ctl_be_lun *be_lun)
5023 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
5032 ctl_lun_capacity_changed(struct ctl_be_lun *be_lun)
5034 struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun;
5552 if ((starting_lba + block_count) > (lun->be_lun->maxlba + 1)) {
5880 if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
5889 if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) {
5899 num_blocks = (lun->be_lun->maxlba + 1) - lba;
5902 len = lun->be_lun->blocksize;
5995 if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
6226 if (lun->be_lun->lun_type != T_DIRECT)
6459 if (lun->be_lun->lun_type != T_DIRECT)
6606 if (lun->be_lun->lun_type != T_DIRECT)
6828 scsi_ulto3b(lun->be_lun->blocksize,
6937 (val = lun->backend->lun_attr(lun->be_lun->be_lun, "blocksavail"))
6950 (val = lun->backend->lun_attr(lun->be_lun->be_lun, "blocksused"))
6963 (val = lun->backend->lun_attr(lun->be_lun->be_lun, "poolblocksavail"))
6976 (val = lun->backend->lun_attr(lun->be_lun->be_lun, "poolblocksused"))
7178 if (lun->be_lun->maxlba > 0xfffffffe)
7181 scsi_ulto4b(lun->be_lun->maxlba, data->addr);
7186 scsi_ulto4b(lun->be_lun->blocksize, data->length);
7241 scsi_u64to8b(lun->be_lun->maxlba, data->addr);
7243 scsi_ulto4b(lun->be_lun->blocksize, data->length);
7244 data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE;
7245 scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp);
7246 if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP)
7274 if (lba > lun->be_lun->maxlba) {
7300 scsi_ulto4b(MIN(UINT32_MAX, lun->be_lun->maxlba + 1 - lba),
7553 lun->be_lun->lun_type, sentry))
7557 if (ctl_cmd_applicable(lun->be_lun->lun_type,
7633 lun->be_lun->lun_type, sentry))
7643 if (!ctl_cmd_applicable(lun->be_lun->lun_type,
7669 if (ctl_cmd_applicable(lun->be_lun->lun_type, entry)) {
9023 if (lun->be_lun->atomicblock == 0) {
9036 if (num_blocks > lun->be_lun->atomicblock) {
9074 if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
9109 ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize;
9188 if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
9209 ctsio->kern_total_len = 2 * num_blocks * lun->be_lun->blocksize;
9302 if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
9324 ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize;
9732 lun->be_lun->lun_type;
9751 if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) {
9803 lun->be_lun->lun_type;
9815 (char *)lun->be_lun->serial_num, CTL_SN_LEN);
9863 lun->be_lun->lun_type;
9936 lun->be_lun->lun_type;
10006 lun->be_lun->lun_type;
10139 lun->be_lun->lun_type;
10221 lun->be_lun->lun_type;
10230 bs = lun->be_lun->blocksize;
10231 scsi_ulto4b(lun->be_lun->opttxferlen, bl_ptr->opt_txfer_len);
10232 if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
10235 if (lun->be_lun->ublockexp != 0) {
10236 scsi_ulto4b((1 << lun->be_lun->ublockexp),
10238 scsi_ulto4b(0x80000000 | lun->be_lun->ublockoff,
10242 scsi_ulto4b(lun->be_lun->atomicblock,
10290 lun->be_lun->lun_type;
10296 (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL)
10302 (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL)
10348 lun->be_lun->lun_type;
10355 if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
10405 if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
10410 if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
10415 if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
10532 lun->be_lun->lun_type;
10581 || (lun->be_lun->lun_type != T_PROCESSOR))
10588 if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
10599 } else if ((val = ctl_get_opt(&lun->be_lun->options, "product")) == NULL) {
10600 switch (lun->be_lun->lun_type) {
10624 if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
10665 switch (lun->be_lun->lun_type) {
11407 if (lun->be_lun->lun_type == T_PROCESSOR)
11654 lun->be_lun;
11655 if (lun->be_lun->lun_type == T_PROCESSOR) {
11711 if (!ctl_cmd_applicable(lun->be_lun->lun_type, entry)) {
14107 struct ctl_be_lun *be_lun;
14115 be_lun = STAILQ_FIRST(&softc->pending_lun_queue);
14116 if (be_lun != NULL) {
14119 ctl_create_lun(be_lun);
14134 struct ctl_be_lun *be_lun;
14146 be_lun = lun->be_lun;
14179 lun->be_lun->be_lun, attr);