Whamcloud - gitweb
LU-2675 obdclass: remove uses of lov_stripe_md
[fs/lustre-release.git] / lustre / include / lustre / lustre_idl.h
index 869e682..3620fa6 100644 (file)
@@ -1741,6 +1741,30 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
                                stripes * sizeof(struct lov_ost_data_v1);
 }
 
+static inline __u32
+lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
+{
+       switch (lmm_magic) {
+       case LOV_MAGIC_V1: {
+               struct lov_mds_md_v1 lmm;
+
+               if (buf_size < sizeof(lmm))
+                       return 0;
+
+               return (buf_size - sizeof(lmm)) / sizeof(lmm.lmm_objects[0]);
+       }
+       case LOV_MAGIC_V3: {
+               struct lov_mds_md_v3 lmm;
+
+               if (buf_size < sizeof(lmm))
+                       return 0;
+
+               return (buf_size - sizeof(lmm)) / sizeof(lmm.lmm_objects[0]);
+       }
+       default:
+               return 0;
+       }
+}
 
 #define OBD_MD_FLID        (0x00000001ULL) /* object ID */
 #define OBD_MD_FLATIME     (0x00000002ULL) /* access time */
@@ -2852,6 +2876,8 @@ typedef enum {
  * protocol, this will limit the max number of OSTs per LOV */
 
 #define LOV_DESC_MAGIC 0xB0CCDE5C
+#define LOV_DESC_QOS_MAXAGE_DEFAULT 5  /* Seconds */
+#define LOV_DESC_STRIPE_SIZE_DEFAULT (1 << LNET_MTU_BITS)
 
 /* LOV settings descriptor (should only contain static info) */
 struct lov_desc {