assert(conn->session); assert(conn->session->ts);
BUG_ON(!conn->session); BUG_ON(!conn->session->ts);
struct iscsi_cmnd *cmnd_alloc(struct iscsi_conn *conn, int req){	struct iscsi_cmnd *cmnd;	/* TODO: async interface is necessary ? */	cmnd = kmem_cache_alloc(iscsi_cmnd_cache, GFP_KERNEL | __GFP_NOFAIL);	memset(cmnd, 0, sizeof(*cmnd));	INIT_LIST_HEAD(&cmnd->list);	INIT_LIST_HEAD(&cmnd->pdu_list);	INIT_LIST_HEAD(&cmnd->conn_list);	INIT_LIST_HEAD(&cmnd->hash_list);	cmnd->conn = conn;	spin_lock(&conn->list_lock);	atomic_inc(&conn->nr_cmnds);	if (req)		list_add_tail(&cmnd->conn_list, &conn->pdu_list);	spin_unlock(&conn->list_lock);	cmnd->sg = NULL;	if (req) {		assert(conn->session);		assert(conn->session->ts);	}	dprintk(D_GENERIC, "%p:%p\n", conn, cmnd);	return cmnd;}