From patchwork Fri Apr 8 17:39:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 695321 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p38HeeDx019525 for ; Fri, 8 Apr 2011 17:41:02 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p38HcOkq023236; Fri, 8 Apr 2011 13:38:26 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p38HcNdH026784 for ; Fri, 8 Apr 2011 13:38:23 -0400 Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p38HcIOh030086 for ; Fri, 8 Apr 2011 13:38:18 -0400 Received: from na3sys009aog117.obsmtp.com (na3sys009aog117.obsmtp.com [74.125.149.242]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p38HcE2P012513 for ; Fri, 8 Apr 2011 13:38:14 -0400 Received: from cosedge01.lsi.com ([192.19.220.66]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKTZ9IBg7DROvgrAvHYf+tZ+rGDflZUnJ+@postini.com; Fri, 08 Apr 2011 10:38:14 PDT Received: from coscas01.lsi.com (172.21.36.60) by COSEDGE01.lsi.com (192.19.220.66) with Microsoft SMTP Server (TLS) id 8.3.137.0; Fri, 8 Apr 2011 11:37:21 -0600 Received: from cosmail01.lsi.com ([172.21.36.24]) by coscas01.lsi.com ([172.21.36.60]) with mapi; Fri, 8 Apr 2011 11:39:35 -0600 From: "Moger, Babu" To: "linux-scsi@vger.kernel.org" , "device-mapper development" Date: Fri, 8 Apr 2011 11:39:30 -0600 Thread-Topic: [PATCH 3/3] scsi_dh_rdac : decide on whether to send mode select or not based on operating mode Thread-Index: Acv2E+qBiJN8JjoSR9GtlPudCyhunw== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id p38HcNdH026784 X-loop: dm-devel@redhat.com Cc: "Krishnasamy, Somasundaram" , "Stankey, Robert" Subject: [dm-devel] [PATCH 3/3] scsi_dh_rdac : decide on whether to send mode select or not based on operating mode X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Apr 2011 17:41:17 +0000 (UTC) Based on the operating modes, handler decides whether to send mode select or not. Purpose here is to reduce io-shipping as much as possible whenever there is an option. Signed-off-by: Babu Moger Reviewed-by: Yanling Qi Reviewed-by: Sudhir Dachepalli Reviewed-by: Somasundaram Krishnasamy Reviewed-by: Bob Stankey Reviewed-by: Vijay Chauhan --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2011-03-17 16:57:51.000000000 -0500 +++ linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c 2011-03-17 16:59:11.000000000 -0500 @@ -670,12 +670,27 @@ static int rdac_activate(struct scsi_dev { struct rdac_dh_data *h = get_rdac_data(sdev); int err = SCSI_DH_OK; + int act = 0; err = check_ownership(sdev, h); if (err != SCSI_DH_OK) goto done; - if (h->lun_state == RDAC_LUN_UNOWNED) { + switch (h->mode) { + case RDAC_MODE: + if (h->lun_state == RDAC_LUN_UNOWNED) + act = 1; + break; + case RDAC_MODE_IOSHIP: + if ((h->lun_state == RDAC_LUN_UNOWNED) && + (h->preferred == RDAC_PREFERRED)) + act = 1; + break; + default: + break; + } + + if (act) { err = queue_mode_select(sdev, fn, data); if (err == SCSI_DH_OK) return 0;