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);
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 {
};
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
*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 */
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;
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);
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
}
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
* 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,
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:
(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:
int quota_copc = 0, quota_popc = 0;
int rec_pending[MAXQUOTAS] = { 0, 0 };
#endif
+ int cl_flags = 0;
int rc;
ENTRY;
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:
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:
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:
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)
{
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;
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
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;
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);
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);
__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;
}
{
/* 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... */
(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 */
(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",
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",
(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));
(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",
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);
(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));
(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]));
(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",
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));
/* 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
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[] = {
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);
}
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
* <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;
}
}
- /* 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;
}
/** 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
/** 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)
* 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
* 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.
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];
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;
/* 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);
/* 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++) {
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++) {
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;
}
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);
/* 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);
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],
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;
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);
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
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);
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]);
}
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();
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();
* 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/
{
/* 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... */
(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 */
(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",
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",
(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));
(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",
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);
(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));
(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]));
(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",
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));
/* 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
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));
}
+