[SCSI] libfc: export seq_release() for users of seq_assign()
[pandora-kernel.git] / drivers / scsi / libfc / fc_exch.c
index 1f124c0..a3d6402 100644 (file)
@@ -1282,6 +1282,8 @@ free:
  * @fp:    The request frame
  *
  * On success, the sequence pointer will be returned and also in fr_seq(@fp).
+ * A reference will be held on the exchange/sequence for the caller, which
+ * must call fc_seq_release().
  */
 static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
 {
@@ -1298,6 +1300,15 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
        return fr_seq(fp);
 }
 
+/**
+ * fc_seq_release() - Release the hold
+ * @sp:    The sequence.
+ */
+static void fc_seq_release(struct fc_seq *sp)
+{
+       fc_exch_release(fc_seq_exch(sp));
+}
+
 /**
  * fc_exch_recv_req() - Handler for an incoming request
  * @lport: The local port that received the request
@@ -2369,6 +2380,9 @@ int fc_exch_init(struct fc_lport *lport)
        if (!lport->tt.seq_assign)
                lport->tt.seq_assign = fc_seq_assign;
 
+       if (!lport->tt.seq_release)
+               lport->tt.seq_release = fc_seq_release;
+
        return 0;
 }
 EXPORT_SYMBOL(fc_exch_init);