pthread_mutex_unlock(&report_ptr->report_template_mutex);
}
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
+/* compatibility so lipe_scan3 can run on EXA5 that is missing this function */
+
+struct llapi_layout_comp {
+ uint64_t llc_pattern;
+ struct { /* For plain layout. */
+ uint64_t llc_stripe_size;
+ uint64_t llc_stripe_count;
+ uint64_t llc_stripe_offset;
+ /**
+ * Add 1 so user always gets back a null terminated string.
+ */
+ char llc_pool_name[LOV_MAXPOOLNAME + 1];
+ /**
+ * Number of objects in llc_objects array if was initialized.
+ */
+ uint32_t llc_objects_count;
+ uint8_t llc_compr_type;
+ uint8_t llc_compr_lvl;
+ uint8_t llc_compr_chunk_log_bits;
+ struct lov_user_ost_data_v1 *llc_objects;
+ };
+};
+
+#ifndef LLAPI_LAYOUT_MAGIC
+#define LLAPI_LAYOUT_MAGIC 0x11AD1107 /* LLAPILOT */
+#endif
+
+struct llapi_layout {
+ uint32_t llot_magic; /* LLAPI_LAYOUT_MAGIC */
+ uint32_t llot_gen;
+ uint32_t llot_flags;
+ bool llot_is_composite;
+ uint16_t llot_mirror_count;
+ /* Cursor pointing to one of the components in llot_comp_list */
+ struct llapi_layout_comp *llot_cur_comp;
+ struct lipe_list_head llot_comp_list;
+};
+
+static struct llapi_layout_comp *
+__llapi_layout_cur_comp(const struct llapi_layout *layout)
+{
+ if (layout == NULL || layout->llot_magic != LLAPI_LAYOUT_MAGIC) {
+ errno = EINVAL;
+ return NULL;
+ }
+ if (layout->llot_cur_comp == NULL)
+ errno = EINVAL;
+
+ return layout->llot_cur_comp;
+}
+
+int llapi_layout_compress_get(struct llapi_layout *layout,
+ __u8 *type, __u8 *level)
+{
+ struct llapi_layout_comp *comp;
+
+ comp = __llapi_layout_cur_comp(layout);
+ if (comp == NULL)
+ return -1;
+
+ if (type)
+ *type = comp->llc_compr_type;
+ if (level)
+ *level = comp->llc_compr_lvl;
+
+ return 0;
+}
+#endif
int ls3_stats_update_info(struct ls3_object_attrs *loa_all)
{
if (rc < 0 || compr_type == LL_COMPR_TYPE_NONE)
return 0; /* skip compression statistics */
- /* TODO: Сompression statistics from MDT by type & lvl */
+ /* TODO: Compression statistics from MDT by type & lvl */
} else {
struct filter_fid ptr_filter_fid;
struct ost_layout ptr_ost_layout;
- struct ost_layout_compr layout_compr;
+ struct ost_layout_compr layout_compr;
ptr_filter_fid = loa_all->loa_filter_fid;
layout_compr = ptr_filter_fid.ff_layout_compr;
if (layout_compr.ol_compr_type == LL_COMPR_TYPE_NONE)
return 0; /* skip compression statistics */
- /* TODO: Сompression statistics from OST by type & lvl
+ /* TODO: Compression statistics from OST by type & lvl
* with using struct ost_layout_compr */
}