Beispiel #1
0
static void tcm_loop_port_unlink(
    struct se_portal_group *se_tpg,
    struct se_lun *se_lun)
{
    struct scsi_device *sd;
    struct tcm_loop_hba *tl_hba;
    struct tcm_loop_tpg *tl_tpg;

    tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg);
    tl_hba = tl_tpg->tl_hba;

    sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
                            se_lun->unpacked_lun);
    if (!sd) {
        pr_err("Unable to locate struct scsi_device for %d:%d:"
               "%d\n", 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun);
        return;
    }
    /*
     * Remove Linux/SCSI struct scsi_device by HCTL
     */
    scsi_remove_device(sd);
    scsi_device_put(sd);

    atomic_dec(&tl_tpg->tl_tpg_port_count);
    smp_mb__after_atomic_dec();

    pr_debug("TCM_Loop_ConfigFS: Port Unlink Successful\n");
}
Beispiel #2
0
static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo)
{
	if (bo->ttm) {
		ttm_tt_unbind(bo->ttm);
		ttm_tt_destroy(bo->ttm);
		bo->ttm = NULL;
	}
	ttm_bo_mem_put(bo, &bo->mem);

	atomic_set(&bo->reserved, 0);

	/*
	 * Make processes trying to reserve really pick it up.
	 */
	smp_mb__after_atomic_dec();
	wake_up_all(&bo->event_queue);
}