[sheepdog] [PATCH] dog: show io mode in 'vdi cache info'

Liu Yuan namei.unix at gmail.com
Fri Aug 23 17:39:53 CEST 2013


Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 dog/vdi.c                |    3 ++-
 include/internal_proto.h |    1 +
 sheep/object_cache.c     |    1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index 65c9bac..30f686b 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -1994,7 +1994,8 @@ static int vdi_cache_info(int argc, char **argv)
 
 	size_to_str(info.size, size_str, sizeof(size_str));
 	size_to_str(info.used, used_str, sizeof(used_str));
-	fprintf(stdout, "\nCache size %s, used %s\n", size_str, used_str);
+	fprintf(stdout, "\nCache size %s, used %s, %s\n", size_str, used_str,
+		info.directio ? "directio" : "non-directio");
 
 	return EXIT_SUCCESS;
 }
diff --git a/include/internal_proto.h b/include/internal_proto.h
index 64a2770..2c24a52 100644
--- a/include/internal_proto.h
+++ b/include/internal_proto.h
@@ -212,6 +212,7 @@ struct object_cache_info {
 	uint64_t used;
 	struct cache_info caches[CACHE_MAX];
 	int count;
+	uint8_t directio;
 };
 
 #endif /* __INTERNAL_PROTO_H__ */
diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index 6edc06a..650ab44 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -1400,6 +1400,7 @@ int object_cache_get_info(struct object_cache_info *info)
 		sd_unlock(&hashtable_lock[i]);
 	}
 	info->count = j;
+	info->directio = sys->object_cache_directio;
 
 	return sizeof(*info);
 }
-- 
1.7.9.5




More information about the sheepdog mailing list