util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] lsblk: Add revision column
@ 2012-11-02 17:56 Milan Broz
  2012-11-02 17:56 ` [PATCH 2/3] lsblk: Add vendor column Milan Broz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Milan Broz @ 2012-11-02 17:56 UTC (permalink / raw)
  To: util-linux; +Cc: Milan Broz

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 misc-utils/lsblk.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index c57e78f..671d912 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -100,6 +100,7 @@ enum {
 	COL_PKNAME,
 	COL_HCTL,
 	COL_TRANSPORT,
+	COL_REV,
 };
 
 /* column names */
@@ -150,6 +151,7 @@ static struct colinfo infos[] = {
 	[COL_WWN]    = { "WWN",     18, 0, N_("unique storage identifier") },
 	[COL_HCTL]   = { "HCTL", 10, 0, N_("Host:Channel:Target:Lun for SCSI") },
 	[COL_TRANSPORT] = { "TRAN", 6, 0, N_("device transport type") },
+	[COL_REV]    = { "REV",   4, TT_FL_RIGHT, N_("device revision") },
 };
 
 struct lsblk {
@@ -766,6 +768,13 @@ static void set_tt_data(struct blkdev_cxt *cxt, int col, int id, struct tt_line
 				tt_line_set_data(ln, col, p);
 		}
 		break;
+	case COL_REV:
+		if (!cxt->partition && cxt->nslaves == 0) {
+			p = sysfs_strdup(&cxt->sysfs, "device/rev");
+			if (p)
+				tt_line_set_data(ln, col, p);
+		}
+		break;
 	case COL_SIZE:
 		if (cxt->size) {
 			if (lsblk->bytes) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-07 16:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-02 17:56 [PATCH 1/3] lsblk: Add revision column Milan Broz
2012-11-02 17:56 ` [PATCH 2/3] lsblk: Add vendor column Milan Broz
2012-11-02 17:56 ` [PATCH 3/3] lsblk: Add --scsi switch Milan Broz
2012-11-07 16:43 ` [PATCH 1/3] lsblk: Add revision column Karel Zak

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