From patchwork Fri Mar 27 08:05:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 6104081 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0301BBF90F for ; Fri, 27 Mar 2015 08:07:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF2A52013A for ; Fri, 27 Mar 2015 08:07:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B058320411 for ; Fri, 27 Mar 2015 08:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753709AbbC0IHN (ORCPT ); Fri, 27 Mar 2015 04:07:13 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:35166 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753639AbbC0IGc (ORCPT ); Fri, 27 Mar 2015 04:06:32 -0400 Received: by obcjt1 with SMTP id jt1so65624476obc.2 for ; Fri, 27 Mar 2015 01:06:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=URGjkicuZTPM5X3OD+ki5m82JZCh+AkkBfsmRw7zlTo=; b=caksD0mLiyJd8k6sMTnnNGVFdHzplcavsH/5TnEIJU8OpzzdCQTPkRpkwhR7FF1RAs osAEEPH9f6BlZUIWDWGluZFGtbR5zCdpZe0btxUggMZoGIWf9dnl4fOcNHzQS3vRqNdW zrgvUqqi1/JuqsYTsFG+SDQ8sxW36nv3uay+SsJuDcoOvhkJsUqfHbUk0gVvAsPGjXXU lEbjxRXM98thVIjZM8yfuXcWFX33PSe1/ThXV4hLXYFo9V44uLpr/53b3uzjaqYFShbv A+2PBHT7hbGPIPmh8aU2Dm2o7HiYA89PQqg0mDBgEpCRlfT7IjXYJW8ZcgudA2F0ql2A 2gNw== X-Gm-Message-State: ALoCoQnewXSFg+ubynWk0FE32rJzNEXiQs0gdbhzzTV5A6vYKA3gvDrwh7h/ImyKAzsg6t/rkykL X-Received: by 10.60.42.211 with SMTP id q19mr15316916oel.58.1427443591768; Fri, 27 Mar 2015 01:06:31 -0700 (PDT) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by mx.google.com with ESMTPSA id h4sm711520obr.18.2015.03.27.01.06.31 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 01:06:31 -0700 (PDT) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-scsi , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , Nicholas Bellinger Subject: [RFC 20/22] target: Rename LUN lookup/add/remove to target_* prefix Date: Fri, 27 Mar 2015 08:05:10 +0000 Message-Id: <1427443512-8925-21-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1427443512-8925-1-git-send-email-nab@daterainc.com> References: <1427443512-8925-1-git-send-email-nab@daterainc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicholas Bellinger This includes: - target_add_lun - target_remove_lun - target_lookup_cmd_lun - target_lookup_tmr_lun - target_clear_lun_from_tpg Also, update fabric drivers for loopback, iscsi/iser-target, xen-scsiback. Signed-off-by: Nicholas Bellinger --- drivers/target/iscsi/iscsi_target.c | 8 ++++---- drivers/target/loopback/tcm_loop.c | 2 +- drivers/target/target_core_device.c | 16 ++++++++-------- drivers/target/target_core_internal.h | 6 +++--- drivers/target/target_core_tpg.c | 10 +++++----- drivers/target/target_core_transport.c | 4 ++-- drivers/xen/xen-scsiback.c | 2 +- include/target/target_core_fabric.h | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 75e24ef..9a5d56a 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -995,8 +995,8 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, target_get_sess_cmd(conn->sess->se_sess, &cmd->se_cmd, true); - cmd->sense_reason = transport_lookup_cmd_lun(&cmd->se_cmd, - scsilun_to_int(&hdr->lun)); + cmd->sense_reason = target_lookup_cmd_lun(&cmd->se_cmd, + scsilun_to_int(&hdr->lun)); if (cmd->sense_reason) goto attach_cmd; @@ -1857,8 +1857,8 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, * Locate the struct se_lun for all TMRs not related to ERL=2 TASK_REASSIGN */ if (function != ISCSI_TM_FUNC_TASK_REASSIGN) { - ret = transport_lookup_tmr_lun(&cmd->se_cmd, - scsilun_to_int(&hdr->lun)); + ret = target_lookup_tmr_lun(&cmd->se_cmd, + scsilun_to_int(&hdr->lun)); if (ret < 0) { se_tmr->response = ISCSI_TMF_RSP_NO_LUN; goto attach; diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index a05b86c..1510380 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -271,7 +271,7 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, /* * Locate the underlying TCM struct se_lun */ - if (transport_lookup_tmr_lun(se_cmd, lun) < 0) { + if (target_lookup_tmr_lun(se_cmd, lun) < 0) { ret = TMR_LUN_DOES_NOT_EXIST; goto release; } diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 80d1b04..3647e7c 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -55,7 +55,7 @@ static struct se_hba *lun0_hba; struct se_device *g_lun0_dev; sense_reason_t -transport_lookup_cmd_lun(struct se_cmd *se_cmd, u32 unpacked_lun) +target_lookup_cmd_lun(struct se_cmd *se_cmd, u32 unpacked_lun) { struct se_lun *se_lun = NULL; struct se_session *se_sess = se_cmd->se_sess; @@ -147,9 +147,9 @@ check_lun: return 0; } -EXPORT_SYMBOL(transport_lookup_cmd_lun); +EXPORT_SYMBOL(target_lookup_cmd_lun); -int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u32 unpacked_lun) +int target_lookup_tmr_lun(struct se_cmd *se_cmd, u32 unpacked_lun) { struct se_dev_entry *deve; struct se_lun *se_lun = NULL; @@ -200,7 +200,7 @@ check_lun: return 0; } -EXPORT_SYMBOL(transport_lookup_tmr_lun); +EXPORT_SYMBOL(target_lookup_tmr_lun); /* * This function is called from core_scsi3_emulate_pro_register_and_move() @@ -456,11 +456,11 @@ int core_disable_device_list_for_node( return 0; } -/* core_clear_lun_from_tpg(): +/* target_clear_lun_from_tpg(): * * */ -void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg) +void target_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg) { struct se_node_acl *nacl; struct se_dev_entry *deve; @@ -1211,7 +1211,7 @@ struct se_lun *core_dev_add_lun( if (IS_ERR(lun)) return lun; - rc = core_tpg_add_lun(tpg, lun, + rc = target_add_lun(tpg, lun, TRANSPORT_LUNFLAGS_READ_WRITE, dev); if (rc < 0) return ERR_PTR(rc); @@ -1254,7 +1254,7 @@ void core_dev_del_lun( tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, tpg->se_tpg_tfo->get_fabric_name()); - core_tpg_remove_lun(tpg, lun); + target_remove_lun(tpg, lun); } struct se_lun *core_get_lun_from_tpg(struct se_portal_group *tpg, u32 unpacked_lun) diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h index 574b396..70190e2 100644 --- a/drivers/target/target_core_internal.h +++ b/drivers/target/target_core_internal.h @@ -13,7 +13,7 @@ int core_enable_device_list_for_node(struct se_lun *, struct se_lun_acl *, u32, u32, struct se_node_acl *, struct se_portal_group *); int core_disable_device_list_for_node(struct se_lun *, struct se_lun_acl *, u32, u32, struct se_node_acl *, struct se_portal_group *); -void core_clear_lun_from_tpg(struct se_lun *, struct se_portal_group *); +void target_clear_lun_from_tpg(struct se_lun *, struct se_portal_group *); int core_dev_export(struct se_device *, struct se_portal_group *, struct se_lun *); void core_dev_unexport(struct se_device *, struct se_portal_group *, @@ -53,9 +53,9 @@ struct se_node_acl *__target_get_initiator_node_acl(struct se_portal_group *tpg, void core_tpg_add_node_to_devs(struct se_node_acl *, struct se_portal_group *); void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *); struct se_lun *core_tpg_alloc_lun(struct se_portal_group *, u32); -int core_tpg_add_lun(struct se_portal_group *, struct se_lun *, +int target_add_lun(struct se_portal_group *, struct se_lun *, u32, struct se_device *); -void core_tpg_remove_lun(struct se_portal_group *, struct se_lun *); +void target_remove_lun(struct se_portal_group *, struct se_lun *); /* target_core_transport.c */ extern struct kmem_cache *se_tmr_req_cache; diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 513e6bd..9d31434 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -637,7 +637,7 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) spin_lock_init(&lun->lun_sep_lock); init_completion(&lun->lun_ref_comp); - ret = core_tpg_add_lun(se_tpg, lun, lun_access, dev); + ret = target_add_lun(se_tpg, lun, lun_access, dev); if (ret < 0) return ret; @@ -744,7 +744,7 @@ int target_deregister_tpg(struct se_portal_group *se_tpg) } if (se_tpg->se_tpg_type == TRANSPORT_TPG_TYPE_NORMAL) - core_tpg_remove_lun(se_tpg, &se_tpg->tpg_virt_lun0); + target_remove_lun(se_tpg, &se_tpg->tpg_virt_lun0); se_tpg->se_tpg_fabric_ptr = NULL; array_free(se_tpg->tpg_lun_list, TRANSPORT_MAX_LUNS_PER_TPG); @@ -782,7 +782,7 @@ struct se_lun *core_tpg_alloc_lun( return lun; } -int core_tpg_add_lun( +int target_add_lun( struct se_portal_group *tpg, struct se_lun *lun, u32 lun_access, @@ -809,11 +809,11 @@ int core_tpg_add_lun( return 0; } -void core_tpg_remove_lun( +void target_remove_lun( struct se_portal_group *tpg, struct se_lun *lun) { - core_clear_lun_from_tpg(lun, tpg); + target_clear_lun_from_tpg(lun, tpg); transport_clear_lun_ref(lun); core_dev_unexport(lun->lun_se_dev, tpg, lun); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index dfd78dd..86d4aeb 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1398,7 +1398,7 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess /* * Locate se_lun pointer and attach it to struct se_cmd */ - rc = transport_lookup_cmd_lun(se_cmd, unpacked_lun); + rc = target_lookup_cmd_lun(se_cmd, unpacked_lun); if (rc) { transport_send_check_condition_and_sense(se_cmd, rc, 0); target_put_sess_cmd(se_sess, se_cmd); @@ -1558,7 +1558,7 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, return ret; } - ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); + ret = target_lookup_tmr_lun(se_cmd, unpacked_lun); if (ret) { /* * For callback during failure handling, push this work off diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 00772de..a2062b6 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -616,7 +616,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, se_cmd->se_tmr_req->ref_task_tag = tag; - if (transport_lookup_tmr_lun(se_cmd, pending_req->v2p->lun) < 0) + if (target_lookup_tmr_lun(se_cmd, pending_req->v2p->lun) < 0) goto out; transport_generic_handle_tmr(se_cmd); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 9b4dc7a..e06613d 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -111,7 +111,7 @@ void transport_deregister_session(struct se_session *); void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, struct se_session *, u32, int, int, unsigned char *); -sense_reason_t transport_lookup_cmd_lun(struct se_cmd *, u32); +sense_reason_t target_lookup_cmd_lun(struct se_cmd *, u32); sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, unsigned char *, unsigned char *, u32, u32, int, int, int, @@ -146,7 +146,7 @@ void core_tmr_release_req(struct se_tmr_req *); int transport_generic_handle_tmr(struct se_cmd *); void transport_generic_request_failure(struct se_cmd *, sense_reason_t); void __target_execute_cmd(struct se_cmd *); -int transport_lookup_tmr_lun(struct se_cmd *, u32); +int target_lookup_tmr_lun(struct se_cmd *, u32); struct se_node_acl *target_get_initiator_node_acl(struct se_portal_group *tpg, unsigned char *);