Whamcloud - gitweb
LU-1866 misc: fix some issues found during LFSCK
[fs/lustre-release.git] / lustre / ptlrpc / pack_generic.c
index f814abe..6de2ad3 100644 (file)
@@ -1878,7 +1878,7 @@ void lustre_swab_mdt_body (struct mdt_body *b)
         __swab64s (&b->ctime);
         __swab64s (&b->blocks);
         __swab64s (&b->ioepoch);
-        __swab64s (&b->ino);
+       CLASSERT(offsetof(typeof(*b), unused1) != 0);
         __swab32s (&b->fsuid);
         __swab32s (&b->fsgid);
         __swab32s (&b->capability);
@@ -1888,7 +1888,7 @@ void lustre_swab_mdt_body (struct mdt_body *b)
         __swab32s (&b->flags);
         __swab32s (&b->rdev);
         __swab32s (&b->nlink);
-        __swab32s (&b->generation);
+       CLASSERT(offsetof(typeof(*b), unused2) != 0);
         __swab32s (&b->suppgid);
         __swab32s (&b->eadatasize);
         __swab32s (&b->aclsize);
@@ -2499,6 +2499,14 @@ void lustre_swab_hsm_extent(struct hsm_extent *extent)
        __swab64s(&extent->length);
 }
 
+void lustre_swab_hsm_current_action(struct hsm_current_action *action)
+{
+       __swab32s(&action->hca_state);
+       __swab32s(&action->hca_action);
+       lustre_swab_hsm_extent(&action->hca_location);
+}
+EXPORT_SYMBOL(lustre_swab_hsm_current_action);
+
 void lustre_swab_hsm_user_item(struct hsm_user_item *hui)
 {
        lustre_swab_lu_fid(&hui->hui_fid);
@@ -2526,3 +2534,31 @@ void lustre_swab_hsm_progress_kernel(struct hsm_progress_kernel *hpk)
 }
 EXPORT_SYMBOL(lustre_swab_hsm_progress_kernel);
 
+void lustre_swab_hsm_request(struct hsm_request *hr)
+{
+       __swab32s(&hr->hr_action);
+       __swab32s(&hr->hr_archive_id);
+       __swab64s(&hr->hr_flags);
+       __swab32s(&hr->hr_itemcount);
+       __swab32s(&hr->hr_data_len);
+}
+EXPORT_SYMBOL(lustre_swab_hsm_request);
+
+void lustre_swab_update_buf(struct update_buf *ub)
+{
+       __swab32s(&ub->ub_magic);
+       __swab32s(&ub->ub_count);
+}
+EXPORT_SYMBOL(lustre_swab_update_buf);
+
+void lustre_swab_update_reply_buf(struct update_reply *ur)
+{
+       int i;
+
+       __swab32s(&ur->ur_version);
+       __swab32s(&ur->ur_count);
+       for (i = 0; i < ur->ur_count; i++)
+               __swab32s(&ur->ur_lens[i]);
+}
+EXPORT_SYMBOL(lustre_swab_update_reply_buf);
+