All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Zorro Lang <zlang@kernel.org>,
	fstests@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Kanchan Joshi <joshi.k@samsung.com>,
	Anuj Gupta <anuj20.g@samsung.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/5] common: add a _sysfs_block_integrity_path helper
Date: Mon, 24 Aug 2026 06:58:59 +0200	[thread overview]
Message-ID: <20260824045859.GB29550@lst.de> (raw)
In-Reply-To: <20260821232908.GE839663@frogsfrogsfrogs>

On Fri, Aug 21, 2026 at 04:29:08PM -0700, Darrick J. Wong wrote:
> On Fri, Aug 21, 2026 at 07:11:27AM +0200, Christoph Hellwig wrote:
> > Add a helper function to find the sysfs integrity directory for a given
> > block device.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> >  common/rc | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> > 
> > diff --git a/common/rc b/common/rc
> > index 02bdb31a76a6..61a899da3bd7 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -5257,6 +5257,31 @@ _sysfs_queue_path()
> >  	fi
> >  }
> >  
> > +# Get the sysfs block device integrity/ path for a block device, handling
> > +# partitions correctly.
> > +_sysfs_block_integrity_path()
> > +{
> > +	local dev parent
> > +	dev=$(_short_dev "$1")
> > +
> > +	# For partitions, integrity details are in the parent device's sysfs dir
> > +	if [ -e "/sys/class/block/$dev/partition" ]; then
> > +		parent=$(basename "$(readlink -f /sys/class/block/$dev/..)")
> > +	else
> > +		parent="$dev"
> > +	fi
> 
> I wonder if this part should get pulled out into a _sysfs_block_path
> helper, since the code is already in _sysfs_queue_path?

I guess.  It's not much code, but it is identical.


  reply	other threads:[~2026-08-24  4:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  5:11 add tests for file system on devices using protection information v2 Christoph Hellwig
2026-08-21  5:11 ` [PATCH 1/5] common/scsi_debug: don't slow down I/O Christoph Hellwig
2026-08-21  7:41   ` John Garry
2026-08-21 16:14     ` Bart Van Assche
2026-08-21 23:27       ` Darrick J. Wong
2026-08-24  4:58       ` Christoph Hellwig
2026-08-21  5:11 ` [PATCH 2/5] common: add a _sysfs_block_integrity_path helper Christoph Hellwig
2026-08-21 23:29   ` Darrick J. Wong
2026-08-24  4:58     ` Christoph Hellwig [this message]
2026-08-21  5:11 ` [PATCH 3/5] add a "pi" group Christoph Hellwig
2026-08-21 23:30   ` Darrick J. Wong
2026-08-21  5:11 ` [PATCH 4/5] generic: test I/O on devices with T10 protection information Christoph Hellwig
2026-08-21 23:37   ` Darrick J. Wong
2026-08-24  4:59     ` Christoph Hellwig
2026-08-21  5:11 ` [PATCH 5/5] generic: test corruption detection using " Christoph Hellwig
2026-08-21 23:38   ` Darrick J. Wong

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=20260824045859.GB29550@lst.de \
    --to=hch@lst.de \
    --cc=anuj20.g@samsung.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=joshi.k@samsung.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=zlang@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.