Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1307531

Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper function

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper function
Date 2016-01-12 16:20 +0100
Message-ID <qQ8TM-2LK-29@gated-at.bofh.it> (permalink)
References <qPv62-Kq-3@gated-at.bofh.it> <qPv61-Kq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH-for-4.6 1/6] target: Add target_alloc_session() helper function "Nicholas A. Bellinger" <nab@daterainc.com> - 2016-01-10 21:50 +0100
  Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper  function Christoph Hellwig <hch@lst.de> - 2016-01-12 16:20 +0100
    Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper  function "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2016-01-13 09:10 +0100
      Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper  function Christoph Hellwig <hch@lst.de> - 2016-01-13 09:20 +0100
        Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper  function "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2016-01-13 10:30 +0100
          Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper  function Christoph Hellwig <hch@lst.de> - 2016-01-13 10:40 +0100
            Re: [PATCH-for-4.6 1/6] target: Add target_alloc_session() helper  function "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2016-01-13 11:20 +0100

csiph-web