util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naohiro Aota <naohiro.aota@wdc.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org, Damien.LeMoal@wdc.com,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Damien Le Moal <damien.lemoal@wdc.com>
Subject: [PATCH v3 3/3] lsblk: add zoned columns to "lsblk -z"
Date: Mon, 30 Aug 2021 14:52:57 +0900	[thread overview]
Message-ID: <20210830055257.1832523-4-naohiro.aota@wdc.com> (raw)
In-Reply-To: <20210830055257.1832523-1-naohiro.aota@wdc.com>

Add zoned columns to the "-z" option as follow.

$ lsblk -z -i
NAME        ZONED        ZONE-SZ ZONE-NR ZONE-AMAX ZONE-OMAX ZONE-APP ZONE-WGRAN
sda         host-managed    256M   55880         0       128     672K         4K
sdb         host-managed    256M   55880         0       128     672K         4K
zram0       none              0B       0         0         0       0B         0B
nvme2n1     none              0B       0         0         0       0B         0B
|-nvme2n1p1 none              0B       0         0         0       0B         0B
|-nvme2n1p2 none              0B       0         0         0       0B         0B
`-nvme2n1p3 none              0B       0         0         0       0B         0B
nvme0n1     none              0B       0         0         0       0B         0B
nvme1n1     none              0B       0         0         0       0B         0B
nvme0n2     host-managed      2G    1844        14        14       4M         4K
nvme1n2     host-managed      2G    1844        14        14       4M         4K

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 misc-utils/lsblk.8.adoc | 2 +-
 misc-utils/lsblk.c      | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/misc-utils/lsblk.8.adoc b/misc-utils/lsblk.8.adoc
index 7356976403a7..9e68a847ce0c 100644
--- a/misc-utils/lsblk.8.adoc
+++ b/misc-utils/lsblk.8.adoc
@@ -116,7 +116,7 @@ Specifies output width as a number of characters. The default is the number of t
 Sort output lines by _column_. This option enables *--list* output format by default. It is possible to use the option *--tree* to force tree-like output and than the tree branches are sorted by the _column_.
 
 *-z*, *--zoned*::
-Print the zone model for each device.
+Print the zone related information for each device.
 
 *--sysroot* _directory_::
 Gather data for a Linux instance other than the instance from which the *lsblk* command is issued. The specified directory is the system root of the Linux instance to be inspected. The real device nodes in the target directory can be replaced by text files with udev attributes.
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index 807ddcfea631..b4696f5ec5c9 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -1920,7 +1920,7 @@ static void __attribute__((__noreturn__)) usage(void)
 	fputs(_(" -t, --topology       output info about topology\n"), out);
 	fputs(_(" -w, --width <num>    specifies output width as number of characters\n"), out);
 	fputs(_(" -x, --sort <column>  sort output by <column>\n"), out);
-	fputs(_(" -z, --zoned          print zone model\n"), out);
+	fputs(_(" -z, --zoned          print zone related information\n"), out);
 	fputs(_("     --sysroot <dir>  use specified directory as system root\n"), out);
 	fputs(USAGE_SEPARATOR, out);
 	printf(USAGE_HELP_OPTIONS(22));
@@ -2042,6 +2042,12 @@ int main(int argc, char *argv[])
 		case 'z':
 			add_uniq_column(COL_NAME);
 			add_uniq_column(COL_ZONED);
+			add_uniq_column(COL_ZONE_SZ);
+			add_uniq_column(COL_ZONE_NR);
+			add_uniq_column(COL_ZONE_AMAX);
+			add_uniq_column(COL_ZONE_OMAX);
+			add_uniq_column(COL_ZONE_APP);
+			add_uniq_column(COL_ZONE_WGRAN);
 			break;
 		case 'e':
 			parse_excludes(optarg);
-- 
2.33.0


  parent reply	other threads:[~2021-08-30  5:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  5:52 [PATCH v3 0/3] add columns for zoned parameters Naohiro Aota
2021-08-30  5:52 ` [PATCH v3 1/3] lsblk: factor out function to read sysfs param as bytes Naohiro Aota
2021-08-30  5:52 ` [PATCH v3 2/3] lsblk: add columns of zoned parameters Naohiro Aota
2021-08-30  6:22   ` Damien Le Moal
2021-08-30  5:52 ` Naohiro Aota [this message]
2021-08-31  8:48 ` [PATCH v3 0/3] add columns for " Karel Zak

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=20210830055257.1832523-4-naohiro.aota@wdc.com \
    --to=naohiro.aota@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).