From: Bart Van Assche <bart.vanassche@sandisk.com>
To: "Nicholas A. Bellinger" <nab@daterainc.com>,
target-devel <target-devel@vger.kernel.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Sagi Grimberg <sagig@mellanox.com>,
"Christoph Hellwig" <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
Andy Grover <agrover@redhat.com>,
Vasu Dev <vasu.dev@linux.intel.com>, Vu Pham <vu@mellanox.com>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper function
Date: Mon, 11 Jan 2016 14:10:06 -0800 [thread overview]
Message-ID: <5694283E.3070401@sandisk.com> (raw)
In-Reply-To: <1452458668-11034-2-git-send-email-nab@daterainc.com>
On 01/10/2016 12:44 PM, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
>
> Based on HCH's original patch, this adds a full version to
> support percpu-ida tag pre-allocation and callback function
> pointer into fabric driver code to complete session setup.
>
> Reported-by: Christoph Hellwig <hch@lst.de>
> Cc: Sagi Grimberg <sagig@mellanox.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Andy Grover <agrover@redhat.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> ---
> drivers/target/target_core_transport.c | 55 ++++++++++++++++++++++++++++++++++
> include/target/target_core_fabric.h | 6 ++++
> 2 files changed, 61 insertions(+)
>
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index c5035b9..fd4404f6 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -374,6 +374,61 @@ void transport_register_session(
> }
> EXPORT_SYMBOL(transport_register_session);
>
> +struct se_session *
> +target_alloc_session(struct se_portal_group *tpg,
> + unsigned int tag_num, unsigned int tag_size,
> + enum target_prot_op prot_op,
> + const char *initiatorname, void *private,
> + int (*callback)(struct se_portal_group *,
> + struct se_session *, void *))
Please use a more descriptive name instead of "callback", e.g.
"init_session".
> +{
> + struct se_session *sess;
> +
> + if (tag_num != 0 && !tag_size) {
> + pr_err("target_alloc_session called with percpu-ida tag_num:"
> + " %u, but zero tag_size\n", tag_num);
> + return ERR_PTR(-EINVAL);
> + }
> + if (!tag_num && tag_size) {
> + pr_err("target_alloc_session called with percpu-ida tag_size:"
> + " %u, but zero tag_num\n", tag_size);
> + return ERR_PTR(-EINVAL);
> + }
Please combine the above two tests into a single test, e.g. !!tag_num !=
!!tag_size or (bool)tag_num != (bool)tag_size.
Thanks,
Bart.
next prev parent reply other threads:[~2016-01-11 22:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-10 20:44 [PATCH-for-4.6 0/6] target: Introduce target_alloc_session helper Nicholas A. Bellinger
2016-01-10 20:44 ` [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper function Nicholas A. Bellinger
2016-01-11 22:10 ` Bart Van Assche [this message]
2016-01-12 15:11 ` Christoph Hellwig
2016-01-13 8:09 ` Nicholas A. Bellinger
2016-01-13 8:17 ` Christoph Hellwig
2016-01-13 9:22 ` Nicholas A. Bellinger
2016-01-13 9:33 ` Christoph Hellwig
2016-01-13 10:14 ` Nicholas A. Bellinger
2016-01-10 20:44 ` [PATCH-for-4.6 2/6] target: Convert demo-mode only drivers to target_alloc_session Nicholas A. Bellinger
2016-01-10 20:44 ` [PATCH-for-4.6 3/6] vhost/scsi: Convert to target_alloc_session usage Nicholas A. Bellinger
2016-01-10 21:32 ` Michael S. Tsirkin
2016-01-10 20:44 ` [PATCH-for-4.6 4/6] tcm_qla2xxx: " Nicholas A. Bellinger
2016-01-10 20:44 ` [PATCH-for-4.6 5/6] tcm_fc: " Nicholas A. Bellinger
2016-01-10 20:44 ` [PATCH-for-4.6 6/6] ib_srpt: " Nicholas A. Bellinger
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=5694283E.3070401@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=agrover@redhat.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=sagig@mellanox.com \
--cc=target-devel@vger.kernel.org \
--cc=vasu.dev@linux.intel.com \
--cc=vu@mellanox.com \
/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
Powered by JetHome