[stgt] [PATCH 1/2] bsoflags in system info

Alexander Nezhinsky alexandern at mellanox.com
Thu Nov 10 14:55:40 CET 2011


show the bsoflags supported by backing stores in system info

Signed-off-by: Alexander Nezhinsky <alexandern at mellanox.com>
---
 usr/target.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/usr/target.c b/usr/target.c
index 8dcf1f1..1a7f355 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -2104,6 +2104,7 @@ int system_show(int mode, char *buf, int rest)
 	struct backingstore_template *bst;
 	struct device_type_template *devt;
 	int i;
+	char strflags[128];
 
 	/* FIXME: too hacky */
 	if (mode != MODE_SYSTEM)
@@ -2121,8 +2122,14 @@ int system_show(int mode, char *buf, int rest)
 	}
 
 	shprintf(total, buf, rest, "Backing stores:\n");
-	list_for_each_entry(bst, &bst_list, backingstore_siblings)
-		shprintf(total, buf, rest, _TAB1 "%s\n", bst->bs_name);
+	list_for_each_entry(bst, &bst_list, backingstore_siblings) {
+		if (!bst->bs_oflags_supported)
+			shprintf(total, buf, rest, _TAB1 "%s\n", bst->bs_name);
+		else
+			shprintf(total, buf, rest, _TAB1 "%s (bsoflags %s)\n",
+				 bst->bs_name,
+				 open_flags_to_str(strflags, bst->bs_oflags_supported));
+	}
 
 	shprintf(total, buf, rest, "Device types:\n");
 	list_for_each_entry(devt, &device_type_list, device_type_siblings)
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list