+static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
+ int is_dir, int verbose, int quiet,
+ char *pool_name)
+{
+ char *prefix = is_dir ? "" : "lmm_";
+ char nl = is_dir ? ' ' : '\n';
+
+ if (verbose && path)
+ llapi_printf(LLAPI_MSG_NORMAL, "%s\n", path);
+
+ if ((verbose & VERBOSE_DETAIL) && !is_dir) {
+ llapi_printf(LLAPI_MSG_NORMAL, "lmm_magic: 0x%08X\n",
+ lum->lmm_magic);
+ llapi_printf(LLAPI_MSG_NORMAL, "lmm_object_gr: "LPX64"\n",
+ lum->lmm_object_gr);
+ llapi_printf(LLAPI_MSG_NORMAL, "lmm_object_id: "LPX64"\n",
+ lum->lmm_object_id);
+ }
+
+ if (verbose & VERBOSE_COUNT) {
+ if (!quiet)
+ llapi_printf(LLAPI_MSG_NORMAL, "%sstripe_count: ",
+ prefix);
+ llapi_printf(LLAPI_MSG_NORMAL, "%u%c",
+ (int)lum->lmm_stripe_count, nl);
+ }
+
+ if (verbose & VERBOSE_SIZE) {
+ if (!quiet)
+ llapi_printf(LLAPI_MSG_NORMAL, "%sstripe_size: ",
+ prefix);
+ llapi_printf(LLAPI_MSG_NORMAL, "%u%c", lum->lmm_stripe_size,
+ nl);
+ }
+
+ if ((verbose & VERBOSE_DETAIL) && !is_dir) {
+ llapi_printf(LLAPI_MSG_NORMAL, "lmm_stripe_pattern: %x%c",
+ lum->lmm_pattern, nl);
+ }
+
+ if (verbose & VERBOSE_OFFSET) {
+ if (!quiet)
+ llapi_printf(LLAPI_MSG_NORMAL, "%sstripe_offset: ",
+ prefix);
+ llapi_printf(LLAPI_MSG_NORMAL, "%u%c",
+ lum->lmm_objects[0].l_ost_idx, nl);
+ }
+
+ if ((verbose & VERBOSE_POOL) && (pool_name != NULL))
+ llapi_printf(LLAPI_MSG_NORMAL, "pool: %s%c", pool_name, nl);
+
+ if (is_dir)
+ llapi_printf(LLAPI_MSG_NORMAL, "\n");
+}
+