aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2009-09-04 22:04:23 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-12 10:35:33 -0400
commit4c0ba5d2593b5156327263f3ef6d7399dc0717b8 (patch)
tree2870f60c768f004f54aaf9d140612667edea4100 /drivers/scsi/libiscsi.c
parentdd784edcfc080fb4c83f1f3d10d905c5ab61616f (diff)
[SCSI] libiscsi: add completion function for drivers that do not need pdu processing
beiscsi does not need the iscsi scsi cmd processing. It does not even get this info on the completion path. This adds a function to just update the sequencing numbers and complete a task. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index a7ee4bb40708..67b2a2b00286 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -109,12 +109,9 @@ inline void iscsi_conn_queue_work(struct iscsi_conn *conn)
109} 109}
110EXPORT_SYMBOL_GPL(iscsi_conn_queue_work); 110EXPORT_SYMBOL_GPL(iscsi_conn_queue_work);
111 111
112void 112static void __iscsi_update_cmdsn(struct iscsi_session *session,
113iscsi_update_cmdsn(struct iscsi_session *session, struct iscsi_nopin *hdr) 113 uint32_t exp_cmdsn, uint32_t max_cmdsn)
114{ 114{
115 uint32_t max_cmdsn = be32_to_cpu(hdr->max_cmdsn);
116 uint32_t exp_cmdsn = be32_to_cpu(hdr->exp_cmdsn);
117
118 /* 115 /*
119 * standard specifies this check for when to update expected and 116 * standard specifies this check for when to update expected and
120 * max sequence numbers 117 * max sequence numbers
@@ -138,6 +135,12 @@ iscsi_update_cmdsn(struct iscsi_session *session, struct iscsi_nopin *hdr)
138 iscsi_conn_queue_work(session->leadconn); 135 iscsi_conn_queue_work(session->leadconn);
139 } 136 }
140} 137}
138
139void iscsi_update_cmdsn(struct iscsi_session *session, struct iscsi_nopin *hdr)
140{
141 __iscsi_update_cmdsn(session, be32_to_cpu(hdr->exp_cmdsn),
142 be32_to_cpu(hdr->max_cmdsn));
143}
141EXPORT_SYMBOL_GPL(iscsi_update_cmdsn); 144EXPORT_SYMBOL_GPL(iscsi_update_cmdsn);
142 145
143/** 146/**
@@ -499,6 +502,31 @@ static void iscsi_complete_task(struct iscsi_task *task, int state)
499 __iscsi_put_task(task); 502 __iscsi_put_task(task);
500} 503}
501 504
505/**
506 * iscsi_complete_scsi_task - finish scsi task normally
507 * @task: iscsi task for scsi cmd
508 * @exp_cmdsn: expected cmd sn in cpu format
509 * @max_cmdsn: max cmd sn in cpu format
510 *
511 * This is used when drivers do not need or cannot perform
512 * lower level pdu processing.
513 *
514 * Called with session lock
515 */
516void iscsi_complete_scsi_task(struct iscsi_task *task,
517 uint32_t exp_cmdsn, uint32_t max_cmdsn)
518{
519 struct iscsi_conn *conn = task->conn;
520
521 ISCSI_DBG_SESSION(conn->session, "[itt 0x%x]\n", task->itt);
522
523 conn->last_recv = jiffies;
524 __iscsi_update_cmdsn(conn->session, exp_cmdsn, max_cmdsn);
525 iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
526}
527EXPORT_SYMBOL_GPL(iscsi_complete_scsi_task);
528
529
502/* 530/*
503 * session lock must be held and if not called for a task that is 531 * session lock must be held and if not called for a task that is
504 * still pending or from the xmit thread, then xmit thread must 532 * still pending or from the xmit thread, then xmit thread must