Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] libiscsi: clear mtask

Consolidate the mtask clearing code.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Mike Christie and committed by
James Bottomley
05db888a 779ea120

+8 -11
+8 -11
drivers/scsi/libiscsi.c
··· 577 577 } 578 578 EXPORT_SYMBOL_GPL(iscsi_conn_failure); 579 579 580 - static int iscsi_xmit_imm_task(struct iscsi_conn *conn) 580 + static int iscsi_xmit_mtask(struct iscsi_conn *conn) 581 581 { 582 582 struct iscsi_hdr *hdr = conn->mtask->hdr; 583 583 int rc, was_logout = 0; ··· 590 590 rc = conn->session->tt->xmit_mgmt_task(conn, conn->mtask); 591 591 if (rc) 592 592 return rc; 593 + 594 + /* done with this in-progress mtask */ 595 + conn->mtask = NULL; 593 596 594 597 if (was_logout) { 595 598 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); ··· 646 643 conn->ctask = NULL; 647 644 } 648 645 if (conn->mtask) { 649 - rc = iscsi_xmit_imm_task(conn); 646 + rc = iscsi_xmit_mtask(conn); 650 647 if (rc) 651 648 goto again; 652 - /* done with this in-progress mtask */ 653 - conn->mtask = NULL; 654 649 } 655 650 656 651 /* process immediate first */ ··· 659 658 list_add_tail(&conn->mtask->running, 660 659 &conn->mgmt_run_list); 661 660 spin_unlock_bh(&conn->session->lock); 662 - rc = iscsi_xmit_imm_task(conn); 661 + rc = iscsi_xmit_mtask(conn); 663 662 if (rc) 664 663 goto again; 665 664 } 666 - /* done with this mtask */ 667 - conn->mtask = NULL; 668 665 } 669 666 670 667 /* process command queue */ ··· 700 701 list_add_tail(&conn->mtask->running, 701 702 &conn->mgmt_run_list); 702 703 spin_unlock_bh(&conn->session->lock); 703 - rc = tt->xmit_mgmt_task(conn, conn->mtask); 704 - if (rc) 704 + rc = iscsi_xmit_mtask(conn); 705 + if (rc) 705 706 goto again; 706 707 } 707 - /* done with this mtask */ 708 - conn->mtask = NULL; 709 708 } 710 709 711 710 return -ENODATA;