Lines Matching refs:lun

209 	struct se_lun *lun;
214 lun = deve->se_lun;
215 if (!lun) {
221 if (lun->lun_tpg->tpg_rtpi != rtpi)
288 struct se_lun *lun;
291 list_for_each_entry(lun, &dev->dev_sep_list, lun_dev_link) {
293 spin_lock(&lun->lun_deve_lock);
294 list_for_each_entry(se_deve, &lun->lun_deve_list, lun_link)
296 spin_unlock(&lun->lun_deve_lock);
318 struct se_lun *lun,
350 if (orig_lun != lun) {
351 pr_err("Existing orig->se_lun doesn't match new lun"
368 new->se_lun = lun;
374 spin_lock(&lun->lun_deve_lock);
376 list_add_tail(&new->lun_link, &lun->lun_deve_list);
377 spin_unlock(&lun->lun_deve_lock);
387 new->se_lun = lun;
392 spin_lock(&lun->lun_deve_lock);
393 list_add_tail(&new->lun_link, &lun->lun_deve_list);
394 spin_unlock(&lun->lun_deve_lock);
401 struct se_lun *lun,
410 struct se_device *dev = rcu_dereference_raw(lun->lun_se_dev);
416 * lun->lun_deve_list must be removed now before clearing the
423 * lun->lun_deve_list. This also means that active UAs and
427 spin_lock(&lun->lun_deve_lock);
429 spin_unlock(&lun->lun_deve_lock);
457 void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)
467 if (lun != deve->se_lun)
470 core_disable_device_list_for_node(lun, deve, nacl, tpg);
511 struct se_lun *lun)
515 rc = core_tpg_add_lun(tpg, lun, false, dev);
521 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
535 core_tpg_add_node_to_devs(acl, tpg, lun);
550 struct se_lun *lun)
554 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
557 core_tpg_remove_lun(tpg, lun);
590 struct se_lun *lun,
598 struct se_device *dev = rcu_dereference_raw(lun->lun_se_dev);
603 if (lun->lun_access_ro)
606 lacl->se_lun = lun;
608 if (core_enable_device_list_for_node(lun, lacl, lacl->mapped_lun,
614 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, lacl->mapped_lun,
621 core_scsi3_check_aptpl_registration(dev, tpg, lun, nacl,
627 struct se_lun *lun,
630 struct se_portal_group *tpg = lun->lun_tpg;
641 core_disable_device_list_for_node(lun, deve, nacl, tpg);
647 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,