Lines Matching refs:lun

88 	uint64_t		 lun;
98 uint64_t lun;
149 struct ctl_lun *lun;
159 struct ctl_lun *lun;
164 STAILQ_FOREACH(lun, &softc->lun_list, links) {
165 mtx_lock(&lun->lun_lock);
166 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) {
170 TAILQ_REMOVE(&lun->tpc_lists, list, links);
173 mtx_unlock(&lun->lun_lock);
220 ctl_tpc_lun_init(struct ctl_lun *lun)
223 TAILQ_INIT(&lun->tpc_lists);
227 ctl_tpc_lun_clear(struct ctl_lun *lun, uint32_t initidx)
231 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) {
236 TAILQ_REMOVE(&lun->tpc_lists, list, links);
242 ctl_tpc_lun_shutdown(struct ctl_lun *lun)
244 struct ctl_softc *softc = lun->ctl_softc;
249 while ((list = TAILQ_FIRST(&lun->tpc_lists)) != NULL) {
250 TAILQ_REMOVE(&lun->tpc_lists, list, links);
259 if (token->lun != lun->lun || token->active)
271 struct ctl_lun *lun = CTL_LUN(ctsio);
311 if (lun != NULL)
313 lun->be_lun->lun_type;
502 tpc_find_list(struct ctl_lun *lun, uint32_t list_id, uint32_t init_idx)
506 mtx_assert(&lun->lun_lock, MA_OWNED);
507 TAILQ_FOREACH(list, &lun->tpc_lists, links) {
519 struct ctl_lun *lun = CTL_LUN(ctsio);
534 mtx_lock(&lun->lun_lock);
535 list = tpc_find_list(lun, list_id,
538 mtx_unlock(&lun->lun_lock);
547 TAILQ_REMOVE(&lun->tpc_lists, list, links);
550 mtx_unlock(&lun->lun_lock);
589 struct ctl_lun *lun = CTL_LUN(ctsio);
604 mtx_lock(&lun->lun_lock);
605 list = tpc_find_list(lun, list_id,
608 mtx_unlock(&lun->lun_lock);
616 TAILQ_REMOVE(&lun->tpc_lists, list, links);
618 mtx_unlock(&lun->lun_lock);
649 struct ctl_lun *lun = CTL_LUN(ctsio);
664 mtx_lock(&lun->lun_lock);
665 list = tpc_find_list(lun, list_id,
668 mtx_unlock(&lun->lun_lock);
677 TAILQ_REMOVE(&lun->tpc_lists, list, links);
680 mtx_unlock(&lun->lun_lock);
723 struct ctl_lun *lun = CTL_LUN(ctsio);
735 mtx_lock(&lun->lun_lock);
736 list = tpc_find_list(lun, list_id,
739 mtx_unlock(&lun->lun_lock);
747 mtx_unlock(&lun->lun_lock);
761 *ss = list->lun->be_lun->blocksize;
763 *pb = list->lun->be_lun->blocksize <<
764 list->lun->be_lun->pblockexp;
766 *pbo = list->lun->be_lun->blocksize *
767 list->lun->be_lun->pblockoff;
768 return (list->lun->lun);
772 return (tpcl_resolve(list->lun->ctl_softc,
930 tior->lun = sl;
951 tiow->lun = dl;
964 if (tpcl_queue(tior->io, tior->lun) != CTL_RETVAL_COMPLETE)
1026 tio->lun = sl;
1029 if (tpcl_queue(tio->io, tio->lun) != CTL_RETVAL_COMPLETE)
1092 tio->lun = dl;
1095 if (tpcl_queue(tio->io, tio->lun) != CTL_RETVAL_COMPLETE)
1214 dstblock = list->lun->be_lun->blocksize;
1215 pb = dstblock << list->lun->be_lun->pblockexp;
1216 if (list->lun->be_lun->pblockoff > 0)
1217 pbo = pb - dstblock * list->lun->be_lun->pblockoff;
1290 tior->lun = list->token->lun;
1309 tiow->lun = list->lun->lun;
1322 if (tpcl_queue(tior->io, tior->lun) != CTL_RETVAL_COMPLETE)
1368 dstblock = list->lun->be_lun->blocksize;
1393 tiow->lun = list->lun->lun;
1407 if (tpcl_queue(tiow->io, tiow->lun) != CTL_RETVAL_COMPLETE)
1418 struct ctl_lun *lun = list->lun;
1419 struct ctl_softc *softc = lun->ctl_softc;
1483 mtx_lock(&lun->lun_lock);
1485 TAILQ_REMOVE(&lun->tpc_lists, list, links);
1494 mtx_unlock(&lun->lun_lock);
1628 if (tpcl_queue(io, tio->lun) != CTL_RETVAL_COMPLETE) {
1653 if (tpcl_queue(tior->io, tior->lun) != CTL_RETVAL_COMPLETE)
1664 struct ctl_lun *lun = CTL_LUN(ctsio);
1734 value = dnvlist_get_string(lun->be_lun->options, "insecure_tpc", NULL);
1783 list->lun = lun;
1784 mtx_lock(&lun->lun_lock);
1786 tlist = tpc_find_list(lun, list->list_id, list->init_idx);
1788 mtx_unlock(&lun->lun_lock);
1796 TAILQ_REMOVE(&lun->tpc_lists, tlist, links);
1800 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links);
1801 mtx_unlock(&lun->lun_lock);
1818 struct ctl_lun *lun = CTL_LUN(ctsio);
1888 value = dnvlist_get_string(lun->be_lun->options, "insecure_tpc", NULL);
1937 list->lun = lun;
1938 mtx_lock(&lun->lun_lock);
1940 tlist = tpc_find_list(lun, list->list_id, list->init_idx);
1942 mtx_unlock(&lun->lun_lock);
1950 TAILQ_REMOVE(&lun->tpc_lists, tlist, links);
1954 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links);
1955 mtx_unlock(&lun->lun_lock);
1970 tpc_create_token(struct ctl_lun *lun, struct ctl_port *port, off_t len,
1982 if (lun->lun_devid)
1984 lun->lun_devid->data, lun->lun_devid->len,
1986 if (idd == NULL && lun->lun_devid)
1988 lun->lun_devid->data, lun->lun_devid->len,
1995 scsi_ulto3b(lun->be_lun->blocksize, cscd->dtsp.block_length);
2002 scsi_ulto4b(lun->be_lun->blocksize, dtsd->length);
2003 dtsd->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE;
2004 scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, dtsd->lalba_lbp);
2005 if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP)
2021 struct ctl_lun *lun = CTL_LUN(ctsio);
2103 lun->be_lun->maxlba, &lba) != 0) {
2123 list->lun = lun;
2124 mtx_lock(&lun->lun_lock);
2125 tlist = tpc_find_list(lun, list->list_id, list->init_idx);
2127 mtx_unlock(&lun->lun_lock);
2135 TAILQ_REMOVE(&lun->tpc_lists, tlist, links);
2138 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links);
2139 mtx_unlock(&lun->lun_lock);
2142 token->lun = lun->lun;
2143 token->blocksize = lun->be_lun->blocksize;
2149 list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize;
2150 tpc_create_token(lun, port, list->curbytes,
2184 struct ctl_lun *lun = CTL_LUN(ctsio);
2249 lun->be_lun->maxlba, &lba) != 0) {
2274 list->lun = lun;
2275 mtx_lock(&lun->lun_lock);
2276 tlist = tpc_find_list(lun, list->list_id, list->init_idx);
2278 mtx_unlock(&lun->lun_lock);
2286 TAILQ_REMOVE(&lun->tpc_lists, tlist, links);
2289 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links);
2290 mtx_unlock(&lun->lun_lock);
2312 mtx_lock(&lun->lun_lock);
2313 TAILQ_REMOVE(&lun->tpc_lists, list, links);
2314 mtx_unlock(&lun->lun_lock);
2337 struct ctl_lun *lun = CTL_LUN(ctsio);
2353 mtx_lock(&lun->lun_lock);
2354 list = tpc_find_list(lun, list_id,
2357 mtx_unlock(&lun->lun_lock);
2366 TAILQ_REMOVE(&lun->tpc_lists, list, links);
2369 mtx_unlock(&lun->lun_lock);