public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: linux-nvme@lists.infradead.org
Subject: How to look up an ns cdev from block maj:min?
Date: Tue, 14 Feb 2023 16:27:35 -0500	[thread overview]
Message-ID: <Y+v8x4m3lm8QU7Ov@fedora> (raw)

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

Hi,
Is there an official way for userspace to look up an ns cdev from a
block maj:min?

For example, how should a userspace program determine that /dev/ng0n1 is
the corresponding ns cdev when given just the block device node
/dev/nvme0n1?

Parsing the filename is an obvious option but it makes assumptions about
the naming convention of both the block device node and the character
device node.

Is there a better way via sysfs? (I couldn't find it.)

Thanks,
Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2023-02-14 21:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 21:27 Stefan Hajnoczi [this message]
2023-02-15  8:41 ` How to look up an ns cdev from block maj:min? Sagi Grimberg
2023-02-15  9:56   ` Daniel Wagner
2023-02-15 10:09     ` Daniel Wagner
2023-02-15 15:51   ` Stefan Hajnoczi

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=Y+v8x4m3lm8QU7Ov@fedora \
    --to=stefanha@redhat.com \
    --cc=linux-nvme@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox