From: Juergen Gross <jgross@suse.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org, JBottomley@parallels.com,
xen-devel@lists.xen.org, hch@infradead.org,
target-devel@vger.kernel.org, david.vrabel@citrix.com,
JBeulich@suse.com
Subject: Re: Re: [Xen-devel] [PATCH V4 3/4] Introduce XEN scsiback module
Date: Thu, 14 Aug 2014 06:34:47 +0200 [thread overview]
Message-ID: <53EC3C67.60009@suse.com> (raw)
In-Reply-To: <53EB0D9E.6050408@suse.com>
On 08/13/2014 09:02 AM, Juergen Gross wrote:
> On 08/12/2014 11:13 PM, Nicholas A. Bellinger wrote:
>> Hi Juergen & Co,
>>
>> Finally had a chance to review this code. Comments are inline below..
>>> +static struct se_node_acl *
>>> +scsiback_alloc_fabric_acl(struct se_portal_group *se_tpg)
>>> +{
>>> + struct scsiback_nacl *nacl;
>>> +
>>> + nacl = kzalloc(sizeof(struct scsiback_nacl), GFP_KERNEL);
>>> + if (!nacl) {
>>> + pr_err("Unable to allocate struct scsiback_nacl\n");
>>> + return NULL;
>>> + }
>>> +
>>> + return &nacl->se_node_acl;
>>> +}
>>> +
>>> +static void
>>> +scsiback_release_fabric_acl(struct se_portal_group *se_tpg,
>>> + struct se_node_acl *se_nacl)
>>> +{
>>> + struct scsiback_nacl *nacl = container_of(se_nacl,
>>> + struct scsiback_nacl, se_node_acl);
>>> + kfree(nacl);
>>> +}
>>> +
>>> +static u32 scsiback_tpg_get_inst_index(struct se_portal_group *se_tpg)
>>> +{
>>> + return 1;
>>> +}
>>> +
>>> +static struct se_node_acl *
>>> +scsiback_make_nodeacl(struct se_portal_group *se_tpg,
>>> + struct config_group *group,
>>> + const char *name)
>>> +{
>>> + struct se_node_acl *se_nacl, *se_nacl_new;
>>> + struct scsiback_nacl *nacl;
>>> + u64 wwpn = 0;
>>> + u32 nexus_depth;
>>> +
>>> + se_nacl_new = scsiback_alloc_fabric_acl(se_tpg);
>>> + if (!se_nacl_new)
>>> + return ERR_PTR(-ENOMEM);
>>> +
>>> + nexus_depth = 1;
>>> + /*
>>> + * se_nacl_new may be released by core_tpg_add_initiator_node_acl()
>>> + * when converting a NodeACL from demo mode -> explict
>>> + */
>>> + se_nacl = core_tpg_add_initiator_node_acl(se_tpg, se_nacl_new,
>>> + name, nexus_depth);
>>> + if (IS_ERR(se_nacl)) {
>>> + scsiback_release_fabric_acl(se_tpg, se_nacl_new);
>>> + return se_nacl;
>>> + }
>>> + /*
>>> + * Locate our struct scsiback_nacl and set the FC Nport WWPN
>>> + */
>>> + nacl = container_of(se_nacl, struct scsiback_nacl, se_node_acl);
>>> + nacl->iport_wwpn = wwpn;
>>> +
>>> + return se_nacl;
>>> +}
>>> +
>>> +static void scsiback_drop_nodeacl(struct se_node_acl *se_acl)
>>> +{
>>> + struct scsiback_nacl *nacl = container_of(se_acl,
>>> + struct scsiback_nacl, se_node_acl);
>>> + core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1);
>>> + kfree(nacl);
>>> +}
>>> +
>>
>> As mentioned above, the NodeACL use is unnecessary for this driver so
>> you can safely drop scsiback_make_node_acl() +
>> scsiback_alloc_fabric_acl() + scsiback_drop_nodeacl() +
>> scsiback_release_fabric_acl().
>
> Deleted.
target_fabric_tf_ops_check() complains about missing
tpg_alloc_fabric_acl and tpg_release_fabric_acl.
>>> +static void scsiback_set_default_node_attrs(struct se_node_acl *nacl)
>>> +{
>>> +}
>>> +
>>
>> Safe to drop this no-op too.
>
> Okay.
target_fabric_tf_ops_check() wants this to be set, too.
Juergen
next prev parent reply other threads:[~2014-08-14 4:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 7:49 Add XEN pvSCSI support jgross
2014-08-08 7:49 ` [PATCH V4 1/4] Add XEN pvSCSI protocol description jgross
2014-08-08 7:49 ` [PATCH V4 2/4] Introduce xen-scsifront module jgross
2014-08-11 9:54 ` Christoph Hellwig
2014-08-11 10:27 ` [Xen-devel] " Juergen Gross
2014-08-11 17:50 ` Christoph Hellwig
2014-08-12 11:32 ` Juergen Gross
2014-08-08 7:49 ` [PATCH V4 3/4] Introduce XEN scsiback module jgross
2014-08-11 18:14 ` Christoph Hellwig
2014-08-12 12:29 ` [Xen-devel] " Juergen Gross
2014-08-12 12:52 ` Juergen Gross
2014-08-12 21:13 ` Nicholas A. Bellinger
2014-08-13 7:02 ` Juergen Gross
2014-08-14 4:34 ` Juergen Gross [this message]
2014-08-17 2:33 ` Re: [Xen-devel] " Nicholas A. Bellinger
2014-08-17 2:15 ` Nicholas A. Bellinger
2014-08-14 8:53 ` Re: [Xen-devel] " Juergen Gross
2014-08-14 10:14 ` Juergen Gross
2014-08-17 2:38 ` Nicholas A. Bellinger
2014-08-18 9:06 ` Juergen Gross
2014-08-08 7:49 ` [PATCH V4 4/4] add xen pvscsi maintainer jgross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53EC3C67.60009@suse.com \
--to=jgross@suse.com \
--cc=JBeulich@suse.com \
--cc=JBottomley@parallels.com \
--cc=david.vrabel@citrix.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=target-devel@vger.kernel.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).