diff options
author | Milan Broz | 2012-07-24 16:34:33 +0200 |
---|---|---|
committer | Karel Zak | 2012-07-26 10:55:05 +0200 |
commit | 150db7a956557a022f6fdc797ac93b541c19360d (patch) | |
tree | b489e34b84162953139920ae69f71266bf36d3ce /misc-utils/lsblk.c | |
parent | fdisk: API: comment labels array (diff) | |
download | kernel-qcow2-util-linux-150db7a956557a022f6fdc797ac93b541c19360d.tar.gz kernel-qcow2-util-linux-150db7a956557a022f6fdc797ac93b541c19360d.tar.xz kernel-qcow2-util-linux-150db7a956557a022f6fdc797ac93b541c19360d.zip |
lsblk: add read-ahead column.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Diffstat (limited to 'misc-utils/lsblk.c')
-rw-r--r-- | misc-utils/lsblk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index cd1b139d6..cfd1d3b9e 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -73,6 +73,7 @@ enum { COL_UUID, COL_PARTLABEL, COL_PARTUUID, + COL_RA, COL_RO, COL_RM, COL_MODEL, @@ -117,6 +118,7 @@ static struct colinfo infos[] = { [COL_PARTLABEL] = { "PARTLABEL", 0.1, 0, N_("partition LABEL") }, [COL_PARTUUID] = { "PARTUUID", 36, 0, N_("partition UUID") }, + [COL_RA] = { "RA", 4, TT_FL_RIGHT, N_("read-ahead of the device") }, [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") }, @@ -643,6 +645,11 @@ static void set_tt_data(struct blkdev_cxt *cxt, int col, int id, struct tt_line if (cxt->uuid) tt_line_set_data(ln, col, xstrdup(cxt->partuuid)); break; + case COL_RA: + p = sysfs_strdup(&cxt->sysfs, "queue/read_ahead_kb"); + if (p) + tt_line_set_data(ln, col, p); + break; case COL_RO: tt_line_set_data(ln, col, is_readonly_device(cxt) ? xstrdup("1") : xstrdup("0")); @@ -1326,6 +1333,7 @@ int main(int argc, char *argv[]) columns[ncolumns++] = COL_ROTA; columns[ncolumns++] = COL_SCHED; columns[ncolumns++] = COL_RQ_SIZE; + columns[ncolumns++] = COL_RA; break; case 'V': printf(_("%s from %s\n"), program_invocation_short_name, |