X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fllog_swab.c;h=67c0ce62713cef37500f7a88ce3a32faef7ed91e;hb=f9fe2977d184fbc8e345c4a77f4596d059b7d118;hp=c644efb64ac1fd0b1d982a25161b3648fb9a57b7;hpb=09427dbf40ca6895e8f9a78324eec0a048a98684;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/llog_swab.c b/lustre/obdclass/llog_swab.c index c644efb..67c0ce6 100644 --- a/lustre/obdclass/llog_swab.c +++ b/lustre/obdclass/llog_swab.c @@ -27,7 +27,6 @@ */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. * * lustre/obdclass/llog_swab.c * @@ -203,21 +202,28 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) * Because the tail follows a variable-length structure we need * to compute its location at runtime */ - tail = (struct llog_rec_tail *)((char *)&cr->cr + - changelog_rec_size(&cr->cr) + - cr->cr.cr_namelen); + tail = (struct llog_rec_tail *)((char *)rec + + rec->lrh_len - sizeof(*tail)); break; } case CHANGELOG_USER_REC: + case CHANGELOG_USER_REC2: { - struct llog_changelog_user_rec *cur = - (struct llog_changelog_user_rec *)rec; + struct llog_changelog_user_rec2 *cur = + (struct llog_changelog_user_rec2 *)rec; __swab32s(&cur->cur_id); __swab64s(&cur->cur_endrec); __swab32s(&cur->cur_time); - tail = &cur->cur_tail; + if (cur->cur_hdr.lrh_type == CHANGELOG_USER_REC2) { + __swab32s(&cur->cur_mask); + BUILD_BUG_ON(offsetof(typeof(*cur), cur_padding1) == 0); + BUILD_BUG_ON(offsetof(typeof(*cur), cur_padding2) == 0); + BUILD_BUG_ON(offsetof(typeof(*cur), cur_padding3) == 0); + } + tail = (struct llog_rec_tail *)((char *)rec + + rec->lrh_len - sizeof(*tail)); break; } @@ -414,7 +420,6 @@ void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg) print_lustre_cfg(lcfg); EXIT; - return; } /* used only for compatibility with old on-disk cfg_marker data */ @@ -447,7 +452,7 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, int swab, int size) __u32 createtime, canceltime; /* * There was a problem with the original declaration of - * cfg_marker on 32-bit systems because it used time_t as + * cfg_marker on 32-bit systems because it used 32 time as * a wire protocol structure, and didn't verify this in * wirecheck. We now have to convert the offsets of the * later fields in order to work on 32- and 64-bit systems. @@ -480,5 +485,4 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, int swab, int size) } EXIT; - return; }