Whamcloud - gitweb
LU-10499 pcc: use foreign layout for PCCRO on server side
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index 6157643..044361a 100644 (file)
@@ -179,6 +179,26 @@ struct hsm_attrs {
 };
 extern void lustre_hsm_swab(struct hsm_attrs *attrs);
 
+static inline void lov_foreign_hsm_to_cpu(struct lov_hsm_base *dst,
+                                         const struct lov_foreign_md *lfm)
+{
+       struct lov_hsm_base *src = (struct lov_hsm_base *)lfm->lfm_value;
+
+       dst->lhb_archive_id = __le64_to_cpu(src->lhb_archive_id);
+       dst->lhb_archive_ver = __le64_to_cpu(src->lhb_archive_ver);
+       memcpy(dst->lhb_uuid, src->lhb_uuid, sizeof(dst->lhb_uuid));
+}
+
+static inline void lov_foreign_hsm_to_le(struct lov_foreign_md *lfm,
+                                        struct lov_hsm_base *src)
+{
+       struct lov_hsm_base *dst = (struct lov_hsm_base *)lfm->lfm_value;
+
+       dst->lhb_archive_id = __cpu_to_le64(dst->lhb_archive_id);
+       dst->lhb_archive_ver = __cpu_to_le64(dst->lhb_archive_ver);
+       memcpy(dst->lhb_uuid, src->lhb_uuid, sizeof(dst->lhb_uuid));
+}
+
 /**
  * fid constants
  */