Whamcloud - gitweb
LU-3569 ofd: packing ost_idx in IDIF
[fs/lustre-release.git] / lustre / obdclass / llog_swab.c
index 10c6225..e5af8a7 100644 (file)
@@ -72,7 +72,8 @@ EXPORT_SYMBOL(lustre_swab_lu_fid);
 
 void lustre_swab_ost_id(struct ost_id *oid)
 {
-       if (fid_seq_is_mdt0(oid->oi.oi_seq)) {
+       if (fid_seq_is_mdt0(oid->oi.oi_seq) ||
+           fid_seq_is_default(oid->oi.oi_seq)) {
                __swab64s(&oid->oi.oi_id);
                __swab64s(&oid->oi.oi_seq);
        } else {
@@ -82,7 +83,7 @@ void lustre_swab_ost_id(struct ost_id *oid)
 EXPORT_SYMBOL(lustre_swab_ost_id);
 
 void lustre_swab_llog_id(struct llog_logid *log_id)
-{ 
+{
        __swab64s(&log_id->lgl_oi.oi.oi_id);
        __swab64s(&log_id->lgl_oi.oi.oi_seq);
         __swab32s(&log_id->lgl_ogen);
@@ -206,6 +207,23 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec)
                 break;
         }
 
+       case HSM_AGENT_REC: {
+               struct llog_agent_req_rec *arr =
+                       (struct llog_agent_req_rec *)rec;
+
+               __swab32s(&arr->arr_hai.hai_len);
+               __swab32s(&arr->arr_hai.hai_action);
+               lustre_swab_lu_fid(&arr->arr_hai.hai_fid);
+               lustre_swab_lu_fid(&arr->arr_hai.hai_dfid);
+               __swab64s(&arr->arr_hai.hai_cookie);
+               __swab64s(&arr->arr_hai.hai_extent.offset);
+               __swab64s(&arr->arr_hai.hai_extent.length);
+               __swab64s(&arr->arr_hai.hai_gid);
+               /* no swabing for opaque data */
+               /* hai_data[0]; */
+               break;
+       }
+
        case MDS_SETATTR64_REC:
        {
                struct llog_setattr64_rec *lsr =