#define DEBUG_SUBSYSTEM S_LOG
-
#include <lustre_log.h>
#include <lustre_update.h>
+#include <llog_swab.h>
+
+#ifdef HAVE_SERVER_SUPPORT
+#define SERVER_ONLY_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol)
+#define SERVER_ONLY
+#else
+#define SERVER_ONLY static
+#define SERVER_ONLY_EXPORT_SYMBOL(symbol)
+#endif
static void print_llogd_body(struct llogd_body *d)
{
CDEBUG(D_OTHER, "llogd body: %p\n", d);
CDEBUG(D_OTHER, "\tlgd_logid.lgl_oi.oi_fid: "DFID"\n",
- PFID(&d->lgd_logid.lgl_oi.oi_fid));
+ PLOGID(&d->lgd_logid));
CDEBUG(D_OTHER, "\tlgd_logid.lgl_ogen: %#x\n", d->lgd_logid.lgl_ogen);
CDEBUG(D_OTHER, "\tlgd_ctxt_idx: %#x\n", d->lgd_ctxt_idx);
CDEBUG(D_OTHER, "\tlgd_llh_flags: %#x\n", d->lgd_llh_flags);
}
EXPORT_SYMBOL(lustre_swab_lu_seq_range);
-void lustre_swab_update_ops(struct update_ops *uops, unsigned int op_count)
+SERVER_ONLY void lustre_swab_update_ops(struct update_ops *uops,
+ unsigned int op_count)
{
unsigned int i;
unsigned int j;
__swab16s(&uops->uops_op[i].uop_params_off[j]);
}
}
-EXPORT_SYMBOL(lustre_swab_update_ops);
+SERVER_ONLY_EXPORT_SYMBOL(lustre_swab_update_ops);
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;
}
print_lustre_cfg(lcfg);
EXIT;
}
+EXPORT_SYMBOL(lustre_swab_lustre_cfg);
/* used only for compatibility with old on-disk cfg_marker data */
struct cfg_marker32 {
EXIT;
}
+EXPORT_SYMBOL(lustre_swab_cfg_marker);