X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Fllog_swab.c;h=25e249a8215d5e52d95d9a9f6427364df135f7a9;hp=150921a39352d3d2e70f547beb7542b586bff1d5;hb=54436c727ba242954e64b7ef16c8186550c1a6f9;hpb=80f90fcde73e2faff8b7b0ffc7c19bc52982e027 diff --git a/lustre/obdclass/llog_swab.c b/lustre/obdclass/llog_swab.c index 150921a..25e249a 100644 --- a/lustre/obdclass/llog_swab.c +++ b/lustre/obdclass/llog_swab.c @@ -42,9 +42,6 @@ #define DEBUG_SUBSYSTEM S_LOG -#ifndef __KERNEL__ -#include -#endif #include @@ -174,16 +171,17 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) } case CHANGELOG_REC: { - struct llog_changelog_rec *cr = (struct llog_changelog_rec*)rec; - - __swab16s(&cr->cr.cr_namelen); - __swab16s(&cr->cr.cr_flags); - __swab32s(&cr->cr.cr_type); - __swab64s(&cr->cr.cr_index); - __swab64s(&cr->cr.cr_prev); - __swab64s(&cr->cr.cr_time); - lustre_swab_lu_fid(&cr->cr.cr_tfid); - lustre_swab_lu_fid(&cr->cr.cr_pfid); + struct llog_changelog_rec *cr = + (struct llog_changelog_rec *)rec; + + __swab16s(&cr->cr.cr_namelen); + __swab16s(&cr->cr.cr_flags); + __swab32s(&cr->cr.cr_type); + __swab64s(&cr->cr.cr_index); + __swab64s(&cr->cr.cr_prev); + __swab64s(&cr->cr.cr_time); + lustre_swab_lu_fid(&cr->cr.cr_tfid); + lustre_swab_lu_fid(&cr->cr.cr_pfid); if (CHANGELOG_REC_EXTENDED(&cr->cr)) { struct llog_changelog_ext_rec *ext = (struct llog_changelog_ext_rec *)rec; @@ -194,8 +192,10 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) } else { tail = &cr->cr_tail; } - break; - } + tail = (struct llog_rec_tail *)((char *)tail + + cr->cr.cr_namelen); + break; + } case CHANGELOG_USER_REC: { struct llog_changelog_user_rec *cur = @@ -278,10 +278,10 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) rec->lrh_type, rec); } - if (tail) { - __swab32s(&tail->lrt_len); - __swab32s(&tail->lrt_index); - } + if (tail) { + __swab32s(&tail->lrt_len); + __swab32s(&tail->lrt_index); + } } EXPORT_SYMBOL(lustre_swab_llog_rec);