All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Christoph Hellwig <hch@infradead.org>
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: Wed, 19 Oct 2022 17:21:36 +0300	[thread overview]
Message-ID: <20221019142136.GF10901@yadro.com> (raw)
In-Reply-To: <Y00Giu7q4M/jb6mG@infradead.org>

On Mon, Oct 17, 2022 at 12:38:50AM -0700, Christoph Hellwig wrote:
> 
> > +DEFINE_XARRAY_ALLOC(tpg_xa);
> 
> I think this wants to be marked static.

Agree.

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

Every function in this file is with core_ prefix, but OK, I will change
name of new functions to target_*.

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

Ok, will split this function to enable/disable functions.

BR,
 Dmitry

  reply	other threads:[~2022-10-19 14:38 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
2022-10-19 14:21     ` Dmitry Bogdanov [this message]
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=20221019142136.GF10901@yadro.com \
    --to=d.bogdanov@yadro.com \
    --cc=hch@infradead.org \
    --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.