libiscsi.c (9000bcd649b26aef4c35d2941f8a65f05bbb9ee1) | libiscsi.c (c1635cb786dbadd16fd6e6959dd3b41ae2f2831a) |
---|---|
1/* 2 * iSCSI lib functions 3 * 4 * Copyright (C) 2006 Red Hat, Inc. All rights reserved. 5 * Copyright (C) 2004 - 2006 Mike Christie 6 * Copyright (C) 2004 - 2005 Dmitry Yusupov 7 * Copyright (C) 2004 - 2005 Alex Aizman 8 * maintained by open-iscsi@googlegroups.com --- 234 unchanged lines hidden (view full) --- 243 * @ctask: iscsi cmd task 244 * 245 * Must be called with session lock. 246 * This function returns the scsi command to scsi-ml and returns 247 * the cmd task to the pool of available cmd tasks. 248 */ 249static void iscsi_complete_command(struct iscsi_cmd_task *ctask) 250{ | 1/* 2 * iSCSI lib functions 3 * 4 * Copyright (C) 2006 Red Hat, Inc. All rights reserved. 5 * Copyright (C) 2004 - 2006 Mike Christie 6 * Copyright (C) 2004 - 2005 Dmitry Yusupov 7 * Copyright (C) 2004 - 2005 Alex Aizman 8 * maintained by open-iscsi@googlegroups.com --- 234 unchanged lines hidden (view full) --- 243 * @ctask: iscsi cmd task 244 * 245 * Must be called with session lock. 246 * This function returns the scsi command to scsi-ml and returns 247 * the cmd task to the pool of available cmd tasks. 248 */ 249static void iscsi_complete_command(struct iscsi_cmd_task *ctask) 250{ |
251 struct iscsi_session *session = ctask->conn->session; | 251 struct iscsi_conn *conn = ctask->conn; 252 struct iscsi_session *session = conn->session; |
252 struct scsi_cmnd *sc = ctask->sc; 253 254 ctask->state = ISCSI_TASK_COMPLETED; 255 ctask->sc = NULL; 256 /* SCSI eh reuses commands to verify us */ 257 sc->SCp.ptr = NULL; | 253 struct scsi_cmnd *sc = ctask->sc; 254 255 ctask->state = ISCSI_TASK_COMPLETED; 256 ctask->sc = NULL; 257 /* SCSI eh reuses commands to verify us */ 258 sc->SCp.ptr = NULL; |
259 if (conn->ctask == ctask) 260 conn->ctask = NULL; |
|
258 list_del_init(&ctask->running); 259 __kfifo_put(session->cmdpool.queue, (void*)&ctask, sizeof(void*)); 260 sc->scsi_done(sc); 261} 262 263static void __iscsi_get_ctask(struct iscsi_cmd_task *ctask) 264{ 265 atomic_inc(&ctask->refcount); --- 2199 unchanged lines hidden --- | 261 list_del_init(&ctask->running); 262 __kfifo_put(session->cmdpool.queue, (void*)&ctask, sizeof(void*)); 263 sc->scsi_done(sc); 264} 265 266static void __iscsi_get_ctask(struct iscsi_cmd_task *ctask) 267{ 268 atomic_inc(&ctask->refcount); --- 2199 unchanged lines hidden --- |