util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lsblk: add add_random columns
@ 2012-08-17 18:25 Milan Broz
  2012-09-04 15:22 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Broz @ 2012-08-17 18:25 UTC (permalink / raw)
  To: util-linux; +Cc: Milan Broz

Allow printing of queue/add_random attribute which describes
if device adds randomness to kernel RNG pool.

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

diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index 2410de4..3a980db 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -96,6 +96,7 @@ enum {
 	COL_DMAX,
 	COL_DZERO,
 	COL_WWN,
+	COL_RAND,
 };
 
 /* column names */
@@ -123,6 +124,7 @@ static struct colinfo infos[] = {
 	[COL_RO]     = { "RO",      1, TT_FL_RIGHT, N_("read-only device") },
 	[COL_RM]     = { "RM",      1, TT_FL_RIGHT, N_("removable device") },
 	[COL_ROTA]   = { "ROTA",    1, TT_FL_RIGHT, N_("rotational device") },
+	[COL_RAND]   = { "RAND",    1, TT_FL_RIGHT, N_("adds randomness") },
 	[COL_MODEL]  = { "MODEL",   0.1, TT_FL_TRUNC, N_("device identifier") },
 	[COL_SIZE]   = { "SIZE",    5, TT_FL_RIGHT, N_("size of the device") },
 	[COL_STATE]  = { "STATE",   7, TT_FL_TRUNC, N_("state of the device") },
@@ -690,6 +692,11 @@ static void set_tt_data(struct blkdev_cxt *cxt, int col, int id, struct tt_line
 		if (p)
 			tt_line_set_data(ln, col, p);
 		break;
+	case COL_RAND:
+		p = sysfs_strdup(&cxt->sysfs, "queue/add_random");
+		if (p)
+			tt_line_set_data(ln, col, p);
+		break;
 	case COL_MODEL:
 		if (!cxt->partition && cxt->nslaves == 0) {
 			p = sysfs_strdup(&cxt->sysfs, "device/model");
-- 
1.7.10.4


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

* Re: [PATCH] lsblk: add add_random columns
  2012-08-17 18:25 [PATCH] lsblk: add add_random columns Milan Broz
@ 2012-09-04 15:22 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2012-09-04 15:22 UTC (permalink / raw)
  To: Milan Broz; +Cc: util-linux

On Fri, Aug 17, 2012 at 08:25:26PM +0200, Milan Broz wrote:
>  misc-utils/lsblk.c |    7 +++++++
>  1 file changed, 7 insertions(+)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2012-09-04 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17 18:25 [PATCH] lsblk: add add_random columns Milan Broz
2012-09-04 15:22 ` 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).