Whamcloud - gitweb
LU-1331 changelog: allow changelog to extend record
authorLai Siyao <laisiyao@whamcloud.com>
Fri, 1 Jun 2012 11:46:44 +0000 (19:46 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 10 Jul 2012 04:04:23 +0000 (00:04 -0400)
Previously rename is split into two records, this isn't natural and
makes replication hard because rename needs two records, but they
may not be consecutive.

To solve this, allow Changelog to extend record, add fields sfid/spfid
in changelog record to store source/parent fid, and pack both source
and target name into the record.

Added changelog flag CLF_RENAME_LAST: rename unlink of last hardlink
of the target.

Added macro HAVE_CHANGELOG_EXTEND_REC: liblustreapi receives all
changelog records in changelog_ext_rec format.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I97b990687726e45e661cfb11609f80132c84825d
Reviewed-on: http://review.whamcloud.com/2577
Tested-by: Hudson
Reviewed-by: Thomas LEIBOVICI - CEA <thomas.leibovici@cea.fr>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
14 files changed:
lustre/include/lustre/liblustreapi.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h
lustre/mdc/mdc_request.c
lustre/mdd/mdd_device.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/obdclass/llog_swab.c
lustre/ptlrpc/wiretest.c
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/lustre_rsync.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 813badb..9a0b8f8 100644 (file)
@@ -240,11 +240,16 @@ extern int llapi_get_data_version(int fd, __u64 *data_version, __u64 flags);
    slow user parsing of the records, but it also prevents us from cleaning
    up if the records are not consumed. */
 
+/* Records received are in extentded format now, though most of them are still
+ * written in disk in changelog_rec format (to save space and time), it's
+ * converted to extented format in liblustre to ease changelog analysis. */
+#define HAVE_CHANGELOG_EXTEND_REC 1
+
 extern int llapi_changelog_start(void **priv, int flags, const char *mdtname,
                                  long long startrec);
 extern int llapi_changelog_fini(void **priv);
-extern int llapi_changelog_recv(void *priv, struct changelog_rec **rech);
-extern int llapi_changelog_free(struct changelog_rec **rech);
+extern int llapi_changelog_recv(void *priv, struct changelog_ext_rec **rech);
+extern int llapi_changelog_free(struct changelog_ext_rec **rech);
 /* Allow records up to endrec to be destroyed; requires registered id. */
 extern int llapi_changelog_clear(const char *mdtname, const char *idstr,
                                  long long endrec);
index c574371..7cb1477 100644 (file)
@@ -2689,6 +2689,12 @@ struct llog_changelog_rec {
         struct llog_rec_tail cr_tail; /**< for_sizezof_only */
 } __attribute__((packed));
 
+struct llog_changelog_ext_rec {
+       struct llog_rec_hdr      cr_hdr;
+       struct changelog_ext_rec cr;
+       struct llog_rec_tail     cr_tail; /**< for_sizezof_only */
+} __attribute__((packed));
+
 #define CHANGELOG_USER_PREFIX "cl"
 
 struct llog_changelog_user_rec {
index efd1e88..cfff2e1 100644 (file)
@@ -515,23 +515,29 @@ enum changelog_rec_type {
 };
 
 static inline const char *changelog_type2str(int type) {
-        static const char *changelog_str[] = {
-                "MARK",  "CREAT", "MKDIR", "HLINK", "SLINK", "MKNOD", "UNLNK",
-                "RMDIR", "RNMFM", "RNMTO", "OPEN",  "CLOSE", "IOCTL", "TRUNC",
-                "SATTR", "XATTR", "HSM",   "MTIME", "CTIME", "ATIME"  };
-        if (type >= 0 && type < CL_LAST)
-                return changelog_str[type];
-        return NULL;
+       static const char *changelog_str[] = {
+               "MARK",  "CREAT", "MKDIR", "HLINK", "SLINK", "MKNOD", "UNLNK",
+               "RMDIR", "RENME", "RNMTO", "OPEN",  "CLOSE", "IOCTL", "TRUNC",
+               "SATTR", "XATTR", "HSM",   "MTIME", "CTIME", "ATIME"  };
+       if (type >= 0 && type < CL_LAST)
+               return changelog_str[type];
+       return NULL;
 }
 
 /* per-record flags */
-#define CLF_VERSION  0x1000
-#define CLF_FLAGMASK 0x0FFF
+#define CLF_VERSION     0x1000
+#define CLF_EXT_VERSION 0x2000
+#define CLF_FLAGSHIFT   12
+#define CLF_FLAGMASK    ((1U << CLF_FLAGSHIFT) - 1)
+#define CLF_VERMASK     (~CLF_FLAGMASK)
 /* Anything under the flagmask may be per-type (if desired) */
 /* Flags for unlink */
 #define CLF_UNLINK_LAST       0x0001 /* Unlink of last hardlink */
 #define CLF_UNLINK_HSM_EXISTS 0x0002 /* File has something in HSM */
                                      /* HSM cleaning needed */
+/* Flags for rename */
+#define CLF_RENAME_LAST       0x0001 /* rename unlink last hardlink of target */
+
 /* Flags for HSM */
 /* 12b used (from high weight to low weight):
  * 2b for flags
@@ -601,7 +607,8 @@ static inline void hsm_set_cl_error(int *flags, int error)
         *flags |= (error << CLF_HSM_ERR_L);
 }
 
-#define CR_MAXSIZE (PATH_MAX + sizeof(struct changelog_rec))
+#define CR_MAXSIZE cfs_size_round(2*NAME_MAX + 1 + sizeof(struct changelog_rec))
+
 struct changelog_rec {
         __u16                 cr_namelen;
         __u16                 cr_flags; /**< (flags&CLF_FLAGMASK)|CLF_VERSION */
@@ -617,6 +624,55 @@ struct changelog_rec {
         char                  cr_name[0];     /**< last element */
 } __attribute__((packed));
 
+/* changelog_ext_rec is 2*sizeof(lu_fid) bigger than changelog_rec, to save
+ * space, only rename uses changelog_ext_rec, while others use changelog_rec to
+ * store records.
+ */
+struct changelog_ext_rec {
+       __u16                   cr_namelen;
+       __u16                   cr_flags; /**< (flags & CLF_FLAGMASK) |
+                                               CLF_EXT_VERSION */
+       __u32                   cr_type;  /**< \a changelog_rec_type */
+       __u64                   cr_index; /**< changelog record number */
+       __u64                   cr_prev;  /**< last index for this target fid */
+       __u64                   cr_time;
+       union {
+               lustre_fid      cr_tfid;        /**< target fid */
+               __u32           cr_markerflags; /**< CL_MARK flags */
+       };
+       lustre_fid              cr_pfid;        /**< target parent fid */
+       lustre_fid              cr_sfid;        /**< source fid, or zero */
+       lustre_fid              cr_spfid;       /**< source parent fid, or zero */
+       char                    cr_name[0];     /**< last element */
+} __attribute__((packed));
+
+#define CHANGELOG_REC_EXTENDED(rec) \
+       (((rec)->cr_flags & CLF_VERMASK) == CLF_EXT_VERSION)
+
+static inline int changelog_rec_size(struct changelog_rec *rec)
+{
+       return CHANGELOG_REC_EXTENDED(rec) ? sizeof(struct changelog_ext_rec):
+                                            sizeof(*rec);
+}
+
+static inline char *changelog_rec_name(struct changelog_rec *rec)
+{
+       return CHANGELOG_REC_EXTENDED(rec) ?
+               ((struct changelog_ext_rec *)rec)->cr_name: rec->cr_name;
+}
+
+static inline int changelog_rec_snamelen(struct changelog_ext_rec *rec)
+{
+       LASSERT(CHANGELOG_REC_EXTENDED(rec));
+       return rec->cr_namelen - strlen(rec->cr_name) - 1;
+}
+
+static inline char *changelog_rec_sname(struct changelog_ext_rec *rec)
+{
+       LASSERT(CHANGELOG_REC_EXTENDED(rec));
+       return rec->cr_name + strlen(rec->cr_name) + 1;
+}
+
 struct ioc_changelog {
         __u64 icc_recno;
         __u32 icc_mdtindex;
index a0e392a..c869286 100644 (file)
@@ -1244,14 +1244,14 @@ static int changelog_show_cb(struct llog_handle *llh, struct llog_rec_hdr *hdr,
                 RETURN(0);
         }
 
-        CDEBUG(D_CHANGELOG, LPU64" %02d%-5s "LPU64" 0x%x t="DFID" p="DFID
-               " %.*s\n", rec->cr.cr_index, rec->cr.cr_type,
-               changelog_type2str(rec->cr.cr_type), rec->cr.cr_time,
-               rec->cr.cr_flags & CLF_FLAGMASK,
-               PFID(&rec->cr.cr_tfid), PFID(&rec->cr.cr_pfid),
-               rec->cr.cr_namelen, rec->cr.cr_name);
-
-        len = sizeof(*lh) + sizeof(rec->cr) + rec->cr.cr_namelen;
+       CDEBUG(D_CHANGELOG, LPU64" %02d%-5s "LPU64" 0x%x t="DFID" p="DFID
+               " %.*s\n", rec->cr.cr_index, rec->cr.cr_type,
+               changelog_type2str(rec->cr.cr_type), rec->cr.cr_time,
+               rec->cr.cr_flags & CLF_FLAGMASK,
+               PFID(&rec->cr.cr_tfid), PFID(&rec->cr.cr_pfid),
+               rec->cr.cr_namelen, changelog_rec_name(&rec->cr));
+
+       len = sizeof(*lh) + changelog_rec_size(&rec->cr) + rec->cr.cr_namelen;
 
         /* Set up the message */
         lh = changelog_kuc_hdr(cs->cs_buf, len, cs->cs_flags);
index 2334f03..029f6e1 100644 (file)
@@ -325,6 +325,42 @@ int mdd_changelog_llog_write(struct mdd_device         *mdd,
         return rc;
 }
 
+/** Add a changelog_ext entry \a rec to the changelog llog
+ * \param mdd
+ * \param rec
+ * \param handle - currently ignored since llogs start their own transaction;
+ *             this will hopefully be fixed in llog rewrite
+ * \retval 0 ok
+ */
+int mdd_changelog_ext_llog_write(struct mdd_device *mdd,
+                                struct llog_changelog_ext_rec *rec,
+                                struct thandle *handle)
+{
+       struct obd_device *obd = mdd2obd_dev(mdd);
+       struct llog_ctxt *ctxt;
+       int rc;
+
+       rec->cr_hdr.lrh_len = llog_data_len(sizeof(*rec) + rec->cr.cr_namelen);
+       /* llog_lvfs_write_rec sets the llog tail len */
+       rec->cr_hdr.lrh_type = CHANGELOG_REC;
+       rec->cr.cr_time = cl_time();
+       cfs_spin_lock(&mdd->mdd_cl.mc_lock);
+       /* NB: I suppose it's possible llog_add adds out of order wrt cr_index,
+        * but as long as the MDD transactions are ordered correctly for e.g.
+        * rename conflicts, I don't think this should matter. */
+       rec->cr.cr_index = ++mdd->mdd_cl.mc_index;
+       cfs_spin_unlock(&mdd->mdd_cl.mc_lock);
+       ctxt = llog_get_context(obd, LLOG_CHANGELOG_ORIG_CTXT);
+       if (ctxt == NULL)
+               return -ENXIO;
+
+       /* nested journal transaction */
+       rc = llog_add(ctxt, &rec->cr_hdr, NULL, NULL, 0);
+       llog_ctxt_put(ctxt);
+
+       return rc;
+}
+
 /** Remove entries with indicies up to and including \a endrec from the
  *  changelog
  * \param mdd
index b87fe6b..7fa3e0a 100644 (file)
@@ -612,22 +612,46 @@ int mdd_declare_llog_record(const struct lu_env *env, struct mdd_device *mdd,
 }
 
 int mdd_declare_changelog_store(const struct lu_env *env,
-                                struct mdd_device *mdd,
-                                const struct lu_name *fname,
-                                struct thandle *handle)
+                               struct mdd_device *mdd,
+                               const struct lu_name *fname,
+                               struct thandle *handle)
 {
-        int reclen;
+       int reclen;
 
-        /* Not recording */
-        if (!(mdd->mdd_cl.mc_flags & CLM_ON))
-                return 0;
+       /* Not recording */
+       if (!(mdd->mdd_cl.mc_flags & CLM_ON))
+               return 0;
+
+       /* we'll be writing payload + llog header */
+       reclen = sizeof(struct llog_changelog_rec);
+       if (fname)
+               reclen += fname->ln_namelen;
+       reclen = llog_data_len(reclen);
+
+       return mdd_declare_llog_record(env, mdd, reclen, handle);
+}
 
-        /* we'll be writing payload + llog header */
-        reclen = sizeof(struct llog_changelog_rec);
-        if (fname)
-                reclen += llog_data_len(fname->ln_namelen);
+static int mdd_declare_changelog_ext_store(const struct lu_env *env,
+                                          struct mdd_device *mdd,
+                                          const struct lu_name *tname,
+                                          const struct lu_name *sname,
+                                          struct thandle *handle)
+{
+       int reclen;
+
+       /* Not recording */
+       if (!(mdd->mdd_cl.mc_flags & CLM_ON))
+               return 0;
+
+       /* we'll be writing payload + llog header */
+       reclen = sizeof(struct llog_changelog_ext_rec);
+       if (tname)
+               reclen += tname->ln_namelen;
+       if (sname)
+               reclen += 1 + sname->ln_namelen;
+       reclen = llog_data_len(reclen);
 
-        return mdd_declare_llog_record(env, mdd, reclen, handle);
+       return mdd_declare_llog_record(env, mdd, reclen, handle);
 }
 
 /** Store a namespace change changelog record
@@ -635,63 +659,141 @@ int mdd_declare_changelog_store(const struct lu_env *env,
  * want the change to commit without the log entry.
  * \param target - mdd_object of change
  * \param parent - parent dir/object
- * \param tf - target lu_fid, overrides fid of \a target if this is non-null
  * \param tname - target name string
  * \param handle - transacion handle
  */
 static int mdd_changelog_ns_store(const struct lu_env  *env,
-                                  struct mdd_device    *mdd,
-                                  enum changelog_rec_type type,
-                                  int flags,
-                                  struct mdd_object    *target,
-                                  struct mdd_object    *parent,
-                                  const struct lu_fid  *tf,
-                                  const struct lu_name *tname,
-                                  struct thandle *handle)
+                                 struct mdd_device    *mdd,
+                                 enum changelog_rec_type type,
+                                 unsigned flags,
+                                 struct mdd_object    *target,
+                                 struct mdd_object    *parent,
+                                 const struct lu_name *tname,
+                                 struct thandle *handle)
 {
-        const struct lu_fid *tfid;
-        const struct lu_fid *tpfid = mdo2fid(parent);
-        struct llog_changelog_rec *rec;
-        struct lu_buf *buf;
-        int reclen;
-        int rc;
-        ENTRY;
-
-        /* Not recording */
-        if (!(mdd->mdd_cl.mc_flags & CLM_ON))
-                RETURN(0);
-        if ((mdd->mdd_cl.mc_mask & (1 << type)) == 0)
-                RETURN(0);
+       struct llog_changelog_rec *rec;
+       struct lu_buf *buf;
+       int reclen;
+       int rc;
+       ENTRY;
+
+       /* Not recording */
+       if (!(mdd->mdd_cl.mc_flags & CLM_ON))
+               RETURN(0);
+       if ((mdd->mdd_cl.mc_mask & (1 << type)) == 0)
+               RETURN(0);
+
+       LASSERT(target != NULL);
+       LASSERT(parent != NULL);
+       LASSERT(tname != NULL);
+       LASSERT(handle != NULL);
+
+       reclen = llog_data_len(sizeof(*rec) + tname->ln_namelen);
+       buf = mdd_buf_alloc(env, reclen);
+       if (buf->lb_buf == NULL)
+               RETURN(-ENOMEM);
+       rec = (struct llog_changelog_rec *)buf->lb_buf;
+
+       rec->cr.cr_flags = CLF_VERSION | (CLF_FLAGMASK & flags);
+       rec->cr.cr_type = (__u32)type;
+       rec->cr.cr_tfid = *mdo2fid(target);
+       rec->cr.cr_pfid = *mdo2fid(parent);
+       rec->cr.cr_namelen = tname->ln_namelen;
+       memcpy(rec->cr.cr_name, tname->ln_name, tname->ln_namelen);
+
+       target->mod_cltime = cfs_time_current_64();
+
+       rc = mdd_changelog_llog_write(mdd, rec, handle);
+       if (rc < 0) {
+               CERROR("changelog failed: rc=%d, op%d %s c"DFID" p"DFID"\n",
+                       rc, type, tname->ln_name, PFID(&rec->cr.cr_tfid),
+                       PFID(&rec->cr.cr_pfid));
+               RETURN(-EFAULT);
+       }
+
+       RETURN(0);
+}
 
-        LASSERT(parent != NULL);
-        LASSERT(tname != NULL);
-        LASSERT(handle != NULL);
 
-        /* target */
-        reclen = llog_data_len(sizeof(*rec) + tname->ln_namelen);
-        buf = mdd_buf_alloc(env, reclen);
-        if (buf->lb_buf == NULL)
-                RETURN(-ENOMEM);
-        rec = (struct llog_changelog_rec *)buf->lb_buf;
-
-        rec->cr.cr_flags = CLF_VERSION | (CLF_FLAGMASK & flags);
-        rec->cr.cr_type = (__u32)type;
-        tfid = tf ? tf : mdo2fid(target);
-        rec->cr.cr_tfid = *tfid;
-        rec->cr.cr_pfid = *tpfid;
-        rec->cr.cr_namelen = tname->ln_namelen;
-        memcpy(rec->cr.cr_name, tname->ln_name, rec->cr.cr_namelen);
-        if (likely(target))
-                target->mod_cltime = cfs_time_current_64();
-
-        rc = mdd_changelog_llog_write(mdd, rec, handle);
-        if (rc < 0) {
-                CERROR("changelog failed: rc=%d, op%d %s c"DFID" p"DFID"\n",
-                       rc, type, tname->ln_name, PFID(tfid), PFID(tpfid));
-                return -EFAULT;
-        }
-
-        return 0;
+/** Store a namespace change changelog record
+ * If this fails, we must fail the whole transaction; we don't
+ * want the change to commit without the log entry.
+ * \param target - mdd_object of change
+ * \param tpfid - target parent dir/object fid
+ * \param sfid - source object fid
+ * \param spfid - source parent fid
+ * \param tname - target name string
+ * \param sname - source name string
+ * \param handle - transacion handle
+ */
+static int mdd_changelog_ext_ns_store(const struct lu_env  *env,
+                                     struct mdd_device    *mdd,
+                                     enum changelog_rec_type type,
+                                     unsigned flags,
+                                     struct mdd_object    *target,
+                                     const struct lu_fid  *tpfid,
+                                     const struct lu_fid  *sfid,
+                                     const struct lu_fid  *spfid,
+                                     const struct lu_name *tname,
+                                     const struct lu_name *sname,
+                                     struct thandle *handle)
+{
+       struct llog_changelog_ext_rec *rec;
+       struct lu_buf *buf;
+       int reclen;
+       int rc;
+       ENTRY;
+
+       /* Not recording */
+       if (!(mdd->mdd_cl.mc_flags & CLM_ON))
+               RETURN(0);
+       if ((mdd->mdd_cl.mc_mask & (1 << type)) == 0)
+               RETURN(0);
+
+       LASSERT(sfid != NULL);
+       LASSERT(tpfid != NULL);
+       LASSERT(tname != NULL);
+       LASSERT(handle != NULL);
+
+       reclen = sizeof(*rec) + tname->ln_namelen;
+       if (sname != NULL)
+               reclen += 1 + sname->ln_namelen;
+       reclen = llog_data_len(reclen);
+       buf = mdd_buf_alloc(env, reclen);
+       if (buf->lb_buf == NULL)
+               RETURN(-ENOMEM);
+       rec = (struct llog_changelog_ext_rec *)buf->lb_buf;
+
+       rec->cr.cr_flags = CLF_EXT_VERSION | (CLF_FLAGMASK & flags);
+       rec->cr.cr_type = (__u32)type;
+       rec->cr.cr_pfid = *tpfid;
+       rec->cr.cr_sfid = *sfid;
+       rec->cr.cr_spfid = *spfid;
+       rec->cr.cr_namelen = tname->ln_namelen;
+       memcpy(rec->cr.cr_name, tname->ln_name, tname->ln_namelen);
+       if (sname) {
+               LASSERT(sfid != NULL);
+               rec->cr.cr_name[tname->ln_namelen] = '\0';
+               memcpy(rec->cr.cr_name + tname->ln_namelen + 1, sname->ln_name,
+                       sname->ln_namelen);
+               rec->cr.cr_namelen += 1 + sname->ln_namelen;
+       }
+
+       if (likely(target != NULL)) {
+               rec->cr.cr_tfid = *mdo2fid(target);
+               target->mod_cltime = cfs_time_current_64();
+       } else {
+               fid_zero(&rec->cr.cr_tfid);
+       }
+
+       rc = mdd_changelog_ext_llog_write(mdd, rec, handle);
+       if (rc < 0) {
+               CERROR("changelog failed: rc=%d, op%d %s c"DFID" p"DFID"\n",
+                       rc, type, tname->ln_name, PFID(sfid), PFID(tpfid));
+               return -EFAULT;
+       }
+
+       return 0;
 }
 
 static int mdd_declare_link(const struct lu_env *env,
@@ -817,8 +919,8 @@ out_unlock:
         mdd_pdo_write_unlock(env, mdd_tobj, dlh);
 out_trans:
         if (rc == 0)
-                rc = mdd_changelog_ns_store(env, mdd, CL_HARDLINK, 0, mdd_sobj,
-                                            mdd_tobj, NULL, lname, handle);
+               rc = mdd_changelog_ns_store(env, mdd, CL_HARDLINK, 0, mdd_sobj,
+                                           mdd_tobj, lname, handle);
 stop:
         mdd_trans_stop(env, mdd, rc, handle);
 out_pending:
@@ -1066,9 +1168,9 @@ out_trans:
                     (ma->ma_hsm.mh_flags & HS_EXISTS))
                         cl_flags |= CLF_UNLINK_HSM_EXISTS;
 
-                rc = mdd_changelog_ns_store(env, mdd,
-                         is_dir ? CL_RMDIR : CL_UNLINK, cl_flags,
-                         mdd_cobj, mdd_pobj, NULL, lname, handle);
+               rc = mdd_changelog_ns_store(env, mdd,
+                       is_dir ? CL_RMDIR : CL_UNLINK, cl_flags,
+                       mdd_cobj, mdd_pobj, lname, handle);
         }
 
 stop:
@@ -1370,6 +1472,7 @@ static int mdd_rename_tgt(const struct lu_env *env,
         int quota_copc = 0, quota_popc = 0;
         int rec_pending[MAXQUOTAS] = { 0, 0 };
 #endif
+       int cl_flags = 0;
         int rc;
         ENTRY;
 
@@ -1452,13 +1555,15 @@ static int mdd_rename_tgt(const struct lu_env *env,
                 if (rc)
                         GOTO(cleanup, rc);
 
+               if (ma->ma_valid & MA_INODE && ma->ma_attr.la_nlink == 0) {
+                       cl_flags |= CLF_RENAME_LAST;
 #ifdef HAVE_QUOTA_SUPPORT
-                if (mds->mds_quota && ma->ma_valid & MA_INODE &&
-                    ma->ma_attr.la_nlink == 0 && mdd_tobj->mod_count == 0) {
-                        quota_copc = FSFILT_OP_UNLINK_PARTIAL_CHILD;
-                        mdd_quota_wrapper(&ma->ma_attr, qcids);
-                }
+                       if (mds->mds_quota && mdd_tobj->mod_count == 0) {
+                               quota_copc = FSFILT_OP_UNLINK_PARTIAL_CHILD;
+                               mdd_quota_wrapper(&ma->ma_attr, qcids);
+                       }
 #endif
+               }
         }
         EXIT;
 cleanup:
@@ -1467,10 +1572,10 @@ cleanup:
         mdd_pdo_write_unlock(env, mdd_tpobj, dlh);
 out_trans:
         if (rc == 0)
-                /* Bare EXT record with no RENAME in front of it signifies
-                   a partial slave op */
-                rc = mdd_changelog_ns_store(env, mdd, CL_EXT, 0, mdd_tobj,
-                                            mdd_tpobj, NULL, lname, handle);
+               /* Bare EXT record with no RENAME in front of it signifies
+                  a partial slave op */
+               rc = mdd_changelog_ns_store(env, mdd, CL_EXT, cl_flags,
+                                           mdd_tobj, mdd_tpobj, lname, handle);
 
         mdd_trans_stop(env, mdd, rc, handle);
 out_pending:
@@ -2155,11 +2260,11 @@ cleanup:
         mdd_pdo_write_unlock(env, mdd_pobj, dlh);
 out_trans:
         if (rc == 0)
-                rc = mdd_changelog_ns_store(env, mdd,
-                            S_ISDIR(attr->la_mode) ? CL_MKDIR :
-                            S_ISREG(attr->la_mode) ? CL_CREATE :
-                            S_ISLNK(attr->la_mode) ? CL_SOFTLINK : CL_MKNOD,
-                            0, son, mdd_pobj, NULL, lname, handle);
+               rc = mdd_changelog_ns_store(env, mdd,
+                       S_ISDIR(attr->la_mode) ? CL_MKDIR :
+                       S_ISREG(attr->la_mode) ? CL_CREATE :
+                       S_ISLNK(attr->la_mode) ? CL_SOFTLINK : CL_MKNOD,
+                       0, son, mdd_pobj, lname, handle);
 out_stop:
         mdd_trans_stop(env, mdd, rc, handle);
 out_free:
@@ -2276,8 +2381,8 @@ static int mdd_declare_rename(const struct lu_env *env,
                               struct mdd_object *mdd_tpobj,
                               struct mdd_object *mdd_sobj,
                               struct mdd_object *mdd_tobj,
-                              const struct lu_name *sname,
                               const struct lu_name *tname,
+                             const struct lu_name *sname,
                               struct md_attr *ma,
                               struct thandle *handle)
 {
@@ -2377,11 +2482,7 @@ static int mdd_declare_rename(const struct lu_env *env,
                         return rc;
         }
 
-        rc = mdd_declare_changelog_store(env, mdd, tname, handle);
-        if (rc)
-                return rc;
-
-        rc = mdd_declare_changelog_store(env, mdd, sname, handle);
+       rc = mdd_declare_changelog_ext_store(env, mdd, tname, sname, handle);
         if (rc)
                 return rc;
 
@@ -2408,6 +2509,7 @@ static int mdd_rename(const struct lu_env *env,
         const struct lu_fid *tpobj_fid = mdo2fid(mdd_tpobj);
         const struct lu_fid *spobj_fid = mdo2fid(mdd_spobj);
         int is_dir;
+       unsigned cl_flags = 0;
         int rc, rc2;
 
 #ifdef HAVE_QUOTA_SUPPORT
@@ -2581,13 +2683,15 @@ static int mdd_rename(const struct lu_env *env,
                 if (rc)
                         GOTO(fixup_tpobj, rc);
 
+               if (ma->ma_valid & MA_INODE && ma->ma_attr.la_nlink == 0) {
+                       cl_flags |= CLF_RENAME_LAST;
 #ifdef HAVE_QUOTA_SUPPORT
-                if (mds->mds_quota && ma->ma_valid & MA_INODE &&
-                    ma->ma_attr.la_nlink == 0 && mdd_tobj->mod_count == 0) {
-                        quota_copc = FSFILT_OP_UNLINK_PARTIAL_CHILD;
-                        mdd_quota_wrapper(&ma->ma_attr, qtcids);
-                }
+                       if (mds->mds_quota && mdd_tobj->mod_count == 0) {
+                               quota_copc = FSFILT_OP_UNLINK_PARTIAL_CHILD;
+                               mdd_quota_wrapper(&ma->ma_attr, qtcids);
+                       }
 #endif
+               }
         }
 
         la->la_valid = LA_CTIME | LA_MTIME;
@@ -2665,18 +2769,10 @@ cleanup:
                 mdd_pdo_write_unlock(env, mdd_spobj, sdlh);
 cleanup_unlocked:
         if (rc == 0)
-                rc = mdd_changelog_ns_store(env, mdd, CL_RENAME, 0, mdd_tobj,
-                                            mdd_spobj, lf, lsname, handle);
-        if (rc == 0) {
-                struct lu_fid zero_fid;
-                fid_zero(&zero_fid);
-                /* If the rename target exist, The CL_EXT record should save
-                 * the target fid as tfid, otherwise, use zero fid. LU-543 */
-                rc = mdd_changelog_ns_store(env, mdd, CL_EXT, 0, mdd_tobj,
-                                            mdd_tpobj,
-                                            mdd_tobj ? NULL : &zero_fid,
-                                            ltname, handle);
-        }
+               rc = mdd_changelog_ext_ns_store(env, mdd, CL_RENAME, cl_flags,
+                                               mdd_tobj, tpobj_fid, lf,
+                                               spobj_fid, ltname, lsname,
+                                               handle);
 
 stop:
         mdd_trans_stop(env, mdd, rc, handle);
index 28e8758..79f6de2 100644 (file)
@@ -478,6 +478,9 @@ struct llog_changelog_rec;
 int mdd_changelog_llog_write(struct mdd_device         *mdd,
                              struct llog_changelog_rec *rec,
                              struct thandle            *handle);
+int mdd_changelog_ext_llog_write(struct mdd_device *mdd,
+                                struct llog_changelog_ext_rec *rec,
+                                struct thandle *handle);
 int mdd_changelog_llog_cancel(struct mdd_device *mdd, long long endrec);
 int mdd_changelog_write_header(struct mdd_device *mdd, int markerflags);
 int mdd_changelog_on(struct mdd_device *mdd, int on);
index d504165..e8a7296 100644 (file)
@@ -163,6 +163,13 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
                 __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);
+               }
                 break;
         }
 
index fc34871..a267b5c 100644 (file)
@@ -57,8 +57,8 @@ void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux centos5 2.6.18-238.9.1.el5-head #2 SMP Wed Jun 29 18:35:58 CEST 2011 x86_
-         * with gcc version 4.1.2 20080704 (Red Hat 4.1.2-46) */
+         * running on Linux chopin 2.6.32.wc #9 SMP Thu Feb 9 14:43:41 CST 2012 x86_64 x86_64 x86_64 
+         * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)  */
 
 
         /* Constants... */
@@ -375,12 +375,6 @@ void lustre_assert_wire_constants(void)
                  (long long)SEC_CTX_FINI);
         LASSERTF(SEC_LAST_OPC == 804, "found %lld\n",
                  (long long)SEC_LAST_OPC);
-        LASSERTF(LDF_EMPTY == 1, " found %lld\n",
-                 (long long)LDF_EMPTY);
-        LASSERTF(LDF_COLLIDE == 2, " found %lld\n",
-                 (long long)LDF_COLLIDE);
-        LASSERTF(LU_PAGE_SIZE == 4096, " found %lld\n",
-                 (long long)LU_PAGE_SIZE);
         /* Sizes and Offsets */
 
         /* Checks for struct obd_uuid */
@@ -502,7 +496,6 @@ void lustre_assert_wire_constants(void)
                  (long long)FID_SEQ_NORMAL);
         LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
                  (long long)FID_SEQ_LOV_DEFAULT);
-
         LASSERTF(FID_OID_SPECIAL_BFL == 0x00000001UL, "found 0x%.8xUL\n",
                  (unsigned)FID_OID_SPECIAL_BFL);
         LASSERTF(FID_OID_DOT_LUSTRE == 0x00000001UL, "found 0x%.8xUL\n",
@@ -639,87 +632,86 @@ void lustre_assert_wire_constants(void)
                  LUSTRE_MSG_MAGIC_V2_SWABBED);
 
         /* Checks for struct ptlrpc_body */
-       LASSERTF((int)sizeof(struct ptlrpc_body) == 184, " found %lld\n",
-                 (long long)(int)sizeof(struct ptlrpc_body));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_handle) == 0, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_handle));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_handle) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_handle));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_type) == 8, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_type));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_type) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_type));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_version) == 12, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_version));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_version) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_version));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_opc) == 16, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_opc));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_opc) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_opc));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_status) == 20, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_status));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_status) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_status));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_last_xid) == 24, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_last_xid));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_last_xid) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_last_xid));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_last_seen) == 32, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_last_seen));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_last_seen) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_last_seen));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_last_committed) == 40, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_last_committed));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_last_committed) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_last_committed));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_transno) == 48, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_transno));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_transno) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_transno));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_flags) == 56, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_flags));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_flags) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_flags));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_op_flags) == 60, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_op_flags));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_op_flags) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_op_flags));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_conn_cnt) == 64, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_conn_cnt));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_conn_cnt) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_conn_cnt));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_timeout) == 68, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_timeout));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_timeout) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_timeout));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_service_time) == 72, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_service_time));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_service_time) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_service_time));
-       LASSERTF((int)offsetof(struct ptlrpc_body, pb_limit) == 76, " found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_limit));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_limit) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_limit));
-       LASSERTF((int)offsetof(struct ptlrpc_body, pb_slv) == 80, " found %lld\n",
-                (long long)(int)offsetof(struct ptlrpc_body, pb_slv));
-       LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_slv) == 8, " found %lld\n",
-                (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_slv));
+        LASSERTF((int)sizeof(struct ptlrpc_body_v3) == 184, "found %lld\n",
+                 (long long)(int)sizeof(struct ptlrpc_body_v3));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_handle) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_handle));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_type) == 8, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_type));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_version) == 12, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_version));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_opc) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_opc));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_status) == 20, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_status));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_xid) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_xid));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_seen) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_seen));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == 40, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_committed));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_transno) == 48, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_transno));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_flags) == 56, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_flags));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_op_flags) == 60, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_op_flags));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt) == 64, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_timeout) == 68, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_timeout));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_service_time) == 72, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_service_time));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_limit) == 76, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_limit));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_slv) == 80, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_slv));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv));
         CLASSERT(PTLRPC_NUM_VERSIONS == 4);
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_pre_versions[4]) == 120, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_pre_versions[4]));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_padding[4]) == 152, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_padding[4]));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_padding[4]) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_padding[4]));
-       CLASSERT(JOBSTATS_JOBID_SIZE == 32);
-       LASSERTF((int)offsetof(struct ptlrpc_body, pb_jobid) == 152, " found %lld\n",
-                (long long)(int)offsetof(struct ptlrpc_body, pb_jobid));
-       LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_jobid) == 32, " found %lld\n",
-                (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_jobid));
-
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_pre_versions[4]) == 120, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_pre_versions[4]));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions[4]) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions[4]));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding[4]) == 152, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding[4]));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding[4]) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding[4]));
+        CLASSERT(JOBSTATS_JOBID_SIZE == 32);
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_jobid) == 152, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_jobid));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_jobid) == 32, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_jobid));
         LASSERTF(MSG_PTLRPC_BODY_OFF == 0, "found %lld\n",
                  (long long)MSG_PTLRPC_BODY_OFF);
         LASSERTF(REQ_REC_OFF == 1, "found %lld\n",
@@ -824,23 +816,23 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_ibits_known));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_blocksize));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_inodespace));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_grant_extent));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_unused));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_unused));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_transno));
@@ -924,7 +916,6 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, paddingF));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingF) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingF));
-
         LASSERTF(OBD_CONNECT_RDONLY == 0x1ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_RDONLY);
         LASSERTF(OBD_CONNECT_INDEX == 0x2ULL, "found 0x%.16llxULL\n",
@@ -1007,7 +998,7 @@ void lustre_assert_wire_constants(void)
                  OBD_CONNECT_MAXBYTES);
         LASSERTF(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_IMP_RECOV);
-        LASSERTF(OBD_CONNECT_JOBSTATS ==  0x20000000000ULL, "found 0x%.16llxULL\n",
+        LASSERTF(OBD_CONNECT_JOBSTATS == 0x20000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_JOBSTATS);
         LASSERTF(OBD_CONNECT_UMASK == 0x40000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_UMASK);
@@ -1125,9 +1116,9 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obdo, o_gid_h));
         LASSERTF((int)sizeof(((struct obdo *)0)->o_gid_h) == 4, "found %lld\n",
                  (long long)(int)sizeof(((struct obdo *)0)->o_gid_h));
-        LASSERTF((int)offsetof(struct obdo, o_data_version) == 176, " found %lld\n",
+        LASSERTF((int)offsetof(struct obdo, o_data_version) == 176, "found %lld\n",
                  (long long)(int)offsetof(struct obdo, o_data_version));
-        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obdo *)0)->o_data_version));
         LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",
                  (long long)(int)offsetof(struct obdo, o_padding_4));
@@ -1304,11 +1295,11 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size));
         LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_count));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count));
         LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_layout_gen) == 30, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v1, lmm_layout_gen));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen));
         LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_objects[0]) == 32, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v1, lmm_objects[0]));
@@ -1341,11 +1332,11 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_size));
         LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_stripe_count) == 28, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v3, lmm_stripe_count));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count));
         LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_layout_gen) == 30, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v3, lmm_layout_gen));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen));
         CLASSERT(LOV_MAXPOOLNAME == 16);
         LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_pool_name[16]) == 48, "found %lld\n",
@@ -3238,6 +3229,50 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_pfid) == 16, "found %lld\n",
                  (long long)(int)sizeof(((struct changelog_rec *)0)->cr_pfid));
 
+        /* Checks for struct changelog_ext_rec */
+        LASSERTF((int)sizeof(struct changelog_ext_rec) == 96, "found %lld\n",
+                 (long long)(int)sizeof(struct changelog_ext_rec));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_namelen) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_namelen));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_namelen) == 2, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_namelen));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_flags) == 2, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_flags));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_flags) == 2, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_flags));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_type) == 4, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_type));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_type) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_type));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_index) == 8, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_index));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_index) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_index));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_prev) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_prev));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_prev) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_prev));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_time) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_time));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_time) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_time));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_tfid) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_tfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_tfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_tfid));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_pfid) == 48, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_pfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_pfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_pfid));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_sfid) == 64, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_sfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_sfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_sfid));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_spfid) == 80, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_spfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_spfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_spfid));
+
         /* Checks for struct changelog_setinfo */
         LASSERTF((int)sizeof(struct changelog_setinfo) == 12, "found %lld\n",
                  (long long)(int)sizeof(struct changelog_setinfo));
@@ -3778,39 +3813,29 @@ void lustre_assert_wire_constants(void)
         /* Checks for type posix_acl_xattr_entry */
         LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
                  (long long)(int)sizeof(posix_acl_xattr_entry));
-        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
-        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
-        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
-        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
-        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
-        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
 
         /* Checks for type posix_acl_xattr_header */
         LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
                  (long long)(int)sizeof(posix_acl_xattr_header));
-        LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_header, a_version));
-        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
-        LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
-        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
 #endif
 
index e709a7a..738b446 100644 (file)
@@ -2542,7 +2542,7 @@ static int lfs_ls(int argc, char **argv)
 static int lfs_changelog(int argc, char **argv)
 {
         void *changelog_priv;
-        struct changelog_rec *rec;
+       struct changelog_ext_rec *rec;
         long long startrec = 0, endrec = 0;
         char *mdd;
         struct option long_opts[] = {
@@ -2610,10 +2610,14 @@ static int lfs_changelog(int argc, char **argv)
                        rec->cr_flags & CLF_FLAGMASK, PFID(&rec->cr_tfid));
                 if (rec->cr_namelen)
                         /* namespace rec includes parent and filename */
-                        printf(" p="DFID" %.*s\n", PFID(&rec->cr_pfid),
-                               rec->cr_namelen, rec->cr_name);
-                else
-                        printf("\n");
+                       printf(" p="DFID" %.*s", PFID(&rec->cr_pfid),
+                               rec->cr_namelen, rec->cr_name);
+               if (fid_is_sane(&rec->cr_sfid))
+                       printf(" s="DFID" sp="DFID" %.*s",
+                               PFID(&rec->cr_sfid), PFID(&rec->cr_spfid),
+                               changelog_rec_snamelen(rec),
+                               changelog_rec_sname(rec));
+               printf("\n");
 
                 llapi_changelog_free(&rec);
         }
index b8f81ce..ffe0e80 100644 (file)
@@ -3569,6 +3569,24 @@ int llapi_changelog_fini(void **priv)
         return 0;
 }
 
+/** Convert a changelog_rec to changelog_ext_rec, in this way client can treat
+ *  all records in the format of changelog_ext_rec, this can make record
+ *  analysis simpler.
+ */
+static inline int changelog_extend_rec(struct changelog_ext_rec *ext)
+{
+       if (!CHANGELOG_REC_EXTENDED(ext)) {
+               struct changelog_rec *rec = (struct changelog_rec *)ext;
+
+               memmove(ext->cr_name, rec->cr_name, rec->cr_namelen);
+               fid_zero(&ext->cr_sfid);
+               fid_zero(&ext->cr_spfid);
+               return 1;
+       }
+
+       return 0;
+}
+
 /** Read the next changelog entry
  * @param priv Opaque private control structure
  * @param rech Changelog record handle; record will be allocated here
@@ -3576,7 +3594,7 @@ int llapi_changelog_fini(void **priv)
  *         <0 error code
  *         1 EOF
  */
-int llapi_changelog_recv(void *priv, struct changelog_rec **rech)
+int llapi_changelog_recv(void *priv, struct changelog_ext_rec **rech)
 {
         struct changelog_private *cp = (struct changelog_private *)priv;
         struct kuc_hdr *kuch;
@@ -3617,10 +3635,11 @@ repeat:
                 }
         }
 
-        /* Our message is a changelog_rec.  Use pointer math to skip
-         * kuch_hdr and point directly to the message payload.
-         */
-        *rech = (struct changelog_rec *)(kuch + 1);
+       /* Our message is a changelog_ext_rec.  Use pointer math to skip
+        * kuch_hdr and point directly to the message payload.
+        */
+       *rech = (struct changelog_ext_rec *)(kuch + 1);
+       changelog_extend_rec(*rech);
 
         return 0;
 
@@ -3631,7 +3650,7 @@ out_free:
 }
 
 /** Release the changelog record when done with it. */
-int llapi_changelog_free(struct changelog_rec **rech)
+int llapi_changelog_free(struct changelog_ext_rec **rech)
 {
         if (*rech) {
                 /* We allocated memory starting at the kuc_hdr, but passed
@@ -3917,8 +3936,8 @@ out_free:
 /** Release the action list when done with it. */
 int llapi_copytool_free(struct hsm_action_list **hal)
 {
-        /* Reuse the llapi_changelog_free function */
-        return llapi_changelog_free((struct changelog_rec **)hal);
+       /* Reuse the llapi_changelog_free function */
+       return llapi_changelog_free((struct changelog_ext_rec **)hal);
 }
 
 int llapi_get_connect_flags(const char *mnt, __u64 *flags)
index 17d458d..43fa7b4 100644 (file)
  *  tfid - The FID of the target file
  *  pfid - The FID of the parent of the target file (at the time of
  *         the operation)
- *  name - The name of the target file (at the time of the operation)
+ *  sfid - The FID of the source file
+ *  spfid - The FID of the parent of the source file
+ *  name - The name of the target file (at the time of the operation), the name
+ *         of the source file is appended (delimited with '\0') if this
+ *         operation involves a source
  *
  * With just this information, it is not alwasy possible to determine
  * the file paths for each operation. For instance, if pfid does not
@@ -70,7 +74,7 @@
  * changelog are replayed, all the files in this special directory
  * will get moved to the location as in the source-fs.
  *
- * Shorthand used: f2p(tfid) = fid2path(tfid)
+ * Shorthand used: f2p(fid) = fid2path(fid)
  *
  * The following are the metadata operations of interest.
  * 1. creat
  *      rm .lustrerepl/[tfid]
  *    Else if pfid is present on the source-fs,
  *      if f2p(pfid)+name is present,
- *        rm f2p(pfid)+name(pfid,name)
+ *        rm f2p(pfid)+name
  *
- * 3. move (pfid1,name1) to (pfid2,name2)
- *    If pfid2 is present
- *      if pfid1 is also present, mv (pfid1,name1) to (pfid2,name2)
- *      else mv .lustrerepl/[tfid] to (pfid2,name2)
- *    If pfid2 is not present,
- *      if pfid1 is present, mv (pfid1,name1) .lustrerepl/[tfid]
+ * 3. move (spfid,sname) to (pfid,name)
+ *    If pfid is present
+ *      if spfid is also present, mv (spfid,sname) to (pfid,name)
+ *      else mv .lustrerepl/[sfid] to (pfid,name)
+ *    Else if pfid is not present,
+ *      if spfid is present, mv (spfid,sname) .lustrerepl/[sfid]
  *    If moving out of .lustrerepl
  *      move out all its children in .lustrerepl.
  *      [pfid,tfid,name] tracked from (1) is used for this.
@@ -146,10 +150,14 @@ extern int obd_initialize(int argc, char **argv);
 struct lr_info {
         long long recno;
         int target_no;
+       unsigned int is_extended:1;
         enum changelog_rec_type type;
-        char pfid[LR_FID_STR_LEN];
-        char tfid[LR_FID_STR_LEN];
-        char name[PATH_MAX + 1];
+       char tfid[LR_FID_STR_LEN];
+       char pfid[LR_FID_STR_LEN];
+       char sfid[LR_FID_STR_LEN];
+       char spfid[LR_FID_STR_LEN];
+       char sname[NAME_MAX + 1];
+       char name[NAME_MAX + 1];
         char src[PATH_MAX + 1];
         char dest[PATH_MAX + 1];
         char path[PATH_MAX + 1];
@@ -656,7 +664,7 @@ void lr_cascade_move(const char *fid, const char *dest, struct lr_info *info)
         free(d);
 }
 
-/* remove [info->pfid, ext->tfid] from parents */
+/* remove [info->spfid, info->sfid] from parents */
 int lr_remove_pc(const char *pfid, const char *tfid)
 {
         struct lr_parent_child_list *curr, *prev;
@@ -767,7 +775,9 @@ int lr_create(struct lr_info *info)
 
         /* Is f2p(pfid)+name != f2p(tfid)? If not the file has moved. */
         len = strlen(info->path);
-        if (len - 1 >= 0 && info->path[len - 1] == '/')
+       if (len == 1 && info->path[0] == '/')
+               snprintf(info->dest, PATH_MAX, "%s", info->name);
+       else if (len - 1 > 0 && info->path[len - 1] == '/')
                 snprintf(info->dest, PATH_MAX, "%s%s", info->path, info->name);
         else
                 snprintf(info->dest, PATH_MAX, "%s/%s", info->path, info->name);
@@ -783,10 +793,13 @@ int lr_create(struct lr_info *info)
         /* Is f2p(pfid) present on the target? If not, the parent has
            moved */
         if (!mkspecial) {
-                snprintf(info->dest, PATH_MAX, "%s/%s", status->ls_targets[0],
-                        info->path);
-                if (access(info->dest, F_OK) != 0)
-                        mkspecial = 1;
+               snprintf(info->dest, PATH_MAX, "%s/%s", status->ls_targets[0],
+                       info->path);
+               if (access(info->dest, F_OK) != 0) {
+                       lr_debug(DTRACE, "create: parent %s not found\n",
+                               info->dest);
+                       mkspecial = 1;
+               }
         }
         for (info->target_no = 0; info->target_no < status->ls_num_targets;
              info->target_no++) {
@@ -847,23 +860,26 @@ int lr_remove(struct lr_info *info)
         return rc;
 }
 
-/* Replicate a rename/move operation. This operations are tracked by
-   two changelog records. */
-int lr_move(struct lr_info *info, struct lr_info *ext)
+/* Replicate a rename/move operation. */
+int lr_move(struct lr_info *info)
 {
         int rc = 0;
         int rc1;
         int rc_dest, rc_src;
         int special_src = 0;
         int special_dest = 0;
+       char srcpath[PATH_MAX + 1] = "";
 
-        rc_dest = lr_get_path(ext, ext->pfid);
-        if (rc_dest < 0 && rc_dest != -ENOENT)
-                return rc_dest;
+       LASSERT(info->is_extended);
 
-        rc_src = lr_get_path(info, info->pfid);
-        if (rc_src < 0 && rc_src != -ENOENT)
-                return rc_src;
+       rc_src = lr_get_path(info, info->spfid);
+       if (rc_src < 0 && rc_src != -ENOENT)
+               return rc_src;
+       memcpy(srcpath, info->path, strlen(info->path));
+
+       rc_dest = lr_get_path(info, info->pfid);
+       if (rc_dest < 0 && rc_dest != -ENOENT)
+               return rc_dest;
 
         for (info->target_no = 0; info->target_no < status->ls_num_targets;
              info->target_no++) {
@@ -871,31 +887,31 @@ int lr_move(struct lr_info *info, struct lr_info *ext)
                 if (!rc_dest) {
                         snprintf(info->dest, PATH_MAX, "%s/%s",
                                 status->ls_targets[info->target_no],
-                                ext->path);
+                               info->path);
                         if (access(info->dest, F_OK) != 0) {
                                 rc_dest = -errno;
                         } else {
                                 snprintf(info->dest, PATH_MAX, "%s/%s/%s",
                                         status->ls_targets[info->target_no],
-                                        ext->path, ext->name);
+                                       info->path, info->name);
                         }
                 }
                 if (rc_dest == -ENOENT) {
                         snprintf(info->dest, PATH_MAX, "%s/%s/%s",
                                 status->ls_targets[info->target_no],
-                                SPECIAL_DIR, info->tfid);
+                               SPECIAL_DIR, info->sfid);
                         special_dest = 1;
                 }
 
                 if (!rc_src)
                         snprintf(info->src, PATH_MAX, "%s/%s/%s",
                                 status->ls_targets[info->target_no],
-                                info->path, info->name);
+                               srcpath, info->sname);
                 if (rc_src == -ENOENT || (access(info->src, F_OK) != 0 &&
                                           errno == ENOENT)) {
                         snprintf(info->src, PATH_MAX, "%s/%s/%s",
                                 status->ls_targets[info->target_no],
-                                SPECIAL_DIR, info->tfid);
+                               SPECIAL_DIR, info->sfid);
                         special_src = 1;
                 }
 
@@ -906,13 +922,13 @@ int lr_move(struct lr_info *info, struct lr_info *ext)
                                 rc1 = -errno;
                 }
 
-                if (special_src) {
-                        lr_remove_pc(info->pfid, info->tfid);
-                        if (!special_dest)
-                                lr_cascade_move(info->tfid, info->dest, info);
+               if (special_src) {
+                       lr_remove_pc(info->spfid, info->sfid);
+                       if (!special_dest)
+                               lr_cascade_move(info->sfid, info->dest, info);
                 }
-                if (special_dest)
-                        lr_add_pc(ext->pfid, info->tfid, ext->name);
+               if (special_dest)
+                       lr_add_pc(info->pfid, info->sfid, info->name);
 
                 lr_debug(DINFO, "move: %s [to] %s rc1=%d, errno=%d\n",
                          info->src, info->dest, rc1, errno);
@@ -1059,20 +1075,35 @@ int lr_setxattr(struct lr_info *info)
 /* Parse a line of changelog entry */
 int lr_parse_line(void *priv, struct lr_info *info)
 {
-        struct changelog_rec *rec;
+       struct changelog_ext_rec *rec;
 
         if (llapi_changelog_recv(priv, &rec) != 0)
                 return -1;
 
+       info->is_extended = CHANGELOG_REC_EXTENDED(rec);
         info->recno = rec->cr_index;
         info->type = rec->cr_type;
         sprintf(info->tfid, DFID, PFID(&rec->cr_tfid));
         sprintf(info->pfid, DFID, PFID(&rec->cr_pfid));
         strncpy(info->name, rec->cr_name, rec->cr_namelen);
-        info->name[rec->cr_namelen] = '\0';
 
-        if (verbose > 1)
-                printf("Rec %lld: %d %s\n", info->recno, info->type,info->name);
+       if (fid_is_sane(&rec->cr_sfid)) {
+               sprintf(info->sfid, DFID, PFID(&rec->cr_sfid));
+               sprintf(info->spfid, DFID, PFID(&rec->cr_spfid));
+               strncpy(info->sname, changelog_rec_sname(rec),
+                       changelog_rec_snamelen(rec));
+               info->sname[changelog_rec_snamelen(rec)] = '\0';
+
+               if (verbose > 1)
+                       printf("Rec %lld: %d %s %s\n", info->recno, info->type,
+                               info->name, info->sname);
+       } else {
+               info->name[rec->cr_namelen] = '\0';
+
+               if (verbose > 1)
+                       printf("Rec %lld: %d %s\n", info->recno, info->type,
+                               info->name);
+       }
 
         llapi_changelog_free(&rec);
 
@@ -1380,7 +1411,6 @@ int lr_replicate()
         ext = calloc(1, sizeof(struct lr_info));
         if (ext == NULL)
                 return -ENOMEM;
-        memcpy(ext, info, sizeof(struct lr_info));
 
         for (i = 0, xattr_not_supp = 0; i < status->ls_num_targets; i++) {
                 snprintf(info->dest, PATH_MAX, "%s/%s", status->ls_targets[i],
@@ -1415,10 +1445,21 @@ int lr_replicate()
 
         while (!quit && lr_parse_line(changelog_priv, info) == 0) {
                 rc = 0;
-                if (info->type == CL_RENAME)
-                        /* Rename operations have an additional changelog
-                           record of information. */
-                        lr_parse_line(changelog_priv, ext);
+               if (info->type == CL_RENAME && !info->is_extended) {
+                       /* Newer rename operations extends changelog to store
+                        * source file information, but old changelog has
+                        * another record.
+                        */
+                       if (lr_parse_line(changelog_priv, ext) != 0)
+                               break;
+                       memcpy(info->sfid, info->tfid, sizeof(info->sfid));
+                       memcpy(info->spfid, info->pfid, sizeof(info->spfid));
+                       memcpy(info->tfid, ext->tfid, sizeof(info->tfid));
+                       memcpy(info->pfid, ext->pfid, sizeof(info->pfid));
+                       strncpy(info->sname, info->name, sizeof(info->sname));
+                       strncpy(info->name, ext->name, sizeof(info->name));
+                       info->is_extended = 1;
+               }
 
                 if (dryrun)
                         continue;
@@ -1435,7 +1476,7 @@ int lr_replicate()
                         rc = lr_remove(info);
                         break;
                 case CL_RENAME:
-                        rc = lr_move(info, ext);
+                       rc = lr_move(info);
                         break;
                 case CL_HARDLINK:
                         rc = lr_link(info);
index 4b0458e..d74aa99 100644 (file)
@@ -226,9 +226,9 @@ check_ost_id(void)
         CHECK_VALUE_64X(FID_SEQ_NORMAL);
         CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT);
 
-        CHECK_VALUE(FID_OID_SPECIAL_BFL);
-        CHECK_VALUE(FID_OID_DOT_LUSTRE);
-        CHECK_VALUE(FID_OID_DOT_LUSTRE_OBF);
+        CHECK_VALUE_X(FID_OID_SPECIAL_BFL);
+        CHECK_VALUE_X(FID_OID_DOT_LUSTRE);
+        CHECK_VALUE_X(FID_OID_DOT_LUSTRE_OBF);
 }
 
 static void
@@ -590,6 +590,7 @@ check_lov_mds_md_v1(void)
         CHECK_MEMBER(lov_mds_md_v1, lmm_object_seq);
         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
+       CHECK_MEMBER(lov_mds_md_v1, lmm_layout_gen);
         CHECK_MEMBER(lov_mds_md_v1, lmm_objects[0]);
 
         CHECK_CDEFINE(LOV_MAGIC_V1);
@@ -606,6 +607,7 @@ check_lov_mds_md_v3(void)
         CHECK_MEMBER(lov_mds_md_v3, lmm_object_seq);
         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
+       CHECK_MEMBER(lov_mds_md_v3, lmm_layout_gen);
         CHECK_CVALUE(LOV_MAXPOOLNAME);
         CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name[LOV_MAXPOOLNAME]);
         CHECK_MEMBER(lov_mds_md_v3, lmm_objects[0]);
@@ -1397,6 +1399,23 @@ check_changelog_rec(void)
 }
 
 static void
+check_changelog_rec_ext(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(changelog_ext_rec);
+       CHECK_MEMBER(changelog_ext_rec, cr_namelen);
+       CHECK_MEMBER(changelog_ext_rec, cr_flags);
+       CHECK_MEMBER(changelog_ext_rec, cr_type);
+       CHECK_MEMBER(changelog_ext_rec, cr_index);
+       CHECK_MEMBER(changelog_ext_rec, cr_prev);
+       CHECK_MEMBER(changelog_ext_rec, cr_time);
+       CHECK_MEMBER(changelog_ext_rec, cr_tfid);
+       CHECK_MEMBER(changelog_ext_rec, cr_pfid);
+       CHECK_MEMBER(changelog_ext_rec, cr_sfid);
+       CHECK_MEMBER(changelog_ext_rec, cr_spfid);
+}
+
+static void
 check_changelog_setinfo(void)
 {
         BLANK_LINE();
@@ -2064,6 +2083,7 @@ main(int argc, char **argv)
         check_llog_setattr64_rec();
         check_llog_size_change_rec();
         check_changelog_rec();
+       check_changelog_rec_ext();
         check_changelog_setinfo();
         check_llog_changelog_rec();
         check_llog_changelog_user_rec();
index b244e78..1f360db 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -62,8 +62,8 @@ void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux centos5 2.6.18-238.9.1.el5-head #2 SMP Wed Jun 29 18:35:58 CEST 2011 x86_
-         * with gcc version 4.1.2 20080704 (Red Hat 4.1.2-46) */
+         * running on Linux chopin 2.6.32.wc #9 SMP Thu Feb 9 14:43:41 CST 2012 x86_64 x86_64 x86_64 
+         * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)  */
 
 
         /* Constants... */
@@ -380,13 +380,6 @@ void lustre_assert_wire_constants(void)
                  (long long)SEC_CTX_FINI);
         LASSERTF(SEC_LAST_OPC == 804, "found %lld\n",
                  (long long)SEC_LAST_OPC);
-        LASSERTF(LDF_EMPTY == 1, " found %lld\n",
-                 (long long)LDF_EMPTY);
-        LASSERTF(LDF_COLLIDE == 2, " found %lld\n",
-                 (long long)LDF_COLLIDE);
-        LASSERTF(LU_PAGE_SIZE == 4096, " found %lld\n",
-                 (long long)LU_PAGE_SIZE);
-
         /* Sizes and Offsets */
 
         /* Checks for struct obd_uuid */
@@ -508,7 +501,6 @@ void lustre_assert_wire_constants(void)
                  (long long)FID_SEQ_NORMAL);
         LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
                  (long long)FID_SEQ_LOV_DEFAULT);
-
         LASSERTF(FID_OID_SPECIAL_BFL == 0x00000001UL, "found 0x%.8xUL\n",
                  (unsigned)FID_OID_SPECIAL_BFL);
         LASSERTF(FID_OID_DOT_LUSTRE == 0x00000001UL, "found 0x%.8xUL\n",
@@ -645,87 +637,86 @@ void lustre_assert_wire_constants(void)
                  LUSTRE_MSG_MAGIC_V2_SWABBED);
 
         /* Checks for struct ptlrpc_body */
-       LASSERTF((int)sizeof(struct ptlrpc_body) == 184, " found %lld\n",
-                 (long long)(int)sizeof(struct ptlrpc_body));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_handle) == 0, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_handle));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_handle) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_handle));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_type) == 8, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_type));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_type) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_type));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_version) == 12, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_version));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_version) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_version));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_opc) == 16, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_opc));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_opc) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_opc));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_status) == 20, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_status));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_status) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_status));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_last_xid) == 24, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_last_xid));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_last_xid) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_last_xid));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_last_seen) == 32, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_last_seen));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_last_seen) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_last_seen));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_last_committed) == 40, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_last_committed));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_last_committed) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_last_committed));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_transno) == 48, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_transno));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_transno) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_transno));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_flags) == 56, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_flags));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_flags) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_flags));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_op_flags) == 60, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_op_flags));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_op_flags) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_op_flags));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_conn_cnt) == 64, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_conn_cnt));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_conn_cnt) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_conn_cnt));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_timeout) == 68, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_timeout));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_timeout) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_timeout));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_service_time) == 72, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_service_time));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_service_time) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_service_time));
-       LASSERTF((int)offsetof(struct ptlrpc_body, pb_limit) == 76, " found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_limit));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_limit) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_limit));
-       LASSERTF((int)offsetof(struct ptlrpc_body, pb_slv) == 80, " found %lld\n",
-                (long long)(int)offsetof(struct ptlrpc_body, pb_slv));
-       LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_slv) == 8, " found %lld\n",
-                (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_slv));
+        LASSERTF((int)sizeof(struct ptlrpc_body_v3) == 184, "found %lld\n",
+                 (long long)(int)sizeof(struct ptlrpc_body_v3));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_handle) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_handle));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_type) == 8, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_type));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_version) == 12, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_version));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_opc) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_opc));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_status) == 20, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_status));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_xid) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_xid));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_seen) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_seen));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == 40, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_committed));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_transno) == 48, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_transno));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_flags) == 56, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_flags));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_op_flags) == 60, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_op_flags));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt) == 64, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_timeout) == 68, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_timeout));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_service_time) == 72, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_service_time));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_limit) == 76, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_limit));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_slv) == 80, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_slv));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv));
         CLASSERT(PTLRPC_NUM_VERSIONS == 4);
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_pre_versions[4]) == 120, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_pre_versions[4]));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_padding[4]) == 152, "found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_padding[4]));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_padding[4]) == 8, "found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_padding[4]));
-       CLASSERT(JOBSTATS_JOBID_SIZE == 32);
-       LASSERTF((int)offsetof(struct ptlrpc_body, pb_jobid) == 152, " found %lld\n",
-                (long long)(int)offsetof(struct ptlrpc_body, pb_jobid));
-       LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_jobid) == 32, " found %lld\n",
-                (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_jobid));
-
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_pre_versions[4]) == 120, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_pre_versions[4]));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions[4]) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions[4]));
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding[4]) == 152, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding[4]));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding[4]) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding[4]));
+        CLASSERT(JOBSTATS_JOBID_SIZE == 32);
+        LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_jobid) == 152, "found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body_v3, pb_jobid));
+        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_jobid) == 32, "found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_jobid));
         LASSERTF(MSG_PTLRPC_BODY_OFF == 0, "found %lld\n",
                  (long long)MSG_PTLRPC_BODY_OFF);
         LASSERTF(REQ_REC_OFF == 1, "found %lld\n",
@@ -830,25 +821,23 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_ibits_known));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_blocksize));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_inodespace));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_grant_extent));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_unused));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_unused));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, "found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_transno));
@@ -932,7 +921,6 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, paddingF));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingF) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingF));
-
         LASSERTF(OBD_CONNECT_RDONLY == 0x1ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_RDONLY);
         LASSERTF(OBD_CONNECT_INDEX == 0x2ULL, "found 0x%.16llxULL\n",
@@ -1015,7 +1003,7 @@ void lustre_assert_wire_constants(void)
                  OBD_CONNECT_MAXBYTES);
         LASSERTF(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_IMP_RECOV);
-        LASSERTF(OBD_CONNECT_JOBSTATS ==  0x20000000000ULL, "found 0x%.16llxULL\n",
+        LASSERTF(OBD_CONNECT_JOBSTATS == 0x20000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_JOBSTATS);
         LASSERTF(OBD_CONNECT_UMASK == 0x40000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_UMASK);
@@ -1133,9 +1121,9 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obdo, o_gid_h));
         LASSERTF((int)sizeof(((struct obdo *)0)->o_gid_h) == 4, "found %lld\n",
                  (long long)(int)sizeof(((struct obdo *)0)->o_gid_h));
-        LASSERTF((int)offsetof(struct obdo, o_data_version) == 176, " found %lld\n",
+        LASSERTF((int)offsetof(struct obdo, o_data_version) == 176, "found %lld\n",
                  (long long)(int)offsetof(struct obdo, o_data_version));
-        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obdo *)0)->o_data_version));
         LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",
                  (long long)(int)offsetof(struct obdo, o_padding_4));
@@ -1312,11 +1300,11 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size));
         LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_count));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count));
         LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_layout_gen) == 30, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v1, lmm_layout_gen));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen));
         LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_objects[0]) == 32, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v1, lmm_objects[0]));
@@ -1349,11 +1337,11 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_size));
         LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_stripe_count) == 28, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v3, lmm_stripe_count));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count));
         LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_layout_gen) == 30, "found %lld\n",
                  (long long)(int)offsetof(struct lov_mds_md_v3, lmm_layout_gen));
-        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen) == 2, " found %lld\n",
+        LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen) == 2, "found %lld\n",
                  (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen));
         CLASSERT(LOV_MAXPOOLNAME == 16);
         LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_pool_name[16]) == 48, "found %lld\n",
@@ -3246,6 +3234,50 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_pfid) == 16, "found %lld\n",
                  (long long)(int)sizeof(((struct changelog_rec *)0)->cr_pfid));
 
+        /* Checks for struct changelog_ext_rec */
+        LASSERTF((int)sizeof(struct changelog_ext_rec) == 96, "found %lld\n",
+                 (long long)(int)sizeof(struct changelog_ext_rec));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_namelen) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_namelen));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_namelen) == 2, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_namelen));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_flags) == 2, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_flags));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_flags) == 2, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_flags));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_type) == 4, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_type));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_type) == 4, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_type));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_index) == 8, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_index));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_index) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_index));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_prev) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_prev));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_prev) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_prev));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_time) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_time));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_time) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_time));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_tfid) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_tfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_tfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_tfid));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_pfid) == 48, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_pfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_pfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_pfid));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_sfid) == 64, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_sfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_sfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_sfid));
+        LASSERTF((int)offsetof(struct changelog_ext_rec, cr_spfid) == 80, "found %lld\n",
+                 (long long)(int)offsetof(struct changelog_ext_rec, cr_spfid));
+        LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_spfid) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_spfid));
+
         /* Checks for struct changelog_setinfo */
         LASSERTF((int)sizeof(struct changelog_setinfo) == 12, "found %lld\n",
                  (long long)(int)sizeof(struct changelog_setinfo));
@@ -3786,39 +3818,29 @@ void lustre_assert_wire_constants(void)
         /* Checks for type posix_acl_xattr_entry */
         LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
                  (long long)(int)sizeof(posix_acl_xattr_entry));
-        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
-        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
-        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
-        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
-        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
-        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
 
         /* Checks for type posix_acl_xattr_header */
         LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
                  (long long)(int)sizeof(posix_acl_xattr_header));
-        LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_header, a_version));
-        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
-        LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4,
-                 "found %lld\n",
+        LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
                  (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
-        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0,
-                 "found %lld\n",
+        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
                  (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
 #endif
 
@@ -3919,3 +3941,4 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location) == 16, "found %lld\n",
                  (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location));
 }
+