Whamcloud - gitweb
LU-2901 mdt: duplicate link names in directory
[fs/lustre-release.git] / lustre / include / lustre / lustre_idl.h
index b9fd5a7..f2900b4 100644 (file)
@@ -1674,6 +1674,17 @@ struct lov_mds_md_v3 {            /* LOV EA mds/wire data (little-endian) */
        struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
 };
 
+static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
+{
+       if (lmm_magic == LOV_MAGIC_V3)
+               return sizeof(struct lov_mds_md_v3) +
+                               stripes * sizeof(struct lov_ost_data_v1);
+       else
+               return sizeof(struct lov_mds_md_v1) +
+                               stripes * sizeof(struct lov_ost_data_v1);
+}
+
+
 #define OBD_MD_FLID        (0x00000001ULL) /* object ID */
 #define OBD_MD_FLATIME     (0x00000002ULL) /* access time */
 #define OBD_MD_FLMTIME     (0x00000004ULL) /* data modification time */
@@ -2685,6 +2696,10 @@ struct ldlm_res_id {
         __u64 name[RES_NAME_SIZE];
 };
 
+#define DLDLMRES       "["LPX64":"LPX64":"LPX64"]."LPX64i
+#define PLDLMRES(res)  (res)->lr_name.name[0], (res)->lr_name.name[1], \
+                       (res)->lr_name.name[2], (res)->lr_name.name[3]
+
 extern void lustre_swab_ldlm_res_id (struct ldlm_res_id *id);
 
 static inline int ldlm_res_eq(const struct ldlm_res_id *res0,