mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Nicholas A. Bellinger" <nab@daterainc.com>
Cc: target-devel <target-devel@vger.kernel.org>,
	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: Tue, 12 Jan 2016 16:11:19 +0100	[thread overview]
Message-ID: <20160112151119.GD2058@lst.de> (raw)
In-Reply-To: <1452458668-11034-2-git-send-email-nab@daterainc.com>

> +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 *))
> +{

I'd much rather have the fabrics drivers call transport_alloc_session_tags
directly from the callback than growing even more arguments here.

> +	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);
> +	}

These checks should be in transport_alloc_session_tags.

  parent reply	other threads:[~2016-01-12 15: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
2016-01-12 15:11   ` Christoph Hellwig [this message]
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=20160112151119.GD2058@lst.de \
    --to=hch@lst.de \
    --cc=agrover@redhat.com \
    --cc=hare@suse.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