Add lu_env to llog processing function.
Remove using flags and mark fork is needed by parameter.
Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: Ie38b3da4090df35281e51ef196d91e3f96f95bdc
Reviewed-on: http://review.whamcloud.com/3644
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
#define LLOG_OP_MASK 0xfff00000
typedef enum {
- LLOG_PAD_MAGIC = LLOG_OP_MAGIC | 0x00000,
- OST_SZ_REC = LLOG_OP_MAGIC | 0x00f00,
- OST_RAID1_REC = LLOG_OP_MAGIC | 0x01000,
- MDS_UNLINK_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_UNLINK,
- MDS_SETATTR_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_SETATTR,
- MDS_SETATTR64_REC = LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) | REINT_SETATTR,
- OBD_CFG_REC = LLOG_OP_MAGIC | 0x20000,
- PTL_CFG_REC = LLOG_OP_MAGIC | 0x30000, /* obsolete */
- LLOG_GEN_REC = LLOG_OP_MAGIC | 0x40000,
- LLOG_JOIN_REC = LLOG_OP_MAGIC | 0x50000, /* obsolete */
- CHANGELOG_REC = LLOG_OP_MAGIC | 0x60000,
- CHANGELOG_USER_REC = LLOG_OP_MAGIC | 0x70000,
- LLOG_HDR_MAGIC = LLOG_OP_MAGIC | 0x45539,
- LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
+ LLOG_PAD_MAGIC = LLOG_OP_MAGIC | 0x00000,
+ OST_SZ_REC = LLOG_OP_MAGIC | 0x00f00,
+ /* OST_RAID1_REC = LLOG_OP_MAGIC | 0x01000, never used */
+ MDS_UNLINK_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) |
+ REINT_UNLINK, /* obsolete after 2.5.0 */
+ MDS_UNLINK64_REC = LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) |
+ REINT_UNLINK,
+ /* MDS_SETATTR_REC = LLOG_OP_MAGIC | 0x12401, obsolete 1.8.0 */
+ MDS_SETATTR64_REC = LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) |
+ REINT_SETATTR,
+ OBD_CFG_REC = LLOG_OP_MAGIC | 0x20000,
+ /* PTL_CFG_REC = LLOG_OP_MAGIC | 0x30000, obsolete 1.4.0 */
+ LLOG_GEN_REC = LLOG_OP_MAGIC | 0x40000,
+ /* LLOG_JOIN_REC = LLOG_OP_MAGIC | 0x50000, obsolete 1.8.0 */
+ CHANGELOG_REC = LLOG_OP_MAGIC | 0x60000,
+ CHANGELOG_USER_REC = LLOG_OP_MAGIC | 0x70000,
+ LLOG_HDR_MAGIC = LLOG_OP_MAGIC | 0x45539,
+ LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
} llog_op_type;
-/*
- * for now, continue to support old pad records which have 0 for their
- * type but still need to be swabbed for their length
- */
-#define LLOG_REC_HDR_NEEDS_SWABBING(r) \
- (((r)->lrh_type & __swab32(LLOG_OP_MASK)) == \
- __swab32(LLOG_OP_MAGIC) || \
- (((r)->lrh_type == 0) && ((r)->lrh_len > LLOG_CHUNK_SIZE)))
+#define LLOG_REC_HDR_NEEDS_SWABBING(r) \
+ (((r)->lrh_type & __swab32(LLOG_OP_MASK)) == __swab32(LLOG_OP_MAGIC))
/** Log record header - stored in little endian order.
* Each record must start with this struct, end with a llog_rec_tail,
* and be a multiple of 256 bits in size.
*/
struct llog_rec_hdr {
- __u32 lrh_len;
- __u32 lrh_index;
- __u32 lrh_type;
- __u32 lrh_padding;
+ __u32 lrh_len;
+ __u32 lrh_index;
+ __u32 lrh_type;
+ __u32 lrh_id;
};
struct llog_rec_tail {
extern void lustre_swab_llogd_body (struct llogd_body *d);
extern void lustre_swab_llog_hdr (struct llog_log_hdr *h);
extern void lustre_swab_llogd_conn_body (struct llogd_conn_body *d);
-extern void lustre_swab_llog_rec(struct llog_rec_hdr *rec,
- struct llog_rec_tail *tail);
+extern void lustre_swab_llog_rec(struct llog_rec_hdr *rec);
struct lustre_cfg;
extern void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);
int llog_init_handle(struct llog_handle *handle, int flags,
struct obd_uuid *uuid);
extern void llog_free_handle(struct llog_handle *handle);
-int llog_process(struct llog_handle *loghandle, llog_cb_t cb,
- void *data, void *catdata);
-int llog_process_flags(struct llog_handle *loghandle, llog_cb_t cb,
- void *data, void *catdata, int flags);
-int llog_reverse_process(struct llog_handle *loghandle, llog_cb_t cb,
- void *data, void *catdata);
+int llog_process(const struct lu_env *env, struct llog_handle *loghandle,
+ llog_cb_t cb, void *data, void *catdata);
+int llog_reverse_process(const struct lu_env *env,
+ struct llog_handle *loghandle, llog_cb_t cb,
+ void *data, void *catdata);
extern int llog_cancel_rec(struct llog_handle *loghandle, int index);
extern int llog_close(struct llog_handle *cathandle);
extern int llog_get_size(struct llog_handle *loghandle);
*/
int lpd_startcat;
int lpd_startidx;
- int lpd_flags; /** llog_process flags */
};
struct llog_process_cat_data {
struct llog_cookie *reccookie, void *buf);
int llog_cat_cancel_records(struct llog_handle *cathandle, int count,
struct llog_cookie *cookies);
-int llog_cat_process(struct llog_handle *cat_llh, llog_cb_t cb, void *data,
- int startcat, int startidx);
-int llog_cat_process_flags(struct llog_handle *cat_llh, llog_cb_t cb, void *data,
- int flags, int startcat, int startidx);
+int __llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh,
+ llog_cb_t cb, void *data, int startcat, int startidx,
+ int fork);
+int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh,
+ llog_cb_t cb, void *data, int startcat, int startidx);
int llog_cat_process_thread(void *data);
-int llog_cat_reverse_process(struct llog_handle *cat_llh, llog_cb_t cb, void *data);
+int llog_cat_reverse_process(const struct lu_env *env,
+ struct llog_handle *cat_llh, llog_cb_t cb,
+ void *data);
int llog_cat_set_first_idx(struct llog_handle *cathandle, int index);
/* llog_obd.c */
lur->lur_oseq = loi->loi_seq;
break;
}
- case MDS_SETATTR_REC: {
- struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
- lsr->lsr_oid = loi->loi_id;
- lsr->lsr_oseq = loi->loi_seq;
- break;
- }
case MDS_SETATTR64_REC: {
struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
lsr->lsr_oid = loi->loi_id;
GOTO(out, rc);
}
- rc = llog_cat_process_flags(llh, changelog_show_cb, cs, 0, 0, 0);
+ rc = llog_cat_process(NULL, llh, changelog_show_cb, cs, 0, 0);
/* Send EOF no matter what our result */
if ((kuch = changelog_kuc_hdr(cs->cs_buf, sizeof(*kuch),
return -EINVAL;
}
- rc = llog_cat_reverse_process(ctxt->loc_handle, changelog_init_cb, mdd);
+ rc = llog_cat_reverse_process(NULL, ctxt->loc_handle,
+ changelog_init_cb, mdd);
llog_ctxt_put(ctxt);
if (rc < 0) {
return -EINVAL;
}
- rc = llog_cat_reverse_process(ctxt->loc_handle, changelog_user_init_cb,
- mdd);
+ rc = llog_cat_reverse_process(NULL, ctxt->loc_handle,
+ changelog_user_init_cb, mdd);
llog_ctxt_put(ctxt);
if (rc < 0) {
return -ENXIO;
LASSERT(ctxt->loc_handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT);
- rc = llog_cat_process(ctxt->loc_handle, mdd_changelog_user_purge_cb,
- (void *)&data, 0, 0);
+ rc = llog_cat_process(env, ctxt->loc_handle,
+ mdd_changelog_user_purge_cb, (void *)&data,
+ 0, 0);
if ((rc >= 0) && (data.mcud_minrec > 0)) {
CDEBUG(D_IOCTL, "Purging changelog entries up to "LPD64
", referenced by "CHANGELOG_USER_PREFIX"%d\n",
cucb.idx += snprintf(cucb.page + cucb.idx, cucb.count - cucb.idx,
"%-5s %s\n", "ID", "index");
- llog_cat_process(ctxt->loc_handle, lprocfs_changelog_users_cb,
- &cucb, 0, 0);
+ llog_cat_process(NULL, ctxt->loc_handle, lprocfs_changelog_users_cb,
+ &cucb, 0, 0);
llog_ctxt_put(ctxt);
return cucb.idx;
/* This should only be called with the catalog handle */
LASSERT(cathandle->lgh_hdr->llh_flags & LLOG_F_IS_CAT);
- rc = llog_cat_process(cathandle, llog_changelog_cancel_cb,
- (void *)cookies, 0, 0);
+ rc = llog_cat_process(NULL, cathandle, llog_changelog_cancel_cb,
+ (void *)cookies, 0, 0);
if (rc >= 0)
/* 0 or 1 means we're done */
rc = 0;
GOTO(out_closer, rc);
/* Copy remote log */
- rc = llog_process(remote_llh, mgc_copy_handler,(void *)local_llh, NULL);
+ rc = llog_process(NULL, remote_llh, mgc_copy_handler,
+ (void *)local_llh, NULL);
out_closer:
rc2 = llog_close(remote_llh);
if (llog_get_size(loghandle) <= 1)
cfs_set_bit(FSDB_LOG_EMPTY, &fsdb->fsdb_flags);
- rc = llog_process(loghandle, mgs_fsdb_handler, (void *) &d, NULL);
+ rc = llog_process(NULL, loghandle, mgs_fsdb_handler, (void *) &d,
+ NULL);
CDEBUG(D_INFO, "get_db = %d\n", rc);
out_close:
rc2 = llog_close(loghandle);
mml->mml_marker.cm_flags = flags;
mml->mml_marker.cm_canceltime = flags ? cfs_time_current_sec() : 0;
mml->mml_modified = 0;
- rc = llog_process(loghandle, mgs_modify_handler, (void *)mml, NULL);
+ rc = llog_process(NULL, loghandle, mgs_modify_handler, (void *)mml,
+ NULL);
if (!rc && !mml->mml_modified)
rc = -ENODEV;
OBD_FREE_PTR(mml);
if (rc)
GOTO(out_close, rc);
- rc = llog_process(loghandle, mgs_steal_llog_handler, (void *)comp, NULL);
+ rc = llog_process(NULL, loghandle, mgs_steal_llog_handler,
+ (void *)comp, NULL);
CDEBUG(D_MGS, "steal llog re = %d\n", rc);
out_close:
rc2 = llog_close(loghandle);
msrd.msrd_fsdb = fsdb;
msrd.msrd_skip = 0;
- rc = llog_process(llh, mgs_srpc_read_handler, (void *) &msrd, NULL);
+ rc = llog_process(NULL, llh, mgs_srpc_read_handler, (void *) &msrd,
+ NULL);
out_close:
llog_close(llh);
static int llog_process_thread(void *arg)
{
- struct llog_process_info *lpi = (struct llog_process_info *)arg;
- struct llog_handle *loghandle = lpi->lpi_loghandle;
- struct llog_log_hdr *llh = loghandle->lgh_hdr;
- struct llog_process_cat_data *cd = lpi->lpi_catdata;
- char *buf;
- __u64 cur_offset = LLOG_CHUNK_SIZE;
- __u64 last_offset;
- int rc = 0, index = 1, last_index;
- int saved_index = 0, last_called_index = 0;
+ struct llog_process_info *lpi = arg;
+ struct llog_handle *loghandle = lpi->lpi_loghandle;
+ struct llog_log_hdr *llh = loghandle->lgh_hdr;
+ struct llog_process_cat_data *cd = lpi->lpi_catdata;
+ char *buf;
+ __u64 cur_offset = LLOG_CHUNK_SIZE;
+ __u64 last_offset;
+ int rc = 0, index = 1, last_index;
+ int saved_index = 0;
+ int last_called_index = 0;
+
+ ENTRY;
LASSERT(llh);
OBD_ALLOC(buf, LLOG_CHUNK_SIZE);
if (!buf) {
lpi->lpi_rc = -ENOMEM;
-#ifdef __KERNEL__
- cfs_complete(&lpi->lpi_completion);
-#endif
- return 0;
+ RETURN(0);
}
- if (!(lpi->lpi_flags & LLOG_FLAG_NODEAMON))
- cfs_daemonize_ctxt("llog_process_thread");
-
if (cd != NULL) {
last_called_index = cd->lpcd_first_idx;
index = cd->lpcd_first_idx + 1;
LASSERT(index <= last_index + 1);
if (index == last_index + 1)
break;
-
+repeat:
CDEBUG(D_OTHER, "index: %d last_index %d\n",
index, last_index);
rec, rec->lrh_type);
if (LLOG_REC_HDR_NEEDS_SWABBING(rec))
- lustre_swab_llog_rec(rec, NULL);
+ lustre_swab_llog_rec(rec);
CDEBUG(D_OTHER, "after swabbing, type=%#x idx=%d\n",
rec->lrh_type, rec->lrh_index);
- if (rec->lrh_index == 0)
- GOTO(out, 0); /* no more records */
-
- if (rec->lrh_len == 0 || rec->lrh_len >LLOG_CHUNK_SIZE){
+ if (rec->lrh_index == 0) {
+ /* probably another rec just got added? */
+ if (index <= loghandle->lgh_last_idx)
+ GOTO(repeat, rc = 0);
+ GOTO(out, rc = 0); /* no more records */
+ }
+ if (rec->lrh_len == 0 ||
+ rec->lrh_len > LLOG_CHUNK_SIZE) {
CWARN("invalid length %d in llog record for "
"index %d/%d\n", rec->lrh_len,
rec->lrh_index, index);
}
}
- out:
+out:
if (cd != NULL)
cd->lpcd_last_idx = last_called_index;
- if (buf)
- OBD_FREE(buf, LLOG_CHUNK_SIZE);
+
+ OBD_FREE(buf, LLOG_CHUNK_SIZE);
lpi->lpi_rc = rc;
-#ifdef __KERNEL__
- cfs_complete(&lpi->lpi_completion);
-#endif
return 0;
}
-int llog_process_flags(struct llog_handle *loghandle, llog_cb_t cb,
- void *data, void *catdata, int flags)
+#ifdef __KERNEL__
+static int llog_process_thread_daemonize(void *arg)
+{
+ struct llog_process_info *lpi = arg;
+ struct lu_env env;
+ int rc;
+
+ cfs_daemonize_ctxt("llog_process_thread");
+
+ /* client env has no keys, tags is just 0 */
+ rc = lu_env_init(&env, LCT_LOCAL);
+ if (rc)
+ goto out;
+ lpi->lpi_env = &env;
+
+ rc = llog_process_thread(arg);
+
+ lu_env_fini(&env);
+out:
+ cfs_complete(&lpi->lpi_completion);
+ return rc;
+}
+#endif
+
+int llog_process_or_fork(const struct lu_env *env,
+ struct llog_handle *loghandle,
+ llog_cb_t cb, void *data, void *catdata, bool fork)
{
struct llog_process_info *lpi;
int rc;
+
ENTRY;
OBD_ALLOC_PTR(lpi);
lpi->lpi_cb = cb;
lpi->lpi_cbdata = data;
lpi->lpi_catdata = catdata;
- lpi->lpi_flags = flags;
#ifdef __KERNEL__
- cfs_init_completion(&lpi->lpi_completion);
- rc = cfs_create_thread(llog_process_thread, lpi, CFS_DAEMON_FLAGS);
- if (rc < 0) {
- CERROR("cannot start thread: %d\n", rc);
- OBD_FREE_PTR(lpi);
- RETURN(rc);
- }
- cfs_wait_for_completion(&lpi->lpi_completion);
+ if (fork) {
+ /* The new thread can't use parent env,
+ * init the new one in llog_process_thread_daemonize. */
+ lpi->lpi_env = NULL;
+ cfs_init_completion(&lpi->lpi_completion);
+ rc = cfs_create_thread(llog_process_thread_daemonize, lpi,
+ CFS_DAEMON_FLAGS);
+ if (rc < 0) {
+ CERROR("%s: cannot start thread: rc = %d\n",
+ loghandle->lgh_ctxt->loc_obd->obd_name, rc);
+ OBD_FREE_PTR(lpi);
+ RETURN(rc);
+ }
+ cfs_wait_for_completion(&lpi->lpi_completion);
+ } else {
+ lpi->lpi_env = env;
+ llog_process_thread(lpi);
+ }
#else
- llog_process_thread(lpi);
+ lpi->lpi_env = env;
+ llog_process_thread(lpi);
#endif
rc = lpi->lpi_rc;
OBD_FREE_PTR(lpi);
RETURN(rc);
}
-EXPORT_SYMBOL(llog_process_flags);
-int llog_process(struct llog_handle *loghandle, llog_cb_t cb,
- void *data, void *catdata)
+int llog_process(const struct lu_env *env, struct llog_handle *loghandle,
+ llog_cb_t cb, void *data, void *catdata)
{
- return llog_process_flags(loghandle, cb, data, catdata, 0);
+ return llog_process_or_fork(env, loghandle, cb, data, catdata, false);
}
EXPORT_SYMBOL(llog_process);
}
EXPORT_SYMBOL(llog_get_size);
-int llog_reverse_process(struct llog_handle *loghandle, llog_cb_t cb,
- void *data, void *catdata)
+int llog_reverse_process(const struct lu_env *env,
+ struct llog_handle *loghandle, llog_cb_t cb,
+ void *data, void *catdata)
{
struct llog_log_hdr *llh = loghandle->lgh_hdr;
struct llog_process_cat_data *cd = catdata;
GOTO(out, rc);
rec = buf;
- idx = le32_to_cpu(rec->lrh_index);
- if (idx < index)
- CDEBUG(D_RPCTRACE, "index %u : idx %u\n", index, idx);
+ idx = rec->lrh_index;
+ CDEBUG(D_RPCTRACE, "index %u : idx %u\n", index, idx);
while (idx < index) {
- rec = ((void *)rec + le32_to_cpu(rec->lrh_len));
+ rec = (void *)rec + rec->lrh_len;
+ if (LLOG_REC_HDR_NEEDS_SWABBING(rec))
+ lustre_swab_llog_rec(rec);
idx ++;
}
- tail = (void *)rec + le32_to_cpu(rec->lrh_len) - sizeof(*tail);
+ LASSERT(idx == index);
+ tail = (void *)rec + rec->lrh_len - sizeof(*tail);
/* process records in buffer, starting where we found one */
while ((void *)tail > buf) {
- rec = (void *)tail - le32_to_cpu(tail->lrt_len) +
- sizeof(*tail);
-
- if (rec->lrh_index == 0)
- GOTO(out, 0); /* no more records */
+ if (tail->lrt_index == 0)
+ GOTO(out, rc = 0); /* no more records */
/* if set, process the callback on this record */
if (ext2_test_bit(index, llh->llh_bitmap)) {
+ rec = (void *)tail - tail->lrt_len +
+ sizeof(*tail);
+
rc = cb(loghandle, rec, data);
if (rc == LLOG_PROC_BREAK) {
GOTO(out, rc);
- }
+ } else if (rc == LLOG_DEL_RECORD) {
+ llog_cancel_rec(loghandle,
+ tail->lrt_index);
+ rc = 0;
+ }
if (rc)
GOTO(out, rc);
}
--index;
if (index < first_index)
GOTO(out, rc = 0);
- tail = (void *)rec - sizeof(*tail);
+ tail = (void *)tail - tail->lrt_len;
}
}
#include <obd_class.h>
#include <lustre_log.h>
-#include <libcfs/list.h>
+
+#include "llog_internal.h"
/* Create a new log handle and add it to the open list.
* This log handle will be closed when all of the records in it are removed.
cd.lpcd_first_idx = d->lpd_startidx;
cd.lpcd_last_idx = 0;
- rc = llog_process_flags(llh, d->lpd_cb, d->lpd_data, &cd,
- d->lpd_flags);
+ rc = llog_process(NULL, llh, d->lpd_cb, d->lpd_data, &cd);
/* Continue processing the next log from idx 0 */
d->lpd_startidx = 0;
} else {
- rc = llog_process_flags(llh, d->lpd_cb, d->lpd_data, NULL,
- d->lpd_flags);
+ rc = llog_process(NULL, llh, d->lpd_cb, d->lpd_data, NULL);
}
RETURN(rc);
}
-int llog_cat_process_flags(struct llog_handle *cat_llh, llog_cb_t cb,
- void *data, int flags, int startcat, int startidx)
+int llog_cat_process_or_fork(const struct lu_env *env,
+ struct llog_handle *cat_llh,
+ llog_cb_t cb, void *data, int startcat,
+ int startidx, bool fork)
{
struct llog_process_data d;
struct llog_log_hdr *llh = cat_llh->lgh_hdr;
d.lpd_cb = cb;
d.lpd_startcat = startcat;
d.lpd_startidx = startidx;
- d.lpd_flags = flags;
if (llh->llh_cat_idx > cat_llh->lgh_last_idx) {
struct llog_process_cat_data cd;
cd.lpcd_first_idx = llh->llh_cat_idx;
cd.lpcd_last_idx = 0;
- rc = llog_process_flags(cat_llh, llog_cat_process_cb, &d, &cd,
- flags);
+ rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb,
+ &d, &cd, fork);
if (rc != 0)
RETURN(rc);
cd.lpcd_first_idx = 0;
cd.lpcd_last_idx = cat_llh->lgh_last_idx;
- rc = llog_process_flags(cat_llh, llog_cat_process_cb, &d, &cd,
- flags);
+ rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb,
+ &d, &cd, fork);
} else {
- rc = llog_process_flags(cat_llh, llog_cat_process_cb, &d, NULL,
- flags);
+ rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb,
+ &d, NULL, fork);
}
RETURN(rc);
}
-EXPORT_SYMBOL(llog_cat_process_flags);
+EXPORT_SYMBOL(llog_cat_process_or_fork);
-int llog_cat_process(struct llog_handle *cat_llh, llog_cb_t cb, void *data,
- int startcat, int startidx)
+int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh,
+ llog_cb_t cb, void *data, int startcat, int startidx)
{
- return llog_cat_process_flags(cat_llh, cb, data, 0, startcat, startidx);
+ return llog_cat_process_or_fork(env, cat_llh, cb, data, startcat,
+ startidx, 0);
}
EXPORT_SYMBOL(llog_cat_process);
struct llog_ctxt *ctxt = args->lpca_ctxt;
struct llog_handle *llh = NULL;
llog_cb_t cb = args->lpca_cb;
- struct llog_logid logid;
+ struct llog_thread_info *lgi;
+ struct lu_env env;
int rc;
ENTRY;
cfs_daemonize_ctxt("ll_log_process");
- logid = *(struct llog_logid *)(args->lpca_arg);
- rc = llog_create(ctxt, &llh, &logid, NULL);
+ rc = lu_env_init(&env, LCT_LOCAL);
+ if (rc)
+ GOTO(out, rc);
+ lgi = llog_info(&env);
+ LASSERT(lgi);
+
+ lgi->lgi_logid = *(struct llog_logid *)(args->lpca_arg);
+ rc = llog_create(ctxt, &llh, &lgi->lgi_logid, NULL);
if (rc) {
CERROR("llog_create() failed %d\n", rc);
- GOTO(out, rc);
+ GOTO(out_env, rc);
}
rc = llog_init_handle(llh, LLOG_F_IS_CAT, NULL);
if (rc) {
}
if (cb) {
- rc = llog_cat_process(llh, cb, NULL, 0, 0);
+ rc = llog_cat_process(&env, llh, cb, NULL, 0, 0);
if (rc != LLOG_PROC_BREAK && rc != 0)
CERROR("llog_cat_process() failed %d\n", rc);
cb(llh, NULL, NULL);
rc = llog_cat_put(llh);
if (rc)
CERROR("llog_cat_put() failed %d\n", rc);
+out_env:
+ lu_env_fini(&env);
out:
llog_ctxt_put(ctxt);
OBD_FREE_PTR(args);
RETURN(rc);
}
- rc = llog_reverse_process(llh, d->lpd_cb, d->lpd_data, NULL);
+ rc = llog_reverse_process(NULL, llh, d->lpd_cb, d->lpd_data, NULL);
RETURN(rc);
}
-int llog_cat_reverse_process(struct llog_handle *cat_llh,
- llog_cb_t cb, void *data)
+int llog_cat_reverse_process(const struct lu_env *env,
+ struct llog_handle *cat_llh,
+ llog_cb_t cb, void *data)
{
struct llog_process_data d;
struct llog_process_cat_data cd;
cd.lpcd_first_idx = 0;
cd.lpcd_last_idx = cat_llh->lgh_last_idx;
- rc = llog_reverse_process(cat_llh, llog_cat_reverse_process_cb,
- &d, &cd);
+ rc = llog_reverse_process(env, cat_llh,
+ llog_cat_reverse_process_cb,
+ &d, &cd);
if (rc != 0)
RETURN(rc);
cd.lpcd_first_idx = le32_to_cpu(llh->llh_cat_idx);
cd.lpcd_last_idx = 0;
- rc = llog_reverse_process(cat_llh, llog_cat_reverse_process_cb,
- &d, &cd);
+ rc = llog_reverse_process(env, cat_llh,
+ llog_cat_reverse_process_cb,
+ &d, &cd);
} else {
- rc = llog_reverse_process(cat_llh, llog_cat_reverse_process_cb,
- &d, NULL);
+ rc = llog_reverse_process(env, cat_llh,
+ llog_cat_reverse_process_cb,
+ &d, NULL);
}
RETURN(rc);
struct llog_logid *logid);
int class_config_dump_handler(struct llog_handle * handle,
struct llog_rec_hdr *rec, void *data);
+int llog_process_or_fork(const struct lu_env *env,
+ struct llog_handle *loghandle,
+ llog_cb_t cb, void *data, void *catdata, bool fork);
#endif
lir->lid_id.lgl_ogen);
RETURN(rc);
}
- rc = llog_process(log_handle, llog_check_cb, NULL, NULL);
+ rc = llog_process(NULL, log_handle, llog_check_cb, NULL, NULL);
llog_close(log_handle);
} else {
switch (rec->lrh_type) {
case OST_SZ_REC:
- case OST_RAID1_REC:
case MDS_UNLINK_REC:
- case MDS_SETATTR_REC:
case MDS_SETATTR64_REC:
case OBD_CFG_REC:
case LLOG_HDR_MAGIC: {
}
case OBD_IOC_LLOG_CHECK: {
LASSERT(data->ioc_inllen1);
- err = llog_process(handle, llog_check_cb, data, NULL);
+ err = llog_process(NULL, handle, llog_check_cb, data, NULL);
if (err == -LLOG_EEMPTY)
err = 0;
GOTO(out_close, err);
case OBD_IOC_LLOG_PRINT: {
LASSERT(data->ioc_inllen1);
- err = llog_process(handle, class_config_dump_handler,data,NULL);
+ err = llog_process(NULL, handle, class_config_dump_handler,
+ data, NULL);
if (err == -LLOG_EEMPTY)
err = 0;
else
- err = llog_process(handle, llog_print_cb, data, NULL);
+ err = llog_process(NULL, handle, llog_print_cb, data,
+ NULL);
GOTO(out_close, err);
}
GOTO(out_close, err);
err = llog_remove_log(handle, &plain);
} else {
- /*remove all the log of the catalog*/
- llog_process(handle, llog_delete_cb, NULL, NULL);
+ /* remove all the log of the catalog */
+ llog_process(NULL, handle, llog_delete_cb, NULL, NULL);
}
GOTO(out_close, err);
}
reccookie->lgc_lgl = loghandle->lgh_id;
reccookie->lgc_index = index;
if ((rec->lrh_type == MDS_UNLINK_REC) ||
- (rec->lrh_type == MDS_SETATTR_REC) ||
(rec->lrh_type == MDS_SETATTR64_REC))
reccookie->lgc_subsys = LLOG_MDS_OST_ORIG_CTXT;
else if (rec->lrh_type == OST_SZ_REC)
reccookie->lgc_subsys = LLOG_SIZE_ORIG_CTXT;
- else if (rec->lrh_type == OST_RAID1_REC)
- reccookie->lgc_subsys = LLOG_RD1_ORIG_CTXT;
else
reccookie->lgc_subsys = -1;
rc = 1;
tail = (struct llog_rec_tail *)((char *)buf + rc -
sizeof(struct llog_rec_tail));
- if (LLOG_REC_HDR_NEEDS_SWABBING(rec)) {
- lustre_swab_llog_rec(rec, tail);
- }
+ if (LLOG_REC_HDR_NEEDS_SWABBING(rec))
+ lustre_swab_llog_rec(rec);
*cur_idx = tail->lrt_index;
if (rc)
GOTO(out, rc);
- rc = llog_process(handle, (llog_cb_t)cat_cancel_cb, NULL, NULL);
+ rc = llog_process(NULL, handle, (llog_cb_t)cat_cancel_cb, NULL, NULL);
if (rc)
CERROR("llog_process() with cat_cancel_cb failed: %d\n", rc);
GOTO(out, rc);
}
EXPORT_SYMBOL(lustre_swab_lu_seq_range);
-void lustre_swab_llog_rec(struct llog_rec_hdr *rec, struct llog_rec_tail *tail)
+void lustre_swab_llog_rec(struct llog_rec_hdr *rec)
{
+ struct llog_rec_tail *tail = NULL;
+
__swab32s(&rec->lrh_len);
__swab32s(&rec->lrh_index);
__swab32s(&rec->lrh_type);
+ __swab32s(&rec->lrh_id);
switch (rec->lrh_type) {
- case OST_SZ_REC: {
+ case OST_SZ_REC:
+ {
struct llog_size_change_rec *lsc =
(struct llog_size_change_rec *)rec;
lustre_swab_ll_fid(&lsc->lsc_fid);
__swab32s(&lsc->lsc_ioepoch);
+ tail = &lsc->lsc_tail;
break;
}
-
- case OST_RAID1_REC:
- break;
-
- case MDS_UNLINK_REC: {
+ case MDS_UNLINK_REC:
+ {
struct llog_unlink_rec *lur = (struct llog_unlink_rec *)rec;
__swab64s(&lur->lur_oid);
__swab32s(&lur->lur_oseq);
__swab32s(&lur->lur_count);
+ tail = &lur->lur_tail;
break;
}
-
- case MDS_SETATTR_REC: {
- struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
-
- __swab64s(&lsr->lsr_oid);
- __swab32s(&lsr->lsr_oseq);
- __swab32s(&lsr->lsr_uid);
- __swab32s(&lsr->lsr_gid);
- break;
- }
-
- case CHANGELOG_REC: {
+ case CHANGELOG_REC:
+ {
struct llog_changelog_rec *cr = (struct llog_changelog_rec*)rec;
__swab16s(&cr->cr.cr_namelen);
lustre_swab_lu_fid(&ext->cr.cr_sfid);
lustre_swab_lu_fid(&ext->cr.cr_spfid);
+ tail = &ext->cr_tail;
+ } else {
+ tail = &cr->cr_tail;
}
break;
}
-
- case CHANGELOG_USER_REC: {
+ case CHANGELOG_USER_REC:
+ {
struct llog_changelog_user_rec *cur =
(struct llog_changelog_user_rec*)rec;
__swab32s(&cur->cur_id);
__swab64s(&cur->cur_endrec);
+ tail = &cur->cur_tail;
break;
}
- case MDS_SETATTR64_REC: {
- struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
+ case MDS_SETATTR64_REC:
+ {
+ struct llog_setattr64_rec *lsr =
+ (struct llog_setattr64_rec *)rec;
__swab64s(&lsr->lsr_oid);
__swab32s(&lsr->lsr_oseq);
__swab32s(&lsr->lsr_uid);
+ __swab32s(&lsr->lsr_uid_h);
__swab32s(&lsr->lsr_gid);
-
+ __swab32s(&lsr->lsr_gid_h);
+ tail = &lsr->lsr_tail;
break;
}
-
case OBD_CFG_REC:
/* these are swabbed as they are consumed */
break;
-
- case LLOG_HDR_MAGIC: {
+ case LLOG_HDR_MAGIC:
+ {
struct llog_log_hdr *llh = (struct llog_log_hdr *)rec;
__swab64s(&llh->llh_timestamp);
__swab32s(&llh->llh_flags);
__swab32s(&llh->llh_size);
__swab32s(&llh->llh_cat_idx);
- if (tail != &llh->llh_tail) {
- __swab32s(&llh->llh_tail.lrt_index);
- __swab32s(&llh->llh_tail.lrt_len);
- }
+ tail = &llh->llh_tail;
break;
}
-
- case LLOG_LOGID_MAGIC: {
+ case LLOG_LOGID_MAGIC:
+ {
struct llog_logid_rec *lid = (struct llog_logid_rec *)rec;
__swab64s(&lid->lid_id.lgl_oid);
__swab64s(&lid->lid_id.lgl_oseq);
__swab32s(&lid->lid_id.lgl_ogen);
+ tail = &lid->lid_tail;
break;
}
+ case LLOG_GEN_REC:
+ {
+ struct llog_gen_rec *lgr = (struct llog_gen_rec *)rec;
+
+ __swab64s(&lgr->lgr_gen.mnt_cnt);
+ __swab64s(&lgr->lgr_gen.conn_cnt);
+ tail = &lgr->lgr_tail;
+ break;
+ }
case LLOG_PAD_MAGIC:
break;
-
default:
CERROR("Unknown llog rec type %#x swabbing rec %p\n",
rec->lrh_type, rec);
ENTRY;
print_llog_hdr(h);
- lustre_swab_llog_rec(&h->llh_hdr, &h->llh_tail);
+ lustre_swab_llog_rec(&h->llh_hdr);
print_llog_hdr(h);
EXIT;
llog_init_handle(llh, LLOG_F_IS_CAT, &uuid);
CWARN("5b: print the catalog entries.. we expect 2\n");
- rc = llog_process(llh, cat_print_cb, "test 5", NULL);
+ rc = llog_process(NULL, llh, cat_print_cb, "test 5", NULL);
if (rc) {
CERROR("5b: process with cat_print_cb failed: %d\n", rc);
GOTO(out, rc);
}
CWARN("5c: Cancel 40000 records, see one log zapped\n");
- rc = llog_cat_process(llh, llog_cancel_rec_cb, "foobar", 0, 0);
+ rc = llog_cat_process(NULL, llh, llog_cancel_rec_cb, "foobar", 0, 0);
if (rc != -4711) {
CERROR("5c: process with cat_cancel_cb failed: %d\n", rc);
GOTO(out, rc);
}
CWARN("5b: print the catalog entries.. we expect 1\n");
- rc = llog_process(llh, cat_print_cb, "test 5", NULL);
+ rc = llog_process(NULL, llh, cat_print_cb, "test 5", NULL);
if (rc) {
CERROR("5b: process with cat_print_cb failed: %d\n", rc);
GOTO(out, rc);
}
CWARN("5e: print plain log entries.. expect 6\n");
- rc = llog_cat_process(llh, plain_print_cb, "foobar", 0, 0);
+ rc = llog_cat_process(NULL, llh, plain_print_cb, "foobar", 0, 0);
if (rc) {
CERROR("5e: process with plain_print_cb failed: %d\n", rc);
GOTO(out, rc);
}
CWARN("5f: print plain log entries reversely.. expect 6\n");
- rc = llog_cat_reverse_process(llh, plain_print_cb, "foobar");
+ rc = llog_cat_reverse_process(NULL, llh, plain_print_cb, "foobar");
if (rc) {
CERROR("5f: reversely process with plain_print_cb failed: %d\n", rc);
GOTO(out, rc);
GOTO(parse_out, rc);
}
- rc = llog_process(llh, plain_print_cb, NULL, NULL);
+ rc = llog_process(NULL, llh, plain_print_cb, NULL, NULL);
if (rc)
CERROR("6: llog_process failed %d\n", rc);
- rc = llog_reverse_process(llh, plain_print_cb, NULL, NULL);
+ rc = llog_reverse_process(NULL, llh, plain_print_cb, NULL, NULL);
if (rc)
CERROR("6: llog_reverse_process failed %d\n", rc);
cd.lpcd_first_idx = cfg->cfg_last_idx;
cd.lpcd_last_idx = 0;
- rc = llog_process(llh, class_config_llog_handler, cfg, &cd);
+ rc = llog_process(NULL, llh, class_config_llog_handler, cfg, &cd);
CDEBUG(D_CONFIG, "Processed log %s gen %d-%d (rc=%d)\n", name,
cd.lpcd_first_idx + 1, cd.lpcd_last_idx, rc);
if (rc)
GOTO(parse_out, rc);
- rc = llog_process(llh, class_config_dump_handler, cfg, NULL);
+ rc = llog_process(NULL, llh, class_config_dump_handler, cfg, NULL);
parse_out:
rc2 = llog_close(llh);
if (rc == 0)
if (oinfo.oi_oa == NULL)
RETURN(-ENOMEM);
- if (rec->lrh_type == MDS_SETATTR_REC) {
- struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
-
- oinfo.oi_oa->o_id = lsr->lsr_oid;
- oinfo.oi_oa->o_seq = lsr->lsr_oseq;
- oinfo.oi_oa->o_uid = lsr->lsr_uid;
- oinfo.oi_oa->o_gid = lsr->lsr_gid;
- } else {
+ if (rec->lrh_type == MDS_SETATTR64_REC) {
struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
oinfo.oi_oa->o_id = lsr->lsr_oid;
oinfo.oi_oa->o_seq = lsr->lsr_oseq;
oinfo.oi_oa->o_uid = lsr->lsr_uid;
oinfo.oi_oa->o_gid = lsr->lsr_gid;
- }
+ } else {
+ CERROR("%s: wrong llog type %#x\n", obd->obd_name,
+ rec->lrh_type);
+ RETURN(-EINVAL);
+ }
oinfo.oi_oa->o_valid |= (OBD_MD_FLID | OBD_MD_FLUID | OBD_MD_FLGID |
OBD_MD_FLCOOKIE);
case MDS_UNLINK_REC:
rc = filter_recov_log_unlink_cb(ctxt, rec, &cookie);
break;
- case MDS_SETATTR_REC:
case MDS_SETATTR64_REC:
rc = filter_recov_log_setattr_cb(ctxt, rec, &cookie);
break;
case LLOG_GEN_REC: {
struct llog_gen_rec *lgr = (struct llog_gen_rec *)rec;
+
if (llog_gen_lt(lgr->lgr_gen, ctxt->loc_gen))
rc = 0;
else
GOTO(out_close, rc = 0);
}
- rc = llog_process(llh, local_read_handler, (void *) conf, NULL);
+ rc = llog_process(NULL, llh, local_read_handler, (void *)conf, NULL);
if (rc == 0) {
conf->sc_local = 1;
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux niu-dell 2.6.18-238 #2 SMP Mon May 16 03:44:25 PDT 2011 x86_64 x86_64 x86
- * with gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) */
+ * running on Linux node7 2.6.32 #4 SMP Tue Aug 7 13:09:55 MSK 2012 x86_64 x86_64 x86_64 GNU/
+ * with gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) */
/* Constants... */
MDS_OPEN_SYNC);
LASSERTF(MDS_OPEN_DIRECTORY == 000000200000UL, "found 0%.11oUL\n",
MDS_OPEN_DIRECTORY);
- LASSERTF(MDS_OPEN_BY_FID == 000040000000UL, "found 0%.11oUL\n",
- MDS_OPEN_BY_FID);
+ LASSERTF(MDS_OPEN_BY_FID == 000040000000UL, "found 0%.11oUL\n",
+ MDS_OPEN_BY_FID);
LASSERTF(MDS_OPEN_DELAY_CREATE == 000100000000UL, "found 0%.11oUL\n",
MDS_OPEN_DELAY_CREATE);
LASSERTF(MDS_OPEN_OWNEROVERRIDE == 000200000000UL, "found 0%.11oUL\n",
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogen));
CLASSERT(OST_SZ_REC == 274730752);
- CLASSERT(OST_RAID1_REC == 274731008);
CLASSERT(MDS_UNLINK_REC == 274801668);
- CLASSERT(MDS_SETATTR_REC == 274801665);
+ CLASSERT(MDS_UNLINK64_REC == 275325956);
+ CLASSERT(MDS_SETATTR64_REC == 275325953);
CLASSERT(OBD_CFG_REC == 274857984);
- CLASSERT(PTL_CFG_REC == 274923520);
CLASSERT(LLOG_GEN_REC == 274989056);
- CLASSERT(LLOG_JOIN_REC == 275054592);
+ CLASSERT(CHANGELOG_REC == 275120128);
+ CLASSERT(CHANGELOG_USER_REC == 275185664);
CLASSERT(LLOG_HDR_MAGIC == 275010873);
CLASSERT(LLOG_LOGID_MAGIC == 275010875);
(long long)(int)offsetof(struct llog_rec_hdr, lrh_type));
LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4, "found %lld\n",
(long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_type));
- LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_padding) == 12, "found %lld\n",
- (long long)(int)offsetof(struct llog_rec_hdr, lrh_padding));
- LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_padding) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_padding));
+ LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_id) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct llog_rec_hdr, lrh_id));
+ LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_id) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_id));
/* Checks for struct llog_rec_tail */
LASSERTF((int)sizeof(struct llog_rec_tail) == 8, "found %lld\n",
cur_rec->lrh_type, cur_rec->lrh_len);
} else {
printf("Bit %d of %d not set\n", idx, recs_num);
- cur_rec->lrh_padding = CANCELLED;
+ cur_rec->lrh_id = CANCELLED;
/* The header counts only set records */
i--;
}
lopt = le32_to_cpu(recs[i]->lrh_type);
- if (recs[i]->lrh_padding == CANCELLED)
+ if (recs[i]->lrh_id == CANCELLED)
printf("NOT SET ");
if (lopt == OBD_CFG_REC) {
CHECK_MEMBER(llog_logid, lgl_oseq);
CHECK_MEMBER(llog_logid, lgl_ogen);
- CHECK_CVALUE(OST_SZ_REC);
- CHECK_CVALUE(OST_RAID1_REC);
- CHECK_CVALUE(MDS_UNLINK_REC);
- CHECK_CVALUE(MDS_SETATTR_REC);
- CHECK_CVALUE(OBD_CFG_REC);
- CHECK_CVALUE(PTL_CFG_REC);
- CHECK_CVALUE(LLOG_GEN_REC);
- CHECK_CVALUE(LLOG_JOIN_REC);
- CHECK_CVALUE(LLOG_HDR_MAGIC);
- CHECK_CVALUE(LLOG_LOGID_MAGIC);
+ CHECK_CVALUE(OST_SZ_REC);
+ CHECK_CVALUE(MDS_UNLINK_REC);
+ CHECK_CVALUE(MDS_UNLINK64_REC);
+ CHECK_CVALUE(MDS_SETATTR64_REC);
+ CHECK_CVALUE(OBD_CFG_REC);
+ CHECK_CVALUE(LLOG_GEN_REC);
+ CHECK_CVALUE(CHANGELOG_REC);
+ CHECK_CVALUE(CHANGELOG_USER_REC);
+ CHECK_CVALUE(LLOG_HDR_MAGIC);
+ CHECK_CVALUE(LLOG_LOGID_MAGIC);
}
static void
CHECK_MEMBER(llog_rec_hdr, lrh_len);
CHECK_MEMBER(llog_rec_hdr, lrh_index);
CHECK_MEMBER(llog_rec_hdr, lrh_type);
- CHECK_MEMBER(llog_rec_hdr, lrh_padding);
+ CHECK_MEMBER(llog_rec_hdr, lrh_id);
}
static void
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux niu-dell 2.6.18-238 #2 SMP Mon May 16 03:44:25 PDT 2011 x86_64 x86_64 x86
- * with gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) */
+ * running on Linux node7 2.6.32 #4 SMP Tue Aug 7 13:09:55 MSK 2012 x86_64 x86_64 x86_64 GNU/
+ * with gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) */
/* Constants... */
MDS_OPEN_SYNC);
LASSERTF(MDS_OPEN_DIRECTORY == 000000200000UL, "found 0%.11oUL\n",
MDS_OPEN_DIRECTORY);
- LASSERTF(MDS_OPEN_BY_FID == 000040000000UL, "found 0%.11oUL\n",
- MDS_OPEN_BY_FID);
+ LASSERTF(MDS_OPEN_BY_FID == 000040000000UL, "found 0%.11oUL\n",
+ MDS_OPEN_BY_FID);
LASSERTF(MDS_OPEN_DELAY_CREATE == 000100000000UL, "found 0%.11oUL\n",
MDS_OPEN_DELAY_CREATE);
LASSERTF(MDS_OPEN_OWNEROVERRIDE == 000200000000UL, "found 0%.11oUL\n",
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogen));
CLASSERT(OST_SZ_REC == 274730752);
- CLASSERT(OST_RAID1_REC == 274731008);
CLASSERT(MDS_UNLINK_REC == 274801668);
- CLASSERT(MDS_SETATTR_REC == 274801665);
+ CLASSERT(MDS_UNLINK64_REC == 275325956);
+ CLASSERT(MDS_SETATTR64_REC == 275325953);
CLASSERT(OBD_CFG_REC == 274857984);
- CLASSERT(PTL_CFG_REC == 274923520);
CLASSERT(LLOG_GEN_REC == 274989056);
- CLASSERT(LLOG_JOIN_REC == 275054592);
+ CLASSERT(CHANGELOG_REC == 275120128);
+ CLASSERT(CHANGELOG_USER_REC == 275185664);
CLASSERT(LLOG_HDR_MAGIC == 275010873);
CLASSERT(LLOG_LOGID_MAGIC == 275010875);
(long long)(int)offsetof(struct llog_rec_hdr, lrh_type));
LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4, "found %lld\n",
(long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_type));
- LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_padding) == 12, "found %lld\n",
- (long long)(int)offsetof(struct llog_rec_hdr, lrh_padding));
- LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_padding) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_padding));
+ LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_id) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct llog_rec_hdr, lrh_id));
+ LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_id) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_id));
/* Checks for struct llog_rec_tail */
LASSERTF((int)sizeof(struct llog_rec_tail) == 8, "found %lld\n",