From patchwork Fri Jun 22 21:52:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10483101 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 69FDC60388 for ; Fri, 22 Jun 2018 21:53:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57CFD2903B for ; Fri, 22 Jun 2018 21:53:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CC4029042; Fri, 22 Jun 2018 21:53:13 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D105A2903B for ; Fri, 22 Jun 2018 21:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754580AbeFVVxM (ORCPT ); Fri, 22 Jun 2018 17:53:12 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:64357 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbeFVVxJ (ORCPT ); Fri, 22 Jun 2018 17:53:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1529704415; x=1561240415; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=tuPU7RMtK4jd20v2bFCr0/HO4EjCACvqGiE0HEO0WEk=; b=joBA0ipr80Koy6mRy2JWflym/vAk8L3j2LF8ZsrQp53/F2JA/A5Z/EZ6 HjJfm2YlDdwbsaROotzMngHFumOo5sW4AVwGQKmpFs6vaZJWp8Xn7MwWU kGlv7VuKvIwvkq6wj3NXn+J9JWj3IcSwcBFOlUfvN9vo0FX5sZ56tKRtL Z10eGwgRuLXAGJ+w4PRQJ2uqZWNMGr9w4qPtObQ4agFPPaFdoqE3aehZq N0fWeJUoS3CbGpYJcHiiVSbuOHpsW7Y+1+z+3iLM+mfT0jFqTRiq/+Mkr 9Ndk7rIsRGNpT9x2DooQfpG72TQXI77i5vNR/EKmHO28sh618ZuviUQvP g==; X-IronPort-AV: E=Sophos;i="5.51,259,1526313600"; d="scan'208";a="178350991" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jun 2018 05:53:33 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 22 Jun 2018 14:42:56 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 22 Jun 2018 14:53:09 -0700 From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Mike Christie , Hannes Reinecke Subject: [PATCH 04/20] target: Rename transport_init_session() into transport_alloc_session() Date: Fri, 22 Jun 2018 14:52:51 -0700 Message-Id: <20180622215307.8758-5-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180622215307.8758-1-bart.vanassche@wdc.com> References: <20180622215307.8758-1-bart.vanassche@wdc.com> 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 Signed-off-by: Bart Van Assche Cc: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig --- drivers/target/iscsi/iscsi_target_login.c | 2 +- drivers/target/target_core_transport.c | 26 +++++++++++++++++++---- include/target/target_core_fabric.h | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 99501785cdc1..923b1a9fc3dc 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -369,7 +369,7 @@ static int iscsi_login_zero_tsih_s1( return -ENOMEM; } - sess->se_sess = transport_init_session(TARGET_PROT_NORMAL); + sess->se_sess = transport_alloc_session(TARGET_PROT_NORMAL); if (IS_ERR(sess->se_sess)) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 5e8329c5ddd0..880e07f40099 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -224,7 +224,11 @@ void transport_subsystem_check_init(void) sub_api_initialized = 1; } -struct se_session *transport_init_session(enum target_prot_op sup_prot_ops) +/** + * transport_alloc_session - allocate a session object and initialize it + * @sup_prot_ops: bitmask that defines which T10-PI modes are supported. + */ +struct se_session *transport_alloc_session(enum target_prot_op sup_prot_ops) { struct se_session *se_sess; @@ -243,8 +247,15 @@ struct se_session *transport_init_session(enum target_prot_op sup_prot_ops) return se_sess; } -EXPORT_SYMBOL(transport_init_session); +EXPORT_SYMBOL(transport_alloc_session); +/** + * transport_alloc_session_tags - allocate target driver private data + * @se_sess: Session pointer. + * @tag_num: Maximum number of in-flight commands between initiator and target. + * @tag_size: Size in bytes of the private data a target driver associates with + * each command. + */ int transport_alloc_session_tags(struct se_session *se_sess, unsigned int tag_num, unsigned int tag_size) { @@ -274,6 +285,13 @@ int transport_alloc_session_tags(struct se_session *se_sess, } EXPORT_SYMBOL(transport_alloc_session_tags); +/** + * transport_init_session_tags - allocate a session and target driver private data + * @tag_num: Maximum number of in-flight commands between initiator and target. + * @tag_size: Size in bytes of the private data a target driver associates with + * each command. + * @sup_prot_ops: bitmask that defines which T10-PI modes are supported. + */ struct se_session *transport_init_session_tags(unsigned int tag_num, unsigned int tag_size, enum target_prot_op sup_prot_ops) @@ -292,7 +310,7 @@ struct se_session *transport_init_session_tags(unsigned int tag_num, return ERR_PTR(-EINVAL); } - se_sess = transport_init_session(sup_prot_ops); + se_sess = transport_alloc_session(sup_prot_ops); if (IS_ERR(se_sess)) return se_sess; @@ -402,7 +420,7 @@ target_alloc_session(struct se_portal_group *tpg, if (tag_num != 0) sess = transport_init_session_tags(tag_num, tag_size, prot_op); else - sess = transport_init_session(prot_op); + sess = transport_alloc_session(prot_op); if (IS_ERR(sess)) return sess; diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index b297aa0d9651..010df9d5b977 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -115,7 +115,7 @@ struct se_session *target_alloc_session(struct se_portal_group *, int (*callback)(struct se_portal_group *, struct se_session *, void *)); -struct se_session *transport_init_session(enum target_prot_op); +struct se_session *transport_alloc_session(enum target_prot_op); int transport_alloc_session_tags(struct se_session *, unsigned int, unsigned int); struct se_session *transport_init_session_tags(unsigned int, unsigned int,