X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fllog_swab.c;h=822e6d555b32bb74eb7fd545d2696285297ed1bc;hb=ff0b34274d4f8754ebba0a5a812bd117cbec37b1;hp=a647a4b45921680ef7c1eaa0988e1ed679c4f016;hpb=1f1d3a376d488d715dd1b0c94d5b66ea05c1e6ca;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/llog_swab.c b/lustre/obdclass/llog_swab.c index a647a4b..822e6d5 100644 --- a/lustre/obdclass/llog_swab.c +++ b/lustre/obdclass/llog_swab.c @@ -27,7 +27,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2013, Intel Corporation. + * Copyright (c) 2012, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -85,7 +85,6 @@ void lustre_swab_llog_id(struct llog_logid *log_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) { @@ -118,7 +117,6 @@ void lustre_swab_ll_fid(struct ll_fid *fid) __swab32s (&fid->generation); __swab32s (&fid->f_type); } -EXPORT_SYMBOL(lustre_swab_ll_fid); void lustre_swab_lu_seq_range(struct lu_seq_range *range) { @@ -171,28 +169,32 @@ 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); - if (CHANGELOG_REC_EXTENDED(&cr->cr)) { - struct llog_changelog_ext_rec *ext = - (struct llog_changelog_ext_rec *)rec; - - lustre_swab_lu_fid(&ext->cr.cr_sfid); - lustre_swab_lu_fid(&ext->cr.cr_spfid); - tail = &ext->cr_tail; - } else { - tail = &cr->cr_tail; + 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 (cr->cr.cr_flags & CLF_RENAME) { + struct changelog_ext_rename *rnm = + changelog_rec_rename(&cr->cr); + + lustre_swab_lu_fid(&rnm->cr_sfid); + lustre_swab_lu_fid(&rnm->cr_spfid); } - break; - } + /* 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); + break; + } + case CHANGELOG_USER_REC: { struct llog_changelog_user_rec *cur = @@ -275,12 +277,11 @@ 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); static void print_llog_hdr(struct llog_log_hdr *h) { @@ -359,7 +360,6 @@ void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg) EXIT; return; } -EXPORT_SYMBOL(lustre_swab_lustre_cfg); /* used only for compatibility with old on-disk cfg_marker data */ struct cfg_marker32 { @@ -423,4 +423,3 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, int swab, int size) EXIT; return; } -EXPORT_SYMBOL(lustre_swab_cfg_marker);