All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dmitry Bogdanov <d.bogdanov@yadro.com>
Cc: Martin Petersen <martin.petersen@oracle.com>,
	target-devel@vger.kernel.org,
	Mike Christie <michael.christie@oracle.com>,
	linux-scsi@vger.kernel.org, linux@yadro.com
Subject: Re: [PATCH v2 1/5] scsi: target: core: Add RTPI field to target port
Date: Mon, 17 Oct 2022 00:38:50 -0700	[thread overview]
Message-ID: <Y00Giu7q4M/jb6mG@infradead.org> (raw)
In-Reply-To: <20221006105057.30184-2-d.bogdanov@yadro.com>

> +DEFINE_XARRAY_ALLOC(tpg_xa);

I think this wants to be marked static.

> +static int core_tpg_register_rtpi(struct se_portal_group *se_tpg)

Can you use target_ instead of the weird historic core_ prefixes for
everything here?

> +int core_tpg_enable(struct se_portal_group *se_tpg, bool enable)
> +{
> +	int ret;
> +
> +	if (enable) {
> +		ret = core_tpg_register_rtpi(se_tpg);
> +		if (ret)
> +			return ret;
> +	} else {
> +		core_tpg_deregister_rtpi(se_tpg);
> +	}
> +	ret = se_tpg->se_tpg_tfo->fabric_enable_tpg(se_tpg, enable);
> +	if (ret) {
> +		core_tpg_deregister_rtpi(se_tpg);
> +		return ret;
> +	}
> +
> +	se_tpg->enabled = enable;

This bool enable logic is a bit weird and splitting the enable and
disable case would seem more sensible to me, but maybe there is
something later on that makes it more relevant.

  reply	other threads:[~2022-10-17  7:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 10:50 [PATCH v2 0/5] scsi: target: make RTPI an TPG identifier Dmitry Bogdanov
2022-10-06 10:50 ` [PATCH v2 1/5] scsi: target: core: Add RTPI field to target port Dmitry Bogdanov
2022-10-17  7:38   ` Christoph Hellwig [this message]
2022-10-19 14:21     ` Dmitry Bogdanov
2022-10-06 10:50 ` [PATCH v2 2/5] scsi: target: core: Use RTPI from " Dmitry Bogdanov
2022-10-17  7:39   ` Christoph Hellwig
2022-10-06 10:50 ` [PATCH v2 3/5] scsi: target: core: Drop device-based RTPI Dmitry Bogdanov
2022-10-17  7:39   ` Christoph Hellwig
2022-10-06 10:50 ` [PATCH v2 4/5] scsi: target: core: Add common port attributes Dmitry Bogdanov
2022-10-17  7:42   ` Christoph Hellwig
2022-10-19 15:13     ` Dmitry Bogdanov
2022-10-06 10:50 ` [PATCH v2 5/5] scsi: target: core: Add RTPI attribute for target port Dmitry Bogdanov

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=Y00Giu7q4M/jb6mG@infradead.org \
    --to=hch@infradead.org \
    --cc=d.bogdanov@yadro.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@yadro.com \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=target-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.