Whamcloud - gitweb
LU-1346 libcfs: cleanup libcfs primitive (linux-prim.h)
[fs/lustre-release.git] / lustre / obdclass / llog_swab.c
index ad71309..f509874 100644 (file)
@@ -81,12 +81,19 @@ 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);
+}
+EXPORT_SYMBOL(lustre_swab_llog_id);
+
 void lustre_swab_llogd_body (struct llogd_body *d)
 {
         ENTRY;
         print_llogd_body(d);
-       lustre_swab_ost_id(&d->lgd_logid.lgl_oi);
-        __swab32s (&d->lgd_logid.lgl_ogen);
+       lustre_swab_llog_id(&d->lgd_logid);
         __swab32s (&d->lgd_ctxt_idx);
         __swab32s (&d->lgd_llh_flags);
         __swab32s (&d->lgd_index);
@@ -102,8 +109,7 @@ void lustre_swab_llogd_conn_body (struct llogd_conn_body *d)
 {
         __swab64s (&d->lgdc_gen.mnt_cnt);
         __swab64s (&d->lgdc_gen.conn_cnt);
-       lustre_swab_ost_id(&d->lgdc_logid.lgl_oi);
-        __swab32s (&d->lgdc_logid.lgl_ogen);
+       lustre_swab_llog_id(&d->lgdc_logid);
         __swab32s (&d->lgdc_ctxt_idx);
 }
 EXPORT_SYMBOL(lustre_swab_llogd_conn_body);
@@ -200,6 +206,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 =
@@ -233,8 +256,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec)
        {
                struct llog_logid_rec *lid = (struct llog_logid_rec *)rec;
 
-               lustre_swab_ost_id(&lid->lid_id.lgl_oi);
-               __swab32s(&lid->lid_id.lgl_ogen);
+               lustre_swab_llog_id(&lid->lid_id);
                tail = &lid->lid_tail;
                break;
        }