diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-10-23 13:05:39 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-10-23 13:05:39 +0000 |
commit | 4d0d2e1d77930a865ffb5e1c1a49c41673151899 (patch) | |
tree | 6102578e1102b84fb8897203a09c70df793236dd /sbin/bioctl/bioctl.c | |
parent | 316bcbd84ab08d9799ac0cdf3b8b642b749237b6 (diff) |
Add support for displaying the cache write policy of RAID volumes to bioctl(8)
and make mfi(4) pass up the necessary information. Adding support for other
RAID controllers is left as an excercise to the reader.
ok deraadt@
Diffstat (limited to 'sbin/bioctl/bioctl.c')
-rw-r--r-- | sbin/bioctl/bioctl.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c index 26187f09e1d..43b3b5c6ca1 100644 --- a/sbin/bioctl/bioctl.c +++ b/sbin/bioctl/bioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioctl.c,v 1.112 2012/09/10 11:28:47 jsing Exp $ */ +/* $OpenBSD: bioctl.c,v 1.113 2013/10/23 13:05:38 kettenis Exp $ */ /* * Copyright (c) 2004, 2005 Marco Peereboom @@ -334,7 +334,8 @@ bio_status(struct bio_status *bs) void bio_inq(char *name) { - char *status, size[64], scsiname[16], volname[32]; + char *status, *cache; + char size[64], scsiname[16], volname[32]; char percent[10], seconds[20]; int i, d, volheader, hotspare, unused; char encname[16], serial[32]; @@ -409,6 +410,17 @@ bio_inq(char *name) default: status = BIOC_SVINVALID_S; } + switch (bv.bv_cache) { + case BIOC_CVWRITEBACK: + cache = BIOC_CVWRITEBACK_S; + break; + case BIOC_CVWRITETHROUGH: + cache = BIOC_CVWRITETHROUGH_S; + break; + case BIOC_CVUNKNOWN: + default: + cache = BIOC_CVUNKNOWN_S; + } snprintf(volname, sizeof volname, "%s %u", bi.bi_dev, bv.bv_volid); @@ -437,9 +449,9 @@ bio_inq(char *name) percent, seconds); break; default: - printf("%11s %-10s %14s %-7s RAID%u%s%s\n", + printf("%11s %-10s %14s %-7s RAID%u%s%s %s\n", volname, status, size, bv.bv_dev, - bv.bv_level, percent, seconds); + bv.bv_level, percent, seconds, cache); break; } |