From patchwork Wed Feb 15 00:25:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9573119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BB1F600F6 for ; Wed, 15 Feb 2017 00:27:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EB032841A for ; Wed, 15 Feb 2017 00:27:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80B092842E; Wed, 15 Feb 2017 00:27:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 537EF205D6 for ; Wed, 15 Feb 2017 00:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432AbdBOA1Z (ORCPT ); Tue, 14 Feb 2017 19:27:25 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:50689 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbdBOA1Z (ORCPT ); Tue, 14 Feb 2017 19:27:25 -0500 X-IronPort-AV: E=Sophos;i="5.35,163,1483977600"; d="scan'208";a="81774811" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2017 08:43:10 +0800 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 46.E4.57638.720A3A85; Tue, 14 Feb 2017 16:26:18 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 14 Feb 2017 16:26:14 -0800 X-AuditID: 0ac94369-ee7ff7000001e126-65-58a3a027fb52 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 47.7D.11415.720A3A85; Tue, 14 Feb 2017 16:26:15 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Himanshu Madhani , Quinn Tran Subject: [PATCH v6 01/33] tcm_qla2xxx: Simplify qlt_create_sess() Date: Tue, 14 Feb 2017 16:25:40 -0800 Message-ID: <20170215002612.14566-2-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170215002612.14566-1-bart.vanassche@sandisk.com> References: <20170215002612.14566-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsXCddJ5ka7WgsURBj8+iFtc2NPNaNG2+gyj xc/214wWrUvfMjmweMz4vYjF4/72I0wenzfJBTBHcdmkpOZklqUW6dslcGVM/L+dtWA9Z8Xv Z+4NjE/Yuxg5OSQETCQmrF7A1sXIxSEksJRJ4nHHfmYIZxujxMLZB4CqOMCqDu1Vg4hvZJQ4 +bQbrJtNwEji2/uZLCC2CJC9umcZE0gRs8AKRolHLVMYQRLCAo4S63ZfAmtgEVCVeNu+kAnE 5hWwl9jcspIN4gx5iV1tF1lBbE4BB4kZO06ygCwWAqp5dMYaZKaEQBOrxJxJ09ghegUlTs58 AraYWUBC4uCLF8wgtpCAusTJJfOZJjAKzUJSNgtJ2QJGplWMYrmZOcW56akFhqZ6xYl5KZnF 2XrJ+bmbGCHhnLmD8e4T70OMAhyMSjy8J2QXRwixJpYVV+YeYpTgYFYS4WWrBwrxpiRWVqUW 5ccXleakFh9ilOZgURLnPSczNUJIID2xJDU7NbUgtQgmy8TBKdXAeLtBS9A+f45OoNPckxfu fy6Ldi3M/+a7IHragj89c0/HyOo27Fk9YX7HvrCVvVfXPuiZkd4jo3+6+JWa1h3HGUs7Ln2W Fny0alP7/3vxPzjvePY8OhEyvahN6fDxsHjmravNf1jMPWRs9XbVst/vYs/HTtxk7LrQ86/r 17uHnKwuMl73362t81+JpTgj0VCLuag4EQBsTfUKYwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIg7/rOCwO/mxjtLiwp5vR om31GUaLn+2vGS1al75lcmD1mPF7EYvH/e1HmDymrTnP5PF5k1wASxSXTUpqTmZZapG+XQJX xsT/21kL1nNW/H7m3sD4hL2LkYNDQsBE4tBetS5GTg4hgfWMEo8/+oHYbAJGEt/ez2QBsUWA 7NU9y5i6GLk4mAVWMEqsW/KGDSQhLOAosW73JXYQm0VAVeJt+0ImkJm8AvYSZ1e4g4QlBOQl drVdZAWxOQUcJGbsOMkCUiIEVPLojPUERu4FjAyrGMVyM3OKc9MzCwwN9YoT81Iyi7P1kvNz NzFCAiByB+PTieaHGJk4OKUaGDn2LnF49fyIhDKrzIT9Qio/tqx4Zvc8ds3X8J3+8muvdIrp T5fgr3u0fLWJ6Jb9G/ROzTg02X5B93shOY8XgVUnRJJV+m48jwjd0v7k+T71B/UT95kIbO2f vsdc+K39HwGJVyv/zVrX7b3AyqRGdmvj0wsbxYJWWTufL9Qx8bRb7zF3sl2Rq6gSS3FGoqEW c1FxIgCvBt2EsAEAAA== MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just after creation of a session it only has a single user. Hence using kref_get() is sufficient. Signed-off-by: Bart Van Assche Cc: Himanshu Madhani Cc: Quinn Tran --- drivers/scsi/qla2xxx/qla_target.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 45f5077684f0..02d4aee5c422 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1292,14 +1292,9 @@ static struct fc_port *qlt_create_sess( kref_init(&fcport->sess_kref); /* * Take an extra reference to ->sess_kref here to handle - * fc_port access across ->tgt.sess_lock reaquire. + * fc_port access across ->tgt.sess_lock reacquire. */ - if (!kref_get_unless_zero(&sess->sess_kref)) { - ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s: kref_get_unless_zero failed for %8phC\n", - __func__, sess->port_name); - return NULL; - } + kref_get(&sess->sess_kref); spin_lock_irqsave(&ha->tgt.sess_lock, flags); if (!IS_SW_RESV_ADDR(sess->d_id))