From patchwork Fri Aug 28 14:22:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 44511 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7SENDBO017465 for ; Fri, 28 Aug 2009 14:23:13 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 72A28619EEB; Fri, 28 Aug 2009 10:23:13 -0400 (EDT) Received: from int-mx08.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n7SENCEH028182 for ; Fri, 28 Aug 2009 10:23:12 -0400 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.13]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7SENCA5026218 for ; Fri, 28 Aug 2009 10:23:12 -0400 Received: from exprod7og121.obsmtp.com (exprod7og121.obsmtp.com [64.18.2.20]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7SEMsB0015327 for ; Fri, 28 Aug 2009 10:22:54 -0400 Received: from source ([147.145.40.20]) by exprod7ob121.postini.com ([64.18.6.12]) with SMTP ID DSNKSpfoPOub9aih/u8ZQ2QavUERS6KkHaxe@postini.com; Fri, 28 Aug 2009 07:23:00 PDT Received: from milmhbs0.lsil.com (mhbs.lsil.com [147.145.1.30]) by mail0.lsil.com (8.12.11/8.12.11) with ESMTP id n7SEMpbn025996; Fri, 28 Aug 2009 07:22:51 -0700 (PDT) Received: from coshub01.lsi.com (coshub01.co.lsil.com [172.21.36.64]) by milmhbs0.lsil.com (8.12.11/8.12.11) with ESMTP id n7SEMrj9015059; Fri, 28 Aug 2009 07:22:53 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coshub01.lsi.com ([172.21.36.64]) with mapi; Fri, 28 Aug 2009 08:22:50 -0600 From: "Moger, Babu" To: "'linux-scsi@vger.kernel.org'" Date: Fri, 28 Aug 2009 08:22:49 -0600 Thread-Topic: [PATCH 2/3][RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach Thread-Index: Acon6wTXzD+xMi+4R9uxWTzg/pUEZA== 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-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.13 X-Scanned-By: MIMEDefang 2.39 X-RedHat-Spam-Score: -4 (RCVD_IN_DNSWL_MED) X-MIME-Autoconverted: from quoted-printable to 8bit by listman.util.phx.redhat.com id n7SENCEH028182 X-loop: dm-devel@redhat.com Cc: "Dachepalli, Sudhir" , "'device mapper development'" , "Chauhan, Vijay" , "Stankey, Robert" , "'sekharan@linux.vnet.ibm.com'" Subject: [dm-devel] [PATCH 2/3][RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 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 Moving the initialization code from rdac_activate to rdac_bus_attach which is more efficient. We don't have to collect all these information during every activate. Signed-off-by: Babu Moger Reviewed-by: Vijay Chauhan Reviewed-by: Bob Stankey --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-08-27 18:30:24.000000000 -0500 +++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-08-27 18:31:31.000000000 -0500 @@ -555,21 +555,6 @@ static int rdac_activate(struct scsi_dev if (err != SCSI_DH_OK) goto done; - if (!h->ctlr) { - err = initialize_controller(sdev, h); - if (err != SCSI_DH_OK) - goto done; - - err = get_array_name(sdev, h); - if (err != SCSI_DH_OK) - goto done; - } - - if (h->ctlr->use_ms10 == -1) { - err = set_mode_select(sdev, h); - if (err != SCSI_DH_OK) - goto done; - } if (h->lun_state == RDAC_LUN_UNOWNED) err = send_mode_select(sdev, h); done: @@ -712,6 +697,18 @@ static int rdac_bus_attach(struct scsi_d if (err != SCSI_DH_OK) goto failed; + err = initialize_controller(sdev, h); + if (err != SCSI_DH_OK) + goto failed; + + err = get_array_name(sdev, h); + if (err != SCSI_DH_OK) + goto failed; + + err = set_mode_select(sdev, h); + if (err != SCSI_DH_OK) + goto failed; + if (!try_module_get(THIS_MODULE)) goto failed;