#define D_RPCTRACE 0x00100000 /* for distributed debugging */
#define D_VFSTRACE 0x00200000
#define D_READA 0x00400000 /* read-ahead */
+#define D_CONFIG 0x00800000
#ifdef __KERNEL__
# include <linux/sched.h> /* THREAD_SIZE */
{"trace", "inode", "super", "ext2", "malloc", "cache", "info", "ioctl",
"blocks", "net", "warning", "buffs", "other", "dentry", "portals",
"page", "dlmtrace", "error", "emerg", "ha", "rpctrace", "vfstrace",
- "reada", NULL};
+ "reada", "config", NULL};
struct debug_daemon_cmd {
char *cmd;
LCFG_MOUNTOPT = 0x00cf007,
LCFG_DEL_MOUNTOPT = 0x00cf008,
LCFG_SET_TIMEOUT = 0x00cf009,
- LCFG_SET_UPCALL = 0x00cf010,
+ LCFG_SET_UPCALL = 0x00cf00a,
+ LCFG_LOV_ADD_OBD = 0x00cf00b,
+ LCFG_LOV_DEL_OBD = 0x00cf00c,
};
struct lustre_cfg {
#define LDLM_FL_LOCAL 0x004000 /* local lock (ie, no srv/cli split) */
#define LDLM_FL_WARN 0x008000 /* see ldlm_cli_cancel_unused */
#define LDLM_FL_DISCARD_DATA 0x010000 /* discard (no writeback) on cancel */
+#define LDLM_FL_CONFIG_CHANGE 0x020000 /* see ldlm_cli_cancel_unused */
#define LDLM_FL_NO_TIMEOUT 0x020000 /* Blocked by group lock - wait
* indefinitely */
__u64 ns_resources;
ldlm_res_policy ns_policy;
struct ldlm_valblock_ops *ns_lvbo;
- void *ns_lvbp;
+ void *ns_lvbp;
+ wait_queue_head_t ns_waitq;
};
/*
void ptlrpc_wake_delayed(struct obd_import *imp);
int ptlrpc_recover_import(struct obd_import *imp, char *new_uuid);
int ptlrpc_set_import_active(struct obd_import *imp, int active);
+void ptlrpc_activate_import(struct obd_import *imp);
void ptlrpc_deactivate_import(struct obd_import *imp);
void ptlrpc_invalidate_import(struct obd_import *imp, int in_rpc);
void ptlrpc_fail_import(struct obd_import *imp, int generation);
__u32 llh_cat_idx;
/* for a catalog the first plain slot is next to it */
struct obd_uuid llh_tgtuuid;
- __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
+ __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
__u32 llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];
struct llog_rec_tail llh_tail;
} __attribute__((packed));
/* llog protocol */
enum llogd_rpc_ops {
- LLOG_ORIGIN_HANDLE_CREATE = 501,
+ LLOG_ORIGIN_HANDLE_OPEN = 501,
LLOG_ORIGIN_HANDLE_NEXT_BLOCK = 502,
LLOG_ORIGIN_HANDLE_READ_HEADER = 503,
LLOG_ORIGIN_HANDLE_WRITE_REC = 504,
struct obd_device *, int, struct llog_logid *);
int (*lop_cleanup)(struct llog_ctxt *ctxt);
- int (*lop_create)(struct llog_ctxt *ctxt, struct llog_handle **,
- struct llog_logid *logid, char *name);
+ int (*lop_open)(struct llog_ctxt *ctxt, struct llog_handle **,
+ struct llog_logid *logid, char *name, int flags);
int (*lop_destroy)(struct llog_handle *handle);
int (*lop_close)(struct llog_handle *handle);
return llogs->llog_ctxt[index];
}
-static inline int llog_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+static inline int llog_open(struct llog_ctxt *ctxt, struct llog_handle **res,
+ struct llog_logid *logid, char *name, int flags)
{
struct llog_operations *lop;
int rc;
rc = llog_ctxt2ops(ctxt, &lop);
if (rc)
RETURN(rc);
- if (lop->lop_create == NULL)
+ if (lop->lop_open == NULL)
RETURN(-EOPNOTSUPP);
- rc = lop->lop_create(ctxt, res, logid, name);
+ rc = lop->lop_open(ctxt, res, logid, name, flags);
RETURN(rc);
}
#endif
/* ptlrpc/llog_server.c */
-int llog_origin_handle_create(struct ptlrpc_request *req);
+int llog_origin_handle_open(struct ptlrpc_request *req);
int llog_origin_handle_prev_block(struct ptlrpc_request *req);
int llog_origin_handle_next_block(struct ptlrpc_request *req);
int llog_origin_handle_read_header(struct ptlrpc_request *req);
FIXME later will be totally fixed by b_cmd*/
int mds_num;
atomic_t mds_open_count;
+ int mds_config_version;
char *mds_lmv_name;
struct obd_device *mds_lmv_obd; /* XXX lmv_obd */
struct lov_tgt_desc {
struct obd_uuid uuid;
+ __u32 ltd_gen;
struct obd_export *ltd_exp;
int active; /* is this target up for requests */
};
#define OBD_OPT_REAL_CLIENT 0x0004
#define OBD_LLOG_FL_SENDNOW 0x0001
+#define OBD_LLOG_FL_CREATE 0x0002
struct mdc_op_data;
int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
int (*o_precleanup)(struct obd_device *dev, int flags);
int (*o_cleanup)(struct obd_device *dev, int flags);
+ int (*o_process_config)(struct obd_device *dev, obd_count len,
+ void *data);
int (*o_postrecov)(struct obd_device *dev);
int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
struct obd_uuid *cluuid);
struct lov_stripe_md *mem_src);
int (*o_unpackmd)(struct obd_export *exp,struct lov_stripe_md **mem_tgt,
struct lov_mds_md *disk_src, int disk_len);
+ int (*o_revalidate_md)(struct obd_export *exp, struct obdo *oa,
+ struct lov_stripe_md *ea,
+ struct obd_trans_info *oti);
int (*o_preallocate)(struct lustre_handle *, obd_count *req,
obd_id *ids);
int (*o_create)(struct obd_export *exp, struct obdo *oa,
#include <linux/lustre_lib.h>
#include <linux/lustre_idl.h>
#include <linux/lprocfs_status.h>
-#include <linux/lustre_mds.h>
+#include <linux/lustre_log.h>
/* OBD Device Declarations */
#define MAX_OBD_DEVICES 256
void oig_release(struct obd_io_group *oig);
int oig_wait(struct obd_io_group *oig);
-/* config.c */
+/* obd_config.c */
int class_process_config(struct lustre_cfg *lcfg);
-int class_attach(struct lustre_cfg *lcfg);
-int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
-int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg);
-int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg);
-/* Passed as data param to class_config_parse_llog */
+/* Passed as data param to class_config_parse_handler() */
struct config_llog_instance {
char * cfg_instance;
struct obd_uuid cfg_uuid;
- ptl_nid_t cfg_local_nid;
+ ptl_nid_t cfg_local_nid;
};
-int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
- struct config_llog_instance *cfg);
+
+int class_config_process_llog(struct llog_ctxt *ctxt, char *name,
+ struct config_llog_instance *cfg);
int class_config_dump_llog(struct llog_ctxt *ctxt, char *name,
struct config_llog_instance *cfg);
RETURN(rc);
}
+static inline int
+obd_process_config(struct obd_device *obd, int datalen, void *data)
+{
+ int rc;
+ ENTRY;
+
+ OBD_CHECK_OP(obd, process_config, -EOPNOTSUPP);
+ OBD_COUNTER_INCREMENT(obd, process_config);
+
+ rc = OBP(obd, process_config)(obd, datalen, data);
+ RETURN(rc);
+}
+
/* Pack an in-memory MD struct for storage on disk.
* Returns +ve size of packed MD (0 for free), or -ve error.
*
return obd_unpackmd(exp, mem_tgt, NULL, 0);
}
+static inline int obd_revalidate_md(struct obd_export *exp, struct obdo *obdo,
+ struct lov_stripe_md *ea,
+ struct obd_trans_info *oti)
+{
+ int rc;
+ ENTRY;
+
+ EXP_CHECK_OP(exp, revalidate_md);
+ OBD_COUNTER_INCREMENT(exp->exp_obd, revalidate_md);
+
+ rc = OBP(exp->exp_obd, revalidate_md)(exp, obdo, ea, oti);
+ RETURN(rc);
+}
+
static inline int obd_create(struct obd_export *exp, struct obdo *obdo,
struct lov_stripe_md **ea,
struct obd_trans_info *oti)
return strcmp(u1->uuid, u2->uuid) == 0;
}
+static inline int obd_uuid_empty(struct obd_uuid *uuid)
+{
+ return uuid->uuid[0] == '\0';
+}
+
static inline void obd_str2uuid(struct obd_uuid *uuid, char *tmp)
{
strncpy(uuid->uuid, tmp, sizeof(*uuid));
rc = llog_origin_handle_cancel(req);
ldlm_callback_reply(req, rc);
RETURN(0);
- case LLOG_ORIGIN_HANDLE_CREATE:
+ case LLOG_ORIGIN_HANDLE_OPEN:
OBD_FAIL_RETURN(OBD_FAIL_OBD_LOGD_NET, 0);
- rc = llog_origin_handle_create(req);
+ rc = llog_origin_handle_open(req);
ldlm_callback_reply(req, rc);
RETURN(0);
case LLOG_ORIGIN_HANDLE_NEXT_BLOCK:
if (opaque != NULL && lock->l_ast_data != opaque) {
LDLM_ERROR(lock, "data %p doesn't match opaque %p",
lock->l_ast_data, opaque);
- //LBUG();
continue;
}
if (lock->l_readers || lock->l_writers) {
- if (flags & LDLM_FL_WARN) {
+ if (flags & LDLM_FL_CONFIG_CHANGE)
+ lock->l_flags |= LDLM_FL_CBPENDING;
+ else if (flags & LDLM_FL_WARN)
LDLM_ERROR(lock, "lock in use");
- //LBUG();
- }
continue;
}
RETURN(0);
}
+static inline int have_no_nsresource(struct ldlm_namespace *ns)
+{
+ int no_resource = 0;
+
+ spin_lock(&ns->ns_counter_lock);
+ if (ns->ns_resources == 0)
+ no_resource = 1;
+ spin_unlock(&ns->ns_counter_lock);
+
+ RETURN(no_resource);
+}
+
/* Cancel all locks on a namespace (or a specific resource, if given)
* that have 0 readers/writers.
*
* If flags & LDLM_FL_LOCAL_ONLY, throw the locks away without trying
* to notify the server.
- * If flags & LDLM_FL_WARN, print a warning if some locks are still in use. */
+ * If flags & LDLM_FL_NO_CALLBACK, don't run the cancel callback.
+ * If flags & LDLM_FL_WARN, print a warning if some locks are still in use.
+ * If flags & LDLM_FL_CONFIG_CHANGE, mark all locks as having a pending callback
+ */
int ldlm_cli_cancel_unused(struct ldlm_namespace *ns,
struct ldlm_res_id *res_id, int flags, void *opaque)
{
int i;
+ struct l_wait_info lwi = { 0 };
ENTRY;
if (ns == NULL)
l_lock(&ns->ns_lock);
for (i = 0; i < RES_HASH_SIZE; i++) {
- struct list_head *tmp, *pos;
- list_for_each_safe(tmp, pos, &(ns->ns_hash[i])) {
+ struct list_head *tmp, *next;
+ list_for_each_safe(tmp, next, &(ns->ns_hash[i])) {
int rc;
struct ldlm_resource *res;
res = list_entry(tmp, struct ldlm_resource, lr_hash);
ldlm_resource_getref(res);
+ l_unlock(&ns->ns_lock);
rc = ldlm_cli_cancel_unused_resource(ns, res->lr_name,
flags, opaque);
-
if (rc)
CERROR("cancel_unused_res ("LPU64"): %d\n",
res->lr_name.name[0], rc);
+
+ l_lock(&ns->ns_lock);
+ next = tmp->next;
ldlm_resource_putref(res);
}
}
l_unlock(&ns->ns_lock);
+ if (flags & LDLM_FL_CONFIG_CHANGE)
+ l_wait_event(ns->ns_waitq, have_no_nsresource(ns), &lwi);
RETURN(ELDLM_OK);
}
spin_lock_init(&ns->ns_counter_lock);
ns->ns_locks = 0;
ns->ns_resources = 0;
+ init_waitqueue_head(&ns->ns_waitq);
for (bucket = ns->ns_hash + RES_HASH_SIZE - 1; bucket >= ns->ns_hash;
bucket--)
spin_lock(&ns->ns_counter_lock);
ns->ns_resources--;
+ if (ns->ns_resources == 0)
+ wake_up(&ns->ns_waitq);
spin_unlock(&ns->ns_counter_lock);
rc = 1;
exp = class_conn2export(&mdc_conn);
ctxt = exp->exp_obd->obd_llog_ctxt[LLOG_CONFIG_REPL_CTXT];
- rc = class_config_parse_llog(ctxt, g_zconf_profile, cfg);
- if (rc) {
- CERROR("class_config_parse_llog failed: rc = %d\n", rc);
- }
+ rc = class_config_process_llog(ctxt, g_zconf_profile, NULL, lcfg);
+ if (rc)
+ CERROR("class_config_process_llog failed: rc = %d\n", rc);
err = obd_disconnect(exp, 0);
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
- src->o_valid,
+ src->o_valid,
LTIME_S(lli->lli_st_mtime), LTIME_S(lli->lli_st_ctime),
(long)src->o_mtime, (long)src->o_ctime);
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n",
- valid, LTIME_S(lli->lli_st_mtime),
+ valid, LTIME_S(lli->lli_st_mtime),
LTIME_S(lli->lli_st_ctime));
if (valid & OBD_MD_FLATIME) {
if (rc)
RETURN(rc);
- refresh_valid = OBD_MD_FLBLOCKS | OBD_MD_FLBLKSZ | OBD_MD_FLMTIME |
+ refresh_valid = OBD_MD_FLBLOCKS | OBD_MD_FLBLKSZ | OBD_MD_FLMTIME |
OBD_MD_FLCTIME | OBD_MD_FLSIZE;
/* We set this flag in commit write as we extend the file size. When
if (test_bit(LLI_F_PREFER_EXTENDED_SIZE, &lli->lli_flags)) {
if (oa.o_size < lli->lli_st_size)
refresh_valid &= ~OBD_MD_FLSIZE;
- else
+ else
clear_bit(LLI_F_PREFER_EXTENDED_SIZE, &lli->lli_flags);
}
CERROR ("OBD_MD_LINKNAME not set on reply\n");
GOTO (failed, rc = -EPROTO);
}
-
+
LASSERT (symlen != 0);
if (body->eadatasize != symlen) {
CERROR ("inode %lu: symlink length %d not expected %d\n",
memset(&fd->fd_cwlockh, 0, sizeof(fd->fd_cwlockh));
RETURN(0);
-}
+}
static int llu_iop_ioctl(struct inode *ino, unsigned long int request,
va_list ap)
struct llu_inode_info *lli = llu_i2info(inode);
if (lli->lli_stale_flag ||
- lli->lli_st_generation != md->body->generation)
+ lli->lli_st_generation != md->body->generation) {
I_RELE(inode);
- else {
+ } else {
llu_update_inode(inode, md->body, md->lsm);
return inode;
}
inode = llu_new_inode(fs, &fid);
if (inode)
llu_update_inode(inode, md->body, md->lsm);
-
+
return inode;
}
/* generate a string unique to this super, let's try
the address of the super itself.*/
- len = (sizeof(sbi) * 2) + 1;
+ len = (sizeof(sbi) * 2) + 1;
OBD_ALLOC(sbi->ll_instance, len);
- if (sbi->ll_instance == NULL)
+ if (sbi->ll_instance == NULL)
GOTO(out_free, err = -ENOMEM);
sprintf(sbi->ll_instance, "%p", sbi);
CERROR("Unable to process log: %s\n", g_zconf_profile);
GOTO(out_free, err);
+
}
lprof = class_get_profile(g_zconf_profile);
}
if (osc)
OBD_FREE(osc, strlen(osc) + 1);
- OBD_ALLOC(osc, strlen(lprof->lp_osc) +
+ OBD_ALLOC(osc, strlen(lprof->lp_osc) +
strlen(sbi->ll_instance) + 2);
sprintf(osc, "%s-%s", lprof->lp_osc, sbi->ll_instance);
if (mdc)
OBD_FREE(mdc, strlen(mdc) + 1);
- OBD_ALLOC(mdc, strlen(lprof->lp_mdc) +
+ OBD_ALLOC(mdc, strlen(lprof->lp_mdc) +
strlen(sbi->ll_instance) + 2);
sprintf(mdc, "%s-%s", lprof->lp_mdc, sbi->ll_instance);
} else {
#include <linux/lustre_compat25.h>
#endif
#include "llite_internal.h"
+#include <linux/obd_lov.h>
int ll_mdc_close(struct obd_export *mdc_exp, struct inode *inode,
struct file *file)
if (!capable (CAP_SYS_ADMIN))
RETURN(-EPERM);
- rc = copy_from_user(&ucreatp, (struct ll_recreate_obj *)arg,
+ rc = copy_from_user(&ucreatp, (struct ll_recreate_obj *)arg,
sizeof(struct ll_recreate_obj));
if (rc) {
RETURN(-EFAULT);
RETURN(-ENOMEM);
}
- oa->o_id = ucreatp.lrc_id;
+ oa->o_id = ucreatp.lrc_id;
oa->o_nlink = ucreatp.lrc_ost_idx;
oa->o_gr = ucreatp.lrc_group;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLFLAGS;
unsigned long ll_read_ahead_pages;
unsigned long ll_max_read_ahead_pages;
+ int ll_config_version; /* last-applied update */
+
/* list of GNS mounts; protected by the dcache_lock */
struct list_head ll_mnt_list;
extern struct file_operations ll_file_operations;
extern struct inode_operations ll_file_inode_operations;
extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *);
+int ll_refresh_lsm(struct inode *inode, struct lov_stripe_md *lsm);
int ll_extent_lock(struct ll_file_data *, struct inode *,
struct lov_stripe_md *, int mode, ldlm_policy_data_t *,
struct lustre_handle *, int ast_flags);
int fhtype, int parent);
int ll_dentry_to_fh(struct dentry *, __u32 *datap, int *lenp, int need_parent);
int null_if_equal(struct ldlm_lock *lock, void *data);
+int ll_process_config_update(struct ll_sb_info *sbi, int clean);
/* llite/special.c */
extern struct inode_operations ll_special_inode_operations;
RETURN(err);
} /* ll_read_super */
-int lustre_process_log(struct lustre_mount_data *lmd, char * profile,
- struct config_llog_instance *cfg, int allow_recov)
+static int lustre_process_log(struct lustre_mount_data *lmd, char *profile,
+ struct config_llog_instance *cfg, int allow_recov)
{
struct lustre_cfg lcfg;
struct portals_cfg pcfg;
exp = class_conn2export(&mdc_conn);
- ctxt = llog_get_context(&exp->exp_obd->obd_llogs, LLOG_CONFIG_REPL_CTXT);
-#if 1
- rc = class_config_parse_llog(ctxt, profile, cfg);
-#else
- /*
- * For debugging, it's useful to just dump the log
- */
- rc = class_config_dump_llog(ctxt, profile, cfg);
-#endif
- if (rc) {
- CERROR("class_config_parse_llog failed: rc = %d\n", rc);
- }
+ ctxt = llog_get_context(&exp->exp_obd->obd_llogs,LLOG_CONFIG_REPL_CTXT);
+ rc = class_config_process_llog(ctxt, profile, cfg);
+ if (rc)
+ CERROR("class_config_process_llog failed: rc = %d\n", rc);
err = obd_disconnect(exp, 0);
err = lustre_process_log(lmd, lmd->lmd_profile, &cfg, 0);
if (err < 0) {
CERROR("Unable to process log: %s\n", lmd->lmd_profile);
-
GOTO(out_free, err);
}
int err;
if (sbi->ll_instance != NULL) {
+ struct lustre_mount_data *lmd = sbi->ll_lmd;
char * cln_prof;
struct config_llog_instance cfg;
cfg.cfg_uuid = sbi->ll_sb_uuid;
OBD_ALLOC(cln_prof, len);
- sprintf(cln_prof, "%s-clean", sbi->ll_lmd->lmd_profile);
+ sprintf(cln_prof, "%s-clean", lmd->lmd_profile);
- err = lustre_process_log(sbi->ll_lmd, cln_prof, &cfg,
- 0);
+ err = lustre_process_log(lmd, cln_prof, &cfg, 0);
if (err < 0)
CERROR("Unable to process log: %s\n", cln_prof);
OBD_FREE(cln_prof, len);
EXIT;
} /* lustre_put_super */
+int ll_process_config_update(struct ll_sb_info *sbi, int clean)
+{
+ struct obd_export *mdc_exp = sbi->ll_mdc_exp;
+ struct lustre_mount_data *lmd = sbi->ll_lmd;
+ struct llog_ctxt *ctxt;
+ struct config_llog_instance cfg;
+ char *profile = lmd->lmd_profile, *name = NULL;
+ int rc, namelen = 0, version;
+ ENTRY;
+
+ if (profile == NULL)
+ RETURN(0);
+ if (lmd == NULL) {
+ CERROR("Client not mounted with zero-conf; cannot process "
+ "update log.\n");
+ RETURN(0);
+ }
+
+ rc = ldlm_cli_cancel_unused(mdc_exp->exp_obd->obd_namespace, NULL,
+ LDLM_FL_CONFIG_CHANGE, NULL);
+ if (rc != 0)
+ CWARN("ldlm_cli_cancel_unused(mdc): %d\n", rc);
+
+ rc = obd_cancel_unused(sbi->ll_osc_exp, NULL, LDLM_FL_CONFIG_CHANGE,
+ NULL);
+ if (rc != 0)
+ CWARN("obd_cancel_unused(lov): %d\n", rc);
+
+ cfg.cfg_instance = sbi->ll_instance;
+ cfg.cfg_uuid = sbi->ll_sb_uuid;
+ cfg.cfg_local_nid = lmd->lmd_local_nid;
+
+ namelen = strlen(profile) + 20; /* -clean-######### */
+ OBD_ALLOC(name, namelen);
+ if (name == NULL)
+ RETURN(-ENOMEM);
+
+ if (clean) {
+ version = sbi->ll_config_version - 1;
+ sprintf(name, "%s-clean-%d", profile, version);
+ } else {
+ version = sbi->ll_config_version + 1;
+ sprintf(name, "%s-%d", profile, version);
+ }
+
+ CWARN("Applying configuration log %s\n", name);
+
+ ctxt = llog_get_context(&mdc_exp->exp_obd->obd_llogs,
+ LLOG_CONFIG_REPL_CTXT);
+ rc = class_config_process_llog(ctxt, name, &cfg);
+ if (rc == 0)
+ sbi->ll_config_version = version;
+ CWARN("Finished applying configuration log %s: %d\n", name, rc);
+
+ if (rc == 0 && clean == 0) {
+ struct lov_desc desc;
+ int rc, valsize;
+ valsize = sizeof(desc);
+ rc = obd_get_info(sbi->ll_osc_exp, strlen("lovdesc") + 1,
+ "lovdesc", &valsize, &desc);
+
+ rc = obd_init_ea_size(mdc_exp,
+ obd_size_diskmd(sbi->ll_osc_exp, NULL),
+ (desc.ld_tgt_count *
+ sizeof(struct llog_cookie)));
+ }
+ OBD_FREE(name, namelen);
+ RETURN(rc);
+}
struct inode *ll_inode_from_lock(struct ldlm_lock *lock)
{
if (lli->lli_maxbytes > PAGE_CACHE_MAXBYTES)
lli->lli_maxbytes = PAGE_CACHE_MAXBYTES;
} else {
+ int i;
if (memcmp(lli->lli_smd, lsm, sizeof(*lsm))) {
CERROR("lsm mismatch for inode %ld\n",
inode->i_ino);
dump_lsm(D_ERROR, lsm);
LBUG();
}
+ /* XXX FIXME -- We should decide on a safer (atomic) and
+ * more elegant way to update the lsm */
+ for (i = 0; i < lsm->lsm_stripe_count; i++) {
+ lli->lli_smd->lsm_oinfo[i].loi_id =
+ lsm->lsm_oinfo[i].loi_id;
+ lli->lli_smd->lsm_oinfo[i].loi_gr =
+ lsm->lsm_oinfo[i].loi_gr;
+ lli->lli_smd->lsm_oinfo[i].loi_ost_idx =
+ lsm->lsm_oinfo[i].loi_ost_idx;
+ lli->lli_smd->lsm_oinfo[i].loi_ost_gen =
+ lsm->lsm_oinfo[i].loi_ost_gen;
+ }
}
/* bug 2844 - limit i_blksize for broken user-space apps */
LASSERTF(lsm->lsm_xfersize != 0, "%lu\n", lsm->lsm_xfersize);
ENTRY;
if (1 != sscanf(buffer, "%d", &readahead))
- RETURN(-EINVAL);
+ RETURN(-EINVAL);
if (readahead)
sbi->ll_flags |= LL_SBI_READAHEAD;
RETURN(count);
}
-static int ll_rd_max_read_ahead_mb(char *page, char **start, off_t off,
+static int ll_wr_config_update(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct super_block *sb = (struct super_block*)data;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ ENTRY;
+
+ RETURN(ll_process_config_update(sbi, 0));
+}
+
+static int ll_rd_max_read_ahead_mb(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
struct super_block *sb = data;
{ "filesfree", ll_rd_filesfree, 0, 0 },
//{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
{ "read_ahead", ll_rd_read_ahead, ll_wr_read_ahead, 0 },
- { "max_read_ahead_mb", ll_rd_max_read_ahead_mb,
- ll_wr_max_read_ahead_mb, 0 },
+ { "config_update", 0, ll_wr_config_update, 0 },
+ { "max_read_ahead_mb", ll_rd_max_read_ahead_mb,
+ ll_wr_max_read_ahead_mb, 0 },
{ 0 }
};
int has_flags = 0;
struct page *page = llap->llap_page;
- seq_printf(seq, "%lu | %p %p | %p %p %lu [",
- sbi->ll_pglist_gen,
+ seq_printf(seq, "%lu | %p %p | %p %p %lu [",
+ sbi->ll_pglist_gen,
llap, llap->llap_cookie,
page, page->mapping->host, page->index);
seq_page_flag(seq, page, locked, has_flags);
seq_page_flag(seq, page, highmem, has_flags);
if (!has_flags)
seq_puts(seq, "-]\n");
- else
+ else
seq_puts(seq, "]\n");
}
return (void *)1;
}
-static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
+static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
loff_t *pos)
{
struct ll_async_page *llap, *dummy_llap = seq->private;
#define LAP_MAGIC 8200
+static inline int lov_tgt_changed(struct lov_obd *lov, struct lov_oinfo *loi)
+{
+ return lov->tgts[loi->loi_ost_idx].ltd_gen != loi->loi_ost_gen;
+}
+
struct lov_async_page {
int lap_magic;
int lap_stripe;
LASSERT(logcookies && numcookies >= lsm->lsm_stripe_count);
for (i = 0,loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++,loi++) {
- struct obd_device *child = lov->tgts[loi->loi_ost_idx].ltd_exp->exp_obd;
+ struct obd_device *child =
+ lov->tgts[loi->loi_ost_idx].ltd_exp->exp_obd;
struct llog_ctxt *cctxt;
cctxt = llog_get_context(&child->obd_llogs, ctxt->loc_idx);
+
lur->lur_oid = loi->loi_id;
lur->lur_ogen = loi->loi_gr;
LASSERT(lsm->lsm_object_gr == loi->loi_gr);
rc += llog_add(cctxt, &lur->lur_hdr, NULL, logcookies + rc,
- numcookies - rc, NULL);
-
+ numcookies - rc, NULL);
}
OBD_FREE(lur, sizeof(*lur));
}
static int lov_llog_origin_connect(struct llog_ctxt *ctxt, int count,
- struct llog_logid *logid,
- struct llog_gen *gen,
- struct obd_uuid *uuid)
+ struct llog_logid *logid,
+ struct llog_gen *gen, struct obd_uuid *uuid)
{
struct obd_device *obd = ctxt->loc_obd;
struct lov_obd *lov = &obd->u.lov;
+ struct lov_tgt_desc *tgt;
int i, rc = 0;
ENTRY;
LASSERT(lov->desc.ld_tgt_count == count);
- for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- struct obd_device *child = lov->tgts[i].ltd_exp->exp_obd;
+ for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, tgt++) {
+ struct obd_device *child;
struct llog_ctxt *cctxt;
+ if (!tgt->active)
+ continue;
+ child = tgt->ltd_exp->exp_obd;
+
cctxt = llog_get_context(&child->obd_llogs, ctxt->loc_idx);
if (uuid && !obd_uuid_equals(uuid, &lov->tgts[i].uuid))
continue;
loi = lsm->lsm_oinfo;
lov = &obd->u.lov;
for (i = 0; i < count; i++, cookies++, loi++) {
- struct obd_device *child = lov->tgts[loi->loi_ost_idx].ltd_exp->exp_obd;
+ struct obd_device *child =
+ lov->tgts[loi->loi_ost_idx].ltd_exp->exp_obd;
struct llog_ctxt *cctxt;
int err;
struct obd_device *tgt, int count, struct llog_catid *logid)
{
struct lov_obd *lov = &obd->u.lov;
+ struct lov_tgt_desc *ctgt;
int i, rc = 0;
ENTRY;
RETURN(rc);
LASSERT(lov->desc.ld_tgt_count == count);
- for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- struct obd_device *child = lov->tgts[i].ltd_exp->exp_obd;
+ for (i = 0, ctgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, ctgt++) {
+ struct obd_device *child;
+
+ if (!ctgt->active)
+ continue;
+ child = ctgt->ltd_exp->exp_obd;
rc = obd_llog_init(child, &child->obd_llogs, tgt, 1, logid + i);
if (rc) {
CERROR("error osc_llog_init %d\n", i);
int lov_llog_finish(struct obd_device *obd, struct obd_llogs *llogs, int count)
{
struct lov_obd *lov = &obd->u.lov;
+ struct lov_tgt_desc *tgt;
int i, rc = 0;
ENTRY;
-
+
rc = obd_llog_cleanup(llog_get_context(llogs, LLOG_UNLINK_ORIG_CTXT));
if (rc)
RETURN(rc);
if (rc)
RETURN(rc);
- LASSERT(lov->desc.ld_tgt_count == count);
- for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- struct obd_device *child = lov->tgts[i].ltd_exp->exp_obd;
+ if (lov->desc.ld_tgt_count != count) {
+ CERROR("LOV tgt count != passed tgt count (%d != %d)\n",
+ lov->desc.ld_tgt_count, count);
+ count = MIN(lov->desc.ld_tgt_count, count);
+ }
+ for (i = 0, tgt = lov->tgts; i < count; i++, tgt++) {
+ struct obd_device *child;
+
+ if (!tgt->active)
+ continue;
+ child = tgt->ltd_exp->exp_obd;
rc = obd_llog_finish(child, &child->obd_llogs, 1);
if (rc) {
- CERROR("error osc_llog_finish %d\n", i);
+ CERROR("osc_llog_finish error; index=%d; rc=%d\n",
+ i, rc);
break;
}
}
}
/* obd methods */
+#define MAX_STRING_SIZE 128
+static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
+ int activate)
+{
+ struct lov_obd *lov = &obd->u.lov;
+ struct obd_uuid *tgt_uuid = &tgt->uuid;
+ struct obd_device *tgt_obd;
+ struct obd_uuid lov_osc_uuid = { "LOV_OSC_UUID" };
+ struct lustre_handle conn = {0, };
+ struct proc_dir_entry *lov_proc_dir;
+ int rc;
+ ENTRY;
+
+ tgt_obd = class_find_client_obd(tgt_uuid, LUSTRE_OSC_NAME,
+ &obd->obd_uuid);
+
+ if (!tgt_obd) {
+ CERROR("Target %s not attached\n", tgt_uuid->uuid);
+ RETURN(-EINVAL);
+ }
+
+ if (!tgt_obd->obd_set_up) {
+ CERROR("Target %s not set up\n", tgt_uuid->uuid);
+ RETURN(-EINVAL);
+ }
+
+ if (activate) {
+ tgt_obd->obd_no_recov = 0;
+ ptlrpc_activate_import(tgt_obd->u.cli.cl_import);
+ }
+
+ if (tgt_obd->u.cli.cl_import->imp_invalid) {
+ CERROR("not connecting OSC %s; administratively "
+ "disabled\n", tgt_uuid->uuid);
+ rc = obd_register_observer(tgt_obd, obd);
+ if (rc) {
+ CERROR("Target %s register_observer error %d; "
+ "will not be able to reactivate\n",
+ tgt_uuid->uuid, rc);
+ }
+ RETURN(0);
+ }
+
+ rc = obd_connect(&conn, tgt_obd, &lov_osc_uuid);
+ if (rc) {
+ CERROR("Target %s connect error %d\n", tgt_uuid->uuid, rc);
+ RETURN(rc);
+ }
+ tgt->ltd_exp = class_conn2export(&conn);
+
+ rc = obd_register_observer(tgt_obd, obd);
+ if (rc) {
+ CERROR("Target %s register_observer error %d\n",
+ tgt_uuid->uuid, rc);
+ obd_disconnect(tgt->ltd_exp, 0);
+ tgt->ltd_exp = NULL;
+ RETURN(rc);
+ }
+
+ tgt->active = 1;
+ lov->desc.ld_active_tgt_count++;
+
+ lov_proc_dir = lprocfs_srch(obd->obd_proc_entry, "target_obds");
+ if (lov_proc_dir) {
+ struct obd_device *osc_obd = class_conn2obd(&conn);
+ struct proc_dir_entry *osc_symlink;
+ char name[MAX_STRING_SIZE + 1];
+
+ LASSERT(osc_obd != NULL);
+ LASSERT(osc_obd->obd_type != NULL);
+ LASSERT(osc_obd->obd_type->typ_name != NULL);
+ name[MAX_STRING_SIZE] = '\0';
+ snprintf(name, MAX_STRING_SIZE, "../../../%s/%s",
+ osc_obd->obd_type->typ_name,
+ osc_obd->obd_name);
+ osc_symlink = proc_symlink(osc_obd->obd_name, lov_proc_dir,
+ name);
+ if (osc_symlink == NULL) {
+ CERROR("could not register LOV target "
+ "/proc/fs/lustre/%s/%s/target_obds/%s.",
+ obd->obd_type->typ_name, obd->obd_name,
+ osc_obd->obd_name);
+ lprocfs_remove(lov_proc_dir);
+ lov_proc_dir = NULL;
+ }
+ }
+
+ RETURN(0);
+}
+
static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
struct obd_uuid *cluuid)
{
- struct ptlrpc_request *req = NULL;
struct lov_obd *lov = &obd->u.lov;
- struct lov_desc *desc = &lov->desc;
- struct lov_tgt_desc *tgts;
+ struct lov_tgt_desc *tgt;
struct obd_export *exp;
int rc, rc2, i;
ENTRY;
RETURN(0);
}
- for (i = 0, tgts = lov->tgts; i < desc->ld_tgt_count; i++, tgts++) {
- struct obd_uuid *tgt_uuid = &tgts->uuid;
- struct obd_device *tgt_obd;
- struct obd_uuid lov_osc_uuid = { "LOV_OSC_UUID" };
- struct lustre_handle conn = {0, };
-
- LASSERT( tgt_uuid != NULL);
-
- tgt_obd = class_find_client_obd(tgt_uuid, LUSTRE_OSC_NAME,
- &obd->obd_uuid);
-
- if (!tgt_obd) {
- CERROR("Target %s not attached\n", tgt_uuid->uuid);
- GOTO(out_disc, rc = -EINVAL);
- }
-
- if (!tgt_obd->obd_set_up) {
- CERROR("Target %s not set up\n", tgt_uuid->uuid);
- GOTO(out_disc, rc = -EINVAL);
- }
-
- if (tgt_obd->u.cli.cl_import->imp_invalid) {
- CERROR("not connecting OSC %s; administratively "
- "disabled\n", tgt_uuid->uuid);
- rc = obd_register_observer(tgt_obd, obd);
- if (rc) {
- CERROR("Target %s register_observer error %d; "
- "will not be able to reactivate\n",
- tgt_uuid->uuid, rc);
- }
+ for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, tgt++) {
+ if (obd_uuid_empty(&tgt->uuid))
continue;
- }
-
- rc = obd_connect(&conn, tgt_obd, &lov_osc_uuid);
- if (rc) {
- CERROR("Target %s connect error %d\n", tgt_uuid->uuid,
- rc);
- GOTO(out_disc, rc);
- }
- tgts->ltd_exp = class_conn2export(&conn);
-
- rc = obd_register_observer(tgt_obd, obd);
- if (rc) {
- CERROR("Target %s register_observer error %d\n",
- tgt_uuid->uuid, rc);
- obd_disconnect(tgts->ltd_exp, 0);
+ rc = lov_connect_obd(obd, tgt, 0);
+ if (rc)
GOTO(out_disc, rc);
- }
-
- desc->ld_active_tgt_count++;
- tgts->active = 1;
}
- ptlrpc_req_finished(req);
class_export_put(exp);
RETURN (0);
out_disc:
while (i-- > 0) {
struct obd_uuid uuid;
- --tgts;
- --desc->ld_active_tgt_count;
- tgts->active = 0;
+ --tgt;
+ --lov->desc.ld_active_tgt_count;
+ tgt->active = 0;
/* save for CERROR below; (we know it's terminated) */
- uuid = tgts->uuid;
- rc2 = obd_disconnect(tgts->ltd_exp, 0);
+ uuid = tgt->uuid;
+ rc2 = obd_disconnect(tgt->ltd_exp, 0);
if (rc2)
CERROR("error: LOV target %s disconnect on OST idx %d: "
"rc = %d\n", uuid.uuid, i, rc2);
RETURN (rc);
}
+static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
+ int flags)
+{
+ struct proc_dir_entry *lov_proc_dir;
+ struct obd_device *osc_obd = class_exp2obd(tgt->ltd_exp);
+ struct lov_obd *lov = &obd->u.lov;
+ int rc;
+ ENTRY;
+
+ lov_proc_dir = lprocfs_srch(obd->obd_proc_entry, "target_obds");
+ if (lov_proc_dir) {
+ struct proc_dir_entry *osc_symlink;
+
+ osc_symlink = lprocfs_srch(lov_proc_dir, osc_obd->obd_name);
+ if (osc_symlink) {
+ lprocfs_remove(osc_symlink);
+ } else {
+ CERROR("/proc/fs/lustre/%s/%s/target_obds/%s missing.",
+ obd->obd_type->typ_name, obd->obd_name,
+ osc_obd->obd_name);
+ }
+ }
+
+ if (obd->obd_no_recov) {
+ /* Pass it on to our clients.
+ * XXX This should be an argument to disconnect,
+ * XXX not a back-door flag on the OBD. Ah well.
+ */
+ if (osc_obd)
+ osc_obd->obd_no_recov = 1;
+ }
+
+ obd_register_observer(tgt->ltd_exp->exp_obd, NULL);
+
+ rc = obd_disconnect(tgt->ltd_exp, flags);
+ if (rc) {
+ if (tgt->active) {
+ CERROR("Target %s disconnect error %d\n",
+ tgt->uuid.uuid, rc);
+ }
+ rc = 0;
+ }
+
+ if (tgt->active) {
+ tgt->active = 0;
+ lov->desc.ld_active_tgt_count--;
+ }
+
+ tgt->ltd_exp = NULL;
+ RETURN(0);
+}
+
static int lov_disconnect(struct obd_export *exp, int flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct lov_obd *lov = &obd->u.lov;
+ struct lov_tgt_desc *tgt;
int rc, i;
ENTRY;
if (lov->refcount != 0)
goto out_local;
- for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- if (lov->tgts[i].ltd_exp == NULL)
- continue;
-
- if (obd->obd_no_recov) {
- /* Pass it on to our clients.
- * XXX This should be an argument to disconnect,
- * XXX not a back-door flag on the OBD. Ah well.
- */
- struct obd_device *osc_obd;
- osc_obd = class_exp2obd(lov->tgts[i].ltd_exp);
- if (osc_obd)
- osc_obd->obd_no_recov = 1;
- }
-
- obd_register_observer(lov->tgts[i].ltd_exp->exp_obd, NULL);
-
- rc = obd_disconnect(lov->tgts[i].ltd_exp, flags);
- if (rc) {
- if (lov->tgts[i].active) {
- CERROR("Target %s disconnect error %d\n",
- lov->tgts[i].uuid.uuid, rc);
- }
- rc = 0;
- }
- if (lov->tgts[i].active) {
- lov->desc.ld_active_tgt_count--;
- lov->tgts[i].active = 0;
- }
- lov->tgts[i].ltd_exp = NULL;
+ for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, tgt++) {
+ if (tgt->ltd_exp)
+ lov_disconnect_obd(obd, tgt, flags);
}
out_local:
struct lustre_cfg *lcfg = buf;
struct lov_desc *desc;
struct lov_obd *lov = &obd->u.lov;
- struct obd_uuid *uuids;
- struct lov_tgt_desc *tgts;
- int i;
int count;
ENTRY;
RETURN(-EINVAL);
}
- if (lcfg->lcfg_inllen2 < 1) {
- CERROR("LOV setup requires an OST UUID list\n");
- RETURN(-EINVAL);
- }
-
desc = (struct lov_desc *)lcfg->lcfg_inlbuf1;
if (sizeof(*desc) > lcfg->lcfg_inllen1) {
CERROR("descriptor size wrong: %d > %d\n",
RETURN(-EINVAL);
}
- count = desc->ld_tgt_count;
- uuids = (struct obd_uuid *)lcfg->lcfg_inlbuf2;
- if (sizeof(*uuids) * count != lcfg->lcfg_inllen2) {
- CERROR("UUID array size wrong: %u * %u != %u\n",
- (int)sizeof(*uuids), count, lcfg->lcfg_inllen2);
- RETURN(-EINVAL);
- }
-
/* Because of 64-bit divide/mod operations only work with a 32-bit
* divisor in a 32-bit kernel, we cannot support a stripe width
* of 4GB or larger on 32-bit CPUs.
*/
- if ((desc->ld_default_stripe_count ?
- desc->ld_default_stripe_count : desc->ld_tgt_count) *
- desc->ld_default_stripe_size > ~0UL) {
+
+ count = desc->ld_default_stripe_count;
+ if (count && (count * desc->ld_default_stripe_size) > ~0UL) {
CERROR("LOV: stripe width "LPU64"x%u > %lu on 32-bit system\n",
- desc->ld_default_stripe_size,
- desc->ld_default_stripe_count ?
- desc->ld_default_stripe_count : desc->ld_tgt_count,~0UL);
+ desc->ld_default_stripe_size, count, ~0UL);
RETURN(-EINVAL);
}
- lov->bufsize = sizeof(struct lov_tgt_desc) * count;
- OBD_ALLOC(lov->tgts, lov->bufsize);
- if (lov->tgts == NULL) {
- CERROR("Out of memory\n");
- RETURN(-EINVAL);
+ if (desc->ld_tgt_count) {
+ lov->bufsize = desc->ld_tgt_count * sizeof(struct lov_tgt_desc);
+ OBD_ALLOC(lov->tgts, lov->bufsize);
+ if (lov->tgts == NULL) {
+ lov->bufsize = 0;
+ CERROR("couldn't allocate %d bytes for target table.\n",
+ lov->bufsize);
+ RETURN(-EINVAL);
+ }
+ desc->ld_tgt_count = 0;
}
+ desc->ld_active_tgt_count = 0;
+ CDEBUG(D_CONFIG, "tgts: %p bufsize: 0x%x\n", lov->tgts, lov->bufsize);
lov->desc = *desc;
spin_lock_init(&lov->lov_lock);
- for (i = 0, tgts = lov->tgts; i < desc->ld_tgt_count; i++, tgts++) {
- struct obd_uuid *uuid = &tgts->uuid;
-
- /* NULL termination already checked */
- *uuid = uuids[i];
- }
-
RETURN(0);
}
RETURN(0);
}
+static int
+lov_add_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen)
+{
+ struct lov_obd *lov = &obd->u.lov;
+ struct lov_tgt_desc *tgt;
+ struct obd_export *exp_observer;
+ __u32 bufsize;
+ __u32 size = 2;
+ obd_id params[2];
+ char name[32] = "CATLIST";
+ int rc, old_count;
+ ENTRY;
+
+ CDEBUG(D_CONFIG, "uuid: %s idx: %d gen: %d\n",
+ uuidp->uuid, index, gen);
+
+ if (index < 0) {
+ CERROR("request to add OBD %s at invalid index: %d\n",
+ uuidp->uuid, index);
+ RETURN(-EINVAL);
+ }
+
+ if (gen <= 0) {
+ CERROR("request to add OBD %s with invalid generation: %d\n",
+ uuidp->uuid, gen);
+ RETURN(-EINVAL);
+ }
+
+ bufsize = sizeof(struct lov_tgt_desc) * (index + 1);
+ if (bufsize > lov->bufsize) {
+ OBD_ALLOC(tgt, bufsize);
+ if (tgt == NULL) {
+ CERROR("couldn't allocate %d bytes for new table.\n",
+ bufsize);
+ RETURN(-ENOMEM);
+ }
+
+ memset(tgt, 0, bufsize);
+ if (lov->tgts) {
+ memcpy(tgt, lov->tgts, lov->bufsize);
+ OBD_FREE(lov->tgts, lov->bufsize);
+ }
+
+ lov->tgts = tgt;
+ lov->bufsize = bufsize;
+ CDEBUG(D_CONFIG, "tgts: %p bufsize: %d\n",
+ lov->tgts, lov->bufsize);
+ }
+
+ tgt = lov->tgts + index;
+ if (!obd_uuid_empty(&tgt->uuid)) {
+ CERROR("OBD already assigned at LOV target index %d\n",
+ index);
+ RETURN(-EEXIST);
+ }
+
+ tgt->uuid = *uuidp;
+ /* XXX - add a sanity check on the generation number. */
+ tgt->ltd_gen = gen;
+
+ old_count = lov->desc.ld_tgt_count;
+ if (index >= lov->desc.ld_tgt_count)
+ lov->desc.ld_tgt_count = index + 1;
+
+ CDEBUG(D_CONFIG, "idx: %d ltd_gen: %d ld_tgt_count: %d\n",
+ index, tgt->ltd_gen, lov->desc.ld_tgt_count);
+
+ if (lov->refcount == 0)
+ RETURN(0);
+
+ if (tgt->ltd_exp) {
+ struct obd_device *osc_obd;
+
+ osc_obd = class_exp2obd(tgt->ltd_exp);
+ if (osc_obd)
+ osc_obd->obd_no_recov = 0;
+ }
+
+ rc = lov_connect_obd(obd, tgt, 1);
+ if (rc || !obd->obd_observer)
+ RETURN(rc);
+
+ /* tell the mds_lov about the new target */
+ obd_llog_finish(obd->obd_observer, &obd->obd_observer->obd_llogs,
+ old_count);
+ obd_llog_cat_initialize(obd->obd_observer,
+ &obd->obd_observer->obd_llogs,
+ lov->desc.ld_tgt_count, name);
+
+ params[0] = index;
+ rc = obd_get_info(tgt->ltd_exp, strlen("last_id"), "last_id", &size,
+ ¶ms[1]);
+ if (rc)
+ GOTO(out, rc);
+
+ exp_observer = obd->obd_observer->obd_self_export;
+ rc = obd_set_info(exp_observer, strlen("next_id"),"next_id", 2, params);
+ if (rc)
+ GOTO(out, rc);
+
+ rc = lov_notify(obd, tgt->ltd_exp->exp_obd, 1);
+ GOTO(out, rc);
+ out:
+ if (rc && tgt->ltd_exp != NULL)
+ lov_disconnect_obd(obd, tgt, 0);
+ return rc;
+}
+
+static int
+lov_del_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen)
+{
+ struct lov_obd *lov = &obd->u.lov;
+ struct lov_tgt_desc *tgt;
+ int count = lov->desc.ld_tgt_count;
+ int rc = 0;
+ ENTRY;
+
+ CDEBUG(D_CONFIG, "uuid: %s idx: %d gen: %d\n",
+ uuidp->uuid, index, gen);
+
+ if (index >= count) {
+ CERROR("LOV target index %d >= number of LOV OBDs %d.\n",
+ index, count);
+ RETURN(-EINVAL);
+ }
+
+ tgt = lov->tgts + index;
+
+ if (obd_uuid_empty(&tgt->uuid)) {
+ CERROR("LOV target at index %d is not setup.\n", index);
+ RETURN(-EINVAL);
+ }
+
+ if (strncmp(uuidp->uuid, tgt->uuid.uuid, sizeof uuidp->uuid) != 0) {
+ CERROR("LOV target UUID %s at index %d doesn't match %s.\n",
+ tgt->uuid.uuid, index, uuidp->uuid);
+ RETURN(-EINVAL);
+ }
+
+ if (tgt->ltd_exp) {
+ struct obd_device *osc_obd;
+
+ osc_obd = class_exp2obd(tgt->ltd_exp);
+ if (osc_obd) {
+ osc_obd->obd_no_recov = 1;
+ rc = obd_llog_finish(osc_obd, &osc_obd->obd_llogs, 1);
+ if (rc)
+ CERROR("osc_llog_finish error: %d\n", rc);
+ }
+ lov_disconnect_obd(obd, tgt, 0);
+ }
+
+ /* XXX - right now there is a dependency on ld_tgt_count being the
+ * maximum tgt index for computing the mds_max_easize. So we can't
+ * shrink it. */
+
+ /* lt_gen = 0 will mean it will not match the gen of any valid loi */
+ memset(tgt, 0, sizeof(*tgt));
+
+ CDEBUG(D_CONFIG, "uuid: %s idx: %d gen: %d exp: %p active: %d\n",
+ tgt->uuid.uuid, index, tgt->ltd_gen, tgt->ltd_exp, tgt->active);
+
+ RETURN(rc);
+}
+
+static int lov_process_config(struct obd_device *obd, obd_count len, void *buf)
+{
+ struct lustre_cfg *lcfg = buf;
+ struct obd_uuid obd_uuid;
+ int cmd;
+ int index;
+ int gen;
+ int rc = 0;
+ ENTRY;
+
+ switch(cmd = lcfg->lcfg_command) {
+ case LCFG_LOV_ADD_OBD:
+ case LCFG_LOV_DEL_OBD: {
+ if (lcfg->lcfg_inllen1 > sizeof(obd_uuid.uuid))
+ GOTO(out, rc = -EINVAL);
+
+ obd_str2uuid(&obd_uuid, lcfg->lcfg_inlbuf1);
+
+ if (sscanf(lcfg->lcfg_inlbuf2, "%d", &index) != 1)
+ GOTO(out, rc = -EINVAL);
+ if (sscanf(lcfg->lcfg_inlbuf3, "%d", &gen) != 1)
+ GOTO(out, rc = -EINVAL);
+ if (cmd == LCFG_LOV_ADD_OBD)
+ rc = lov_add_obd(obd, &obd_uuid, index, gen);
+ else
+ rc = lov_del_obd(obd, &obd_uuid, index, gen);
+ GOTO(out, rc);
+ }
+ default: {
+ CERROR("Unknown command: %d\n", lcfg->lcfg_command);
+ GOTO(out, rc = -EINVAL);
+
+ }
+ }
+out:
+ RETURN(rc);
+}
+
/* compute object size given "stripeno" and the ost size */
static obd_size lov_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size,
int stripeno)
++ost_start_idx;
if (lov->tgts[ost_idx].active == 0) {
- CDEBUG(D_HA, "lov idx %d inactive\n", ost_idx);
+ if (!obd_uuid_empty(&lov->tgts[ost_idx].uuid))
+ CDEBUG(D_HA, "lov idx %d inactive\n", ost_idx);
continue;
}
loi->loi_id = tmp_oa->o_id;
loi->loi_gr = tmp_oa->o_gr;
loi->loi_ost_idx = ost_idx;
- CDEBUG(D_INODE,
- "objid "LPX64" has subobj "LPX64"/"LPX64" at idx %d\n",
- lsm->lsm_object_id, loi->loi_id, loi->loi_id, ost_idx);
+ loi->loi_ost_gen = lov->tgts[ost_idx].ltd_gen;
+ CDEBUG(D_INODE, "objid "LPX64" has subobj "LPX64" at "
+ "idx %d gen %d\n", lsm->lsm_object_id, loi->loi_id,
+ ost_idx, loi->loi_ost_gen);
lov_merge_attrs(ret_oa, tmp_oa, tmp_oa->o_valid, lsm,
obj_alloc, &set);
goto out_tmp;
}
+static int lov_revalidate_policy(struct lov_obd *lov, struct lov_stripe_md *lsm)
+{
+ static int last_idx = 0;
+ struct lov_tgt_desc *tgt;
+ int i, count;
+
+ /* XXX - we should do something clever and take lsm
+ * into account but just do round robin for now. */
+
+ /* last_idx must always be less that count because
+ * ld_tgt_count currently cannot shrink. */
+ count = lov->desc.ld_tgt_count;
+
+ for (i = last_idx, tgt = lov->tgts + i; i < count; i++, tgt++)
+ if (tgt->active)
+ RETURN(last_idx = i);
+
+ for (i = 0, tgt = lov->tgts; i < last_idx; i++, tgt++)
+ if (tgt->active)
+ RETURN(last_idx = i);
+
+ RETURN(-EIO);
+}
+
#define lsm_bad_magic(LSMP) \
({ \
struct lov_stripe_md *_lsm__ = (LSMP); \
RETURN(-ENODEV);
lov = &exp->exp_obd->u.lov;
- for (i = 0,loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++,loi++) {
+ loi = lsm->lsm_oinfo;
+ for (i = 0; i < lsm->lsm_stripe_count; i++, loi++) {
int err;
+
if (lov->tgts[loi->loi_ost_idx].active == 0) {
CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
/* Orphan clean up will (someday) fix this up. */
if (rc == 0) {
/* NB all stripe requests succeeded to get here */
- for (i = 0, loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count;
- i++, loi++) {
+ loi = lsm->lsm_oinfo;
+ for (i = 0; i < lsm->lsm_stripe_count; i++, loi++) {
if (obdos[i].o_valid == 0) /* inactive stripe */
continue;
continue;
}
- CDEBUG(D_INFO, "objid "LPX64"[%d] has subobj "LPX64" at idx "
- "%u\n", oa->o_id, i, loi->loi_id, loi->loi_ost_idx);
+ CDEBUG(D_INFO, "objid "LPX64"[%d] has subobj "LPX64" at "
+ "idx %u gen %d\n", oa->o_id, i, loi->loi_id,
+ loi->loi_ost_idx, loi->loi_ost_gen);
+
/* create data objects with "parent" OA */
memcpy(&obdos[i], oa, sizeof(obdos[i]));
obdos[i].o_id = loi->loi_id;
unsigned long swidth = ssize * lsm->lsm_stripe_count;
unsigned long stripe_off;
+ if (lsm->lsm_pattern == LOV_PATTERN_CMOBD)
+ return 0;
+
stripe_off = do_div(lov_off, swidth);
return stripe_off / ssize;
}
+static int lov_revalidate_md(struct obd_export *exp, struct obdo *src_oa,
+ struct lov_stripe_md *ea,
+ struct obd_trans_info *oti)
+{
+ struct obd_export *osc_exp;
+ struct lov_obd *lov = &exp->exp_obd->u.lov;
+ struct lov_stripe_md *lsm = ea;
+ struct lov_stripe_md obj_md;
+ struct lov_stripe_md *obj_mdp = &obj_md;
+ struct lov_oinfo *loi;
+ struct obdo *tmp_oa;
+ int ost_idx, updates = 0, i;
+ ENTRY;
+
+ tmp_oa = obdo_alloc();
+ if (tmp_oa == NULL)
+ RETURN(-ENOMEM);
+
+ loi = lsm->lsm_oinfo;
+ for (i = 0; i < lsm->lsm_stripe_count; i++, loi++) {
+ int rc;
+ if (!obd_uuid_empty(&lov->tgts[loi->loi_ost_idx].uuid))
+ continue;
+
+ ost_idx = lov_revalidate_policy(lov, lsm);
+ if (ost_idx < 0) {
+ /* FIXME: punt for now. */
+ CERROR("lov_revalidate_policy failed; no active "
+ "OSCs?\n");
+ continue;
+ }
+
+ /* create a new object */
+ memcpy(tmp_oa, src_oa, sizeof(*tmp_oa));
+ /* XXX: LOV STACKING: use real "obj_mdp" sub-data */
+ osc_exp = lov->tgts[ost_idx].ltd_exp;
+ rc = obd_create(osc_exp, tmp_oa, &obj_mdp, oti);
+ if (rc) {
+ CERROR("error creating new subobj at idx %d; "
+ "rc = %d\n", ost_idx, rc);
+ continue;
+ }
+ if (oti->oti_objid)
+ oti->oti_objid[ost_idx] = tmp_oa->o_id;
+ loi->loi_id = tmp_oa->o_id;
+ loi->loi_ost_idx = ost_idx;
+ loi->loi_ost_gen = lov->tgts[ost_idx].ltd_gen;
+ CDEBUG(D_INODE, "replacing objid "LPX64" subobj "LPX64
+ " with idx %d gen %d.\n", lsm->lsm_object_id,
+ loi->loi_id, ost_idx, loi->loi_ost_gen);
+ updates = 1;
+ }
+
+ /* If we got an error revalidating an entry there's no need to
+ * cleanup up objects we allocated here because the bad entry
+ * still points to a deleted OST. */
+
+ obdo_free(tmp_oa);
+ RETURN(updates);
+}
+
/* FIXME: maybe we'll just make one node the authoritative attribute node, then
* we can send this 'punch' to just the authoritative node and the nodes
* that the punch will affect. */
obd_count oa_bufs, struct brw_page *pga)
{
int i, rc = 0;
+ ENTRY;
/* The caller just wants to know if there's a chance that this
* I/O can succeed */
if (lov->tgts[ost].active == 0) {
CDEBUG(D_HA, "lov idx %d inactive\n", ost);
- return -EIO;
+ RETURN(-EIO);
}
- rc = obd_brw(OBD_BRW_CHECK, lov->tgts[stripe].ltd_exp, oa,
+ rc = obd_brw(OBD_BRW_CHECK, lov->tgts[ost].ltd_exp, oa,
NULL, 1, &pga[i], NULL);
if (rc)
break;
}
- return rc;
+ RETURN(rc);
}
static int lov_brw(int cmd, struct obd_export *exp, struct obdo *src_oa,
.ap_completion = lov_ap_completion,
};
-int lov_prep_async_page(struct obd_export *exp, struct lov_stripe_md *lsm,
- struct lov_oinfo *loi, struct page *page,
- obd_off offset, struct obd_async_page_ops *ops,
- void *data, void **res)
+static int lov_prep_async_page(struct obd_export *exp,
+ struct lov_stripe_md *lsm,
+ struct lov_oinfo *loi, struct page *page,
+ obd_off offset, struct obd_async_page_ops *ops,
+ void *data, void **res)
{
struct lov_obd *lov = &exp->exp_obd->u.lov;
struct lov_async_page *lap;
- int rc;
+ int rc, stripe;
ENTRY;
if (lsm_bad_magic(lsm))
RETURN(-EINVAL);
LASSERT(loi == NULL);
+ stripe = lov_stripe_number(lsm, offset);
+ loi = &lsm->lsm_oinfo[stripe];
+
+ if (obd_uuid_empty(&lov->tgts[loi->loi_ost_idx].uuid))
+ RETURN(-EIO);
+ if (lov->tgts[loi->loi_ost_idx].active == 0)
+ RETURN(-EIO);
+ if (lov->tgts[loi->loi_ost_idx].ltd_exp == NULL) {
+ CERROR("ltd_exp == NULL, but OST idx %d doesn't appear to be "
+ "deleted or inactive.\n", loi->loi_ost_idx);
+ RETURN(-EIO);
+ }
+
OBD_ALLOC(lap, sizeof(*lap));
if (lap == NULL)
RETURN(-ENOMEM);
lap->lap_caller_data = data;
/* FIXME handle multiple oscs after landing b_raid1 */
+ lap->lap_stripe = stripe;
switch (lsm->lsm_pattern) {
case LOV_PATTERN_RAID0:
- lap->lap_stripe = lov_stripe_number(lsm, offset);
lov_stripe_offset(lsm, offset, lap->lap_stripe,
&lap->lap_sub_offset);
break;
case LOV_PATTERN_CMOBD:
- lap->lap_stripe = 0;
lap->lap_sub_offset = offset;
break;
default:
LBUG();
}
- loi = &lsm->lsm_oinfo[lap->lap_stripe];
/* so the callback doesn't need the lsm */
lap->lap_loi_id = loi->loi_id;
RETURN(PTR_ERR(lap));
loi = &lsm->lsm_oinfo[lap->lap_stripe];
+
rc = obd_queue_async_io(lov->tgts[loi->loi_ost_idx].ltd_exp, lsm,
loi, lap->lap_sub_cookie, cmd, off, count,
brw_flags, async_flags);
RETURN(PTR_ERR(lap));
loi = &lsm->lsm_oinfo[lap->lap_stripe];
+
rc = obd_set_async_flags(lov->tgts[loi->loi_ost_idx].ltd_exp,
lsm, loi, lap->lap_sub_cookie, async_flags);
RETURN(rc);
RETURN(PTR_ERR(lap));
loi = &lsm->lsm_oinfo[lap->lap_stripe];
+
rc = obd_queue_group_io(lov->tgts[loi->loi_ost_idx].ltd_exp, lsm, loi,
oig, lap->lap_sub_cookie, cmd, off, count,
brw_flags, async_flags);
if (lsm_bad_magic(lsm))
RETURN(-EINVAL);
- for (i = 0, loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count;
- i++, loi++) {
+ loi = lsm->lsm_oinfo;
+ for (i = 0; i < lsm->lsm_stripe_count; i++, loi++) {
+ if (lov->tgts[loi->loi_ost_idx].active == 0) {
+ CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
+ continue;
+ }
+
err = obd_trigger_group_io(lov->tgts[loi->loi_ost_idx].ltd_exp,
lsm, loi, oig);
if (rc == 0 && err != 0)
RETURN(PTR_ERR(lap));
loi = &lsm->lsm_oinfo[lap->lap_stripe];
+
rc = obd_teardown_async_page(lov->tgts[loi->loi_ost_idx].ltd_exp,
lsm, loi, lap->lap_sub_cookie);
if (rc) {
sub_ext.l_extent.start = start;
sub_ext.l_extent.end = end;
+ if (obd_uuid_empty(&lov->tgts[loi->loi_ost_idx].uuid)) {
+ CDEBUG(D_HA, "lov idx %d deleted\n", loi->loi_ost_idx);
+ continue;
+ }
if (lov->tgts[loi->loi_ost_idx].active == 0) {
CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
rc = -EIO;
lov = &exp->exp_obd->u.lov;
for (i = 0,loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++,loi++) {
struct lov_stripe_md submd;
- if (lov->tgts[loi->loi_ost_idx].active == 0)
+ if (lov->tgts[loi->loi_ost_idx].active == 0) {
CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
+ continue;
+ }
submd.lsm_object_id = loi->loi_id;
submd.lsm_object_gr = lsm->lsm_object_gr;
int rc = 0, i;
ENTRY;
+ lov = &exp->exp_obd->u.lov;
+ if (lsm == NULL) {
+ for (i = 0; i < lov->desc.ld_tgt_count; i++) {
+ int err = obd_cancel_unused(lov->tgts[i].ltd_exp, NULL,
+ flags, opaque);
+ if (!rc)
+ rc = err;
+ }
+ RETURN(rc);
+ }
+
if (lsm_bad_magic(lsm))
RETURN(-EINVAL);
LASSERT(lsm->lsm_object_gr > 0);
- lov = &exp->exp_obd->u.lov;
for (i = 0,loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++,loi++) {
struct lov_stripe_md submd;
int err;
/* We only get block data from the OBD */
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
int err;
-
if (!lov->tgts[i].active) {
CDEBUG(D_HA, "lov idx %d inactive\n", i);
continue;
{
struct obd_device *obddev = class_exp2obd(exp);
struct lov_obd *lov = &obddev->u.lov;
- int i, count = lov->desc.ld_tgt_count;
+ int i, rc, count = lov->desc.ld_tgt_count;
struct obd_uuid *uuidp;
- int rc;
-
ENTRY;
switch (cmd) {
struct lov_tgt_desc *tgtdesc;
struct lov_desc *desc;
char *buf = NULL;
+ __u32 *genp;
buf = NULL;
len = 0;
RETURN(-EINVAL);
}
+ if (sizeof(__u32) * count > data->ioc_inllen3) {
+ OBD_FREE(buf, len);
+ RETURN(-EINVAL);
+ }
+
desc = (struct lov_desc *)data->ioc_inlbuf1;
memcpy(desc, &(lov->desc), sizeof(*desc));
uuidp = (struct obd_uuid *)data->ioc_inlbuf2;
+ genp = (__u32 *)data->ioc_inlbuf3;
tgtdesc = lov->tgts;
- for (i = 0; i < count; i++, uuidp++, tgtdesc++)
+ /* the uuid will be empty for deleted OSTs */
+ for (i = 0; i < count; i++, uuidp++, genp++, tgtdesc++) {
obd_str2uuid(uuidp, tgtdesc->uuid.uuid);
+ *genp = tgtdesc->ltd_gen;
+ }
rc = copy_to_user((void *)uarg, buf, len);
if (rc)
for (i = 0; i < count; i++) {
int err;
+ /* OST was deleted */
+ if (obd_uuid_empty(&lov->tgts[i].uuid))
+ continue;
+
err = obd_iocontrol(cmd, lov->tgts[i].ltd_exp,
len, karg, uarg);
if (err) {
/* XXX This is another one of those bits that will need to
* change if we ever actually support nested LOVs. It uses
* the lock's export to find out which stripe it is. */
+ /* XXX - it's assumed all the locks for deleted OSTs have
+ * been cancelled. Also, the export for deleted OSTs will
+ * be NULL and won't match the lock's export. */
for (i = 0, loi = data->lsm->lsm_oinfo;
i < data->lsm->lsm_stripe_count;
i++, loi++) {
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
int er;
+ /* OST was deleted */
+ if (obd_uuid_empty(&lov->tgts[i].uuid))
+ continue;
+
/* initialize all OSCs, even inactive ones */
er = obd_set_info(lov->tgts[i].ltd_exp, keylen, key,
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
int er;
+ /* OST was deleted */
+ if (obd_uuid_empty(&lov->tgts[i].uuid))
+ continue;
+
if (!val && !lov->tgts[i].active)
continue;
.o_detach = lov_detach,
.o_setup = lov_setup,
.o_cleanup = lov_cleanup,
+ o_process_config: lov_process_config,
.o_connect = lov_connect,
.o_disconnect = lov_disconnect,
.o_statfs = lov_statfs,
.o_packmd = lov_packmd,
.o_unpackmd = lov_unpackmd,
+ o_revalidate_md: lov_revalidate_md,
.o_create = lov_create,
.o_destroy = lov_destroy,
.o_getattr = lov_getattr,
{
struct lprocfs_static_vars lvars;
int rc;
+ ENTRY;
lprocfs_init_vars(lov, &lvars);
rc = class_register_type(&lov_obd_ops, NULL, lvars.module_vars,
loi->loi_gr = le64_to_cpu(lmm->lmm_objects[i].l_object_gr);
loi->loi_ost_idx = le32_to_cpu(lmm->lmm_objects[i].l_ost_idx);
loi->loi_ost_gen = le32_to_cpu(lmm->lmm_objects[i].l_ost_gen);
- if (loi->loi_ost_idx > lov->desc.ld_tgt_count) {
+ if (loi->loi_ost_idx >= lov->desc.ld_tgt_count) {
CERROR("OST index %d more than OST count %d\n",
loi->loi_ost_idx, lov->desc.ld_tgt_count);
lov_dump_lmm_v1(D_WARNING, lmm);
/* process records in buffer, starting where we found one */
while ((void *)rec < buf + LLOG_CHUNK_SIZE) {
if (rec->lrh_index == 0)
- GOTO(out, 0); /* no more records */
+ GOTO(out, rc = 0); /* no more records */
/* if set, process the callback on this record */
if (ext2_test_bit(index, llh->llh_bitmap)) {
llh->llh_tail.lrt_index = cpu_to_le32(index);
}
- rc = llog_create(cathandle->lgh_ctxt, &loghandle, NULL, NULL);
+ rc = llog_open(cathandle->lgh_ctxt, &loghandle, NULL, NULL,
+ OBD_LLOG_FL_CREATE);
if (rc) {
CERROR("cannot create new log, error = %d\n", rc);
RETURN(ERR_PTR(rc));
}
}
- rc = llog_create(cathandle->lgh_ctxt, &loghandle, logid, NULL);
+ rc = llog_open(cathandle->lgh_ctxt, &loghandle, logid, NULL, 0);
if (rc) {
CERROR("error opening log id "LPX64":%x: rc %d\n",
logid->lgl_oid, logid->lgl_ogen, rc);
RETURN(rc);
}
if (catid.lci_logid.lgl_oid)
- rc = llog_create(ctxt, &handle, &catid.lci_logid, 0);
+ rc = llog_open(ctxt, &handle, &catid.lci_logid, NULL,
+ OBD_LLOG_FL_CREATE);
else {
- rc = llog_create(ctxt, &handle, NULL, NULL);
+ rc = llog_open(ctxt, &handle, NULL, NULL, OBD_LLOG_FL_CREATE);
if (!rc)
catid.lci_logid = handle->lgh_id;
}
struct llog_log_hdr *llh;
int rc, index;
ENTRY;
-
+
if (!ctxt)
return 0;
LASSERT(rc == 0);
index = loghandle->u.phd.phd_cookie.lgc_index;
llog_free_handle(loghandle);
-
+
LASSERT(index);
llog_cat_set_first_idx(cathandle, index);
rc = llog_cancel_rec(cathandle, index);
struct llog_handle *loghandle;
struct llog_logid *lgl = &cookie->lgc_lgl;
int rc;
-
+
down_read(&handle->lgh_lock);
rc = llog_cat_id2handle(handle, &loghandle, lgl);
if (rc)
loff_t saved_offset;
/* no header: only allowed to insert record 1 */
- if (idx != 1 && !file->f_dentry->d_inode->i_size) {
+ if (idx > 1 && !file->f_dentry->d_inode->i_size) {
CERROR("idx != -1 in empty log\n");
LBUG();
}
if (rc)
RETURN(rc);
+ CDEBUG(D_HA, "adding record "LPX64": idx: %u, %u bytes off: %lld\n",
+ loghandle->lgh_id.lgl_oid, index, le32_to_cpu(rec->lrh_len),
+ file->f_pos);
+
rc = llog_lvfs_write_blob(ctxt, file, rec, buf, file->f_pos);
if (rc)
RETURN(rc);
- CDEBUG(D_HA, "added record "LPX64": idx: %u, %u bytes\n",
- loghandle->lgh_id.lgl_oid, index, le32_to_cpu(rec->lrh_len));
if (rc == 0 && reccookie) {
reccookie->lgc_lgl = loghandle->lgh_id;
reccookie->lgc_index = index;
int len)
{
struct llog_ctxt *ctxt = loghandle->lgh_ctxt;
- int rc;
ENTRY;
if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
struct llog_rec_hdr *rec;
struct llog_rec_tail *tail;
loff_t ppos;
+ int nbytes, rc;
llog_skip_over(curr_offset, *curr_idx, next_idx);
RETURN(rc);
}
- /* put number of bytes read into rc to make code simpler */
- rc = ppos - *curr_offset;
+ nbytes = ppos - *curr_offset;
*curr_offset = ppos;
- if (rc == 0) /* end of file, nothing to do */
+ if (nbytes == 0) /* end of file, nothing to do */
RETURN(0);
- if (rc < sizeof(*tail)) {
+ if (nbytes < sizeof(*tail)) {
CERROR("Invalid llog block at log id "LPU64"/%u offset "
LPU64"\n", loghandle->lgh_id.lgl_oid,
loghandle->lgh_id.lgl_ogen, *curr_offset);
RETURN(-EINVAL);
}
- tail = buf + rc - sizeof(struct llog_rec_tail);
+ tail = buf + nbytes - sizeof(struct llog_rec_tail);
*curr_idx = le32_to_cpu(tail->lrt_index);
/* this shouldn't happen */
} else {
filp = l_filp_open(logname, flags, mode);
if (IS_ERR(filp)) {
- CERROR("logfile creation %s: %ld\n", logname,
+ CERROR("logfile %s(%s): %ld\n",
+ flags & O_CREAT ? "create" : "open", logname,
PTR_ERR(filp));
}
}
RETURN(rc);
}
-static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+static int llog_lvfs_open(struct llog_ctxt *ctxt, struct llog_handle **res,
+ struct llog_logid *logid, char *name, int flags)
{
struct llog_handle *handle;
struct lvfs_run_ctxt saved;
int rc = 0;
- int open_flags = O_RDWR | O_CREAT | O_LARGEFILE;
+ int open_flags = O_RDWR | O_LARGEFILE;
ENTRY;
-
+
+ if (flags & OBD_LLOG_FL_CREATE)
+ open_flags |= O_CREAT;
+
handle = llog_alloc_handle();
if (handle == NULL)
RETURN(-ENOMEM);
EXPORT_SYMBOL(llog_put_cat_list);
struct llog_operations llog_lvfs_ops = {
- lop_create: llog_lvfs_create,
+ lop_open: llog_lvfs_open,
lop_destroy: llog_lvfs_destroy,
lop_close: llog_lvfs_close,
lop_read_header: llog_lvfs_read_header,
return 0;
}
-static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+static int llog_lvfs_open(struct llog_ctxt *ctxt, struct llog_handle **res,
+ struct llog_logid *logid, char *name, int flags)
{
LBUG();
return 0;
}
struct llog_operations llog_lvfs_ops = {
- lop_create: llog_lvfs_create,
+ lop_open: llog_lvfs_open,
lop_destroy: llog_lvfs_destroy,
lop_close: llog_lvfs_close,
lop_read_header: llog_lvfs_read_header,
case OBD_IOC_PARSE: {
ctxt = llog_get_context(&exp->exp_obd->obd_llogs,
LLOG_CONFIG_REPL_CTXT);
- rc = class_config_parse_llog(ctxt, data->ioc_inlbuf1, NULL);
+ rc = class_config_process_llog(ctxt, data->ioc_inlbuf1, NULL);
GOTO(out, rc);
}
#ifdef __KERNEL__
RETURN(rc);
}
-int mdc_init_ea_size(struct obd_export *exp, int easize, int cookiesize)
+static int mdc_init_ea_size(struct obd_export *exp, int easize, int cookiesize)
{
struct obd_device *obd = exp->exp_obd;
struct client_obd *cli = &obd->u.cli;
RETURN(-EINVAL);
}
+#define KEY_IS(str) \
+ (keylen == strlen(str) && memcmp(key, str, keylen) == 0)
+
mds = &obd->u.mds;
- if (keylen == strlen("mds_num") &&
- memcmp(key, "mds_num", keylen) == 0) {
+ if (KEY_IS("mds_num")) {
int valsize;
__u32 group;
CDEBUG(D_IOCTL, "set mds num %d\n", *(int*)val);
rc = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"), "mds_conn",
valsize, &group);
RETURN(rc);
- } else if (keylen == strlen("client") &&
- memcmp(key, "client", keylen) == 0) {
+ } else if (KEY_IS("client")) {
if (!(exp->exp_flags & OBD_OPT_REAL_CLIENT)) {
atomic_inc(&mds->mds_real_clients);
CDEBUG(D_OTHER,"%s: peer from %s is real client (%d)\n",
LBUG();
OBD_FAIL_RETURN(OBD_FAIL_LDLM_BL_CALLBACK, 0);
break;
- case LLOG_ORIGIN_HANDLE_CREATE:
+ case LLOG_ORIGIN_HANDLE_OPEN:
DEBUG_REQ(D_INODE, req, "llog_init");
OBD_FAIL_RETURN(OBD_FAIL_OBD_LOGD_NET, 0);
- rc = llog_origin_handle_create(req);
+ rc = llog_origin_handle_open(req);
break;
case LLOG_ORIGIN_HANDLE_NEXT_BLOCK:
DEBUG_REQ(D_INODE, req, "llog next block");
cfg.cfg_instance = NULL;
cfg.cfg_uuid = mds->mds_lov_uuid;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- rc = class_config_parse_llog(llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT),
+ rc = class_config_process_llog(llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT),
mds->mds_profile, &cfg);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc)
cfg.cfg_uuid = mds->mds_lov_uuid;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- class_config_parse_llog(llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT),
- cln_prof, &cfg);
+ class_config_process_llog(llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT),
+ cln_prof, &cfg);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
OBD_FREE(cln_prof, len);
#include <linux/obd.h>
#include <linux/obd_class.h>
#include <linux/lprocfs_status.h>
+#include "mds_internal.h"
#ifndef LPROCFS
struct lprocfs_vars lprocfs_mds_obd_vars[] = { {0} };
return count;
}
+static int lprocfs_mds_wr_config_update(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct obd_device *obd = data;
+ ENTRY;
+
+ RETURN(mds_lov_update_config(obd, 0));
+}
+
struct lprocfs_vars lprocfs_mds_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
{ "blocksize", lprocfs_rd_blksize, 0, 0 },
{ "mntdev", lprocfs_mds_rd_mntdev, 0, 0 },
{ "recovery_status", lprocfs_mds_rd_recovery_status, 0, 0 },
{ "evict_client", 0, lprocfs_mds_wr_evict_client, 0 },
+ { "config_update", 0, lprocfs_mds_wr_config_update, 0 },
{ "num_exports", lprocfs_rd_num_exports, 0, 0 },
{ 0 }
};
int mds_lov_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
int mds_post_mds_lovconf(struct obd_device *obd);
int mds_notify(struct obd_device *obd, struct obd_device *watched, int active);
+int mds_lov_update_config(struct obd_device *obd, int transno);
int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
struct lov_mds_md *lmm, int lmm_size);
+int mds_revalidate_lov_ea(struct obd_device *obd, struct inode *inode,
+ struct lustre_msg *msg, int offset);
/* mds/mds_open.c */
int mds_query_write_access(struct inode *inode);
RETURN(rc);
}
+static int mds_lov_update_desc(struct obd_device *obd, struct obd_export *lov)
+{
+ struct mds_obd *mds = &obd->u.mds;
+ int valsize = sizeof(mds->mds_lov_desc), rc, i;
+ ENTRY;
+
+ rc = obd_get_info(lov, strlen("lovdesc") + 1, "lovdesc", &valsize,
+ &mds->mds_lov_desc);
+ if (rc)
+ RETURN(rc);
+
+ i = lov_mds_md_size(mds->mds_lov_desc.ld_tgt_count);
+ if (i > mds->mds_max_mdsize)
+ mds->mds_max_mdsize = i;
+ mds->mds_max_cookiesize = mds->mds_lov_desc.ld_tgt_count *
+ sizeof(struct llog_cookie);
+ mds->mds_has_lov_desc = 1;
+ RETURN(0);
+}
+
int mds_lov_connect(struct obd_device *obd, char * lov_name)
{
struct mds_obd *mds = &obd->u.mds;
struct lustre_handle conn = {0,};
char name[32] = "CATLIST";
- int valsize, rc, i;
+ int rc, i, valsize;
__u32 group;
ENTRY;
RETURN(-ENOTCONN);
}
+ CDEBUG(D_HA, "obd: %s osc: %s lov_name: %s\n",
+ obd->obd_name, mds->mds_osc_obd->obd_name, lov_name);
+
rc = obd_connect(&conn, mds->mds_osc_obd, &obd->obd_uuid);
if (rc) {
CERROR("MDS cannot connect to LOV %s (%d)\n",
GOTO(err_discon, rc);
}
- valsize = sizeof(mds->mds_lov_desc);
- rc = obd_get_info(mds->mds_osc_exp, strlen("lovdesc") + 1, "lovdesc",
- &valsize, &mds->mds_lov_desc);
+ rc = mds_lov_update_desc(obd, mds->mds_osc_exp);
if (rc)
GOTO(err_reg, rc);
- i = lov_mds_md_size(mds->mds_lov_desc.ld_tgt_count);
- if (i > mds->mds_max_mdsize)
- mds->mds_max_mdsize = i;
- mds->mds_max_cookiesize = mds->mds_lov_desc.ld_tgt_count*
- sizeof(struct llog_cookie);
- mds->mds_has_lov_desc = 1;
rc = mds_lov_read_objids(obd);
if (rc) {
CERROR("cannot read %s: rc = %d\n", "lov_objids", rc);
struct obd_ioctl_data *data = karg;
struct lvfs_run_ctxt saved;
int rc = 0;
+ ENTRY;
switch (cmd) {
case OBD_IOC_RECORD: {
RETURN(-EBUSY);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(llog_get_context(&obd->obd_llogs,
- LLOG_CONFIG_ORIG_CTXT),
- &mds->mds_cfg_llh, NULL, name);
+ rc = llog_open(llog_get_context(&obd->obd_llogs,
+ LLOG_CONFIG_ORIG_CTXT),
+ &mds->mds_cfg_llh, NULL, name,
+ OBD_LLOG_FL_CREATE);
if (rc == 0)
llog_init_handle(mds->mds_cfg_llh, LLOG_F_IS_PLAIN,
&cfg_uuid);
RETURN(-EBUSY);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(llog_get_context(&obd->obd_llogs,
- LLOG_CONFIG_ORIG_CTXT),
- &mds->mds_cfg_llh, NULL, name);
+ rc = llog_open(llog_get_context(&obd->obd_llogs,
+ LLOG_CONFIG_ORIG_CTXT),
+ &mds->mds_cfg_llh, NULL, name,
+ OBD_LLOG_FL_CREATE);
if (rc == 0) {
llog_init_handle(mds->mds_cfg_llh, LLOG_F_IS_PLAIN,
NULL);
-
+
rc = llog_destroy(mds->mds_cfg_llh);
llog_free_handle(mds->mds_cfg_llh);
}
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-
+
mds->mds_cfg_llh = NULL;
RETURN(rc);
}
if (!mds->mds_cfg_llh)
RETURN(-EBADF);
+ /* XXX - this probably should be a parameter to this ioctl.
+ * For now, just use llh_max_transno for expediency. */
rec.lrh_len = llog_data_len(data->ioc_plen1);
if (data->ioc_type == LUSTRE_CFG_TYPE) {
struct llog_ctxt *ctxt =
llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- rc = class_config_parse_llog(ctxt, data->ioc_inlbuf1, NULL);
+ rc = class_config_process_llog(ctxt, data->ioc_inlbuf1, NULL);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc)
RETURN(rc);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = class_config_dump_llog(ctxt, data->ioc_inlbuf1, NULL);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- if (rc)
- RETURN(rc);
RETURN(rc);
}
RETURN(rc);
}
+int mds_set_info(struct obd_export *exp, obd_count keylen,
+ void *key, obd_count vallen, void *val)
+{
+ struct obd_device *obd = class_exp2obd(exp);
+ struct mds_obd *mds = &obd->u.mds;
+ ENTRY;
+
+#define KEY_IS(str) \
+ (keylen == strlen(str) && memcmp(key, str, keylen) == 0)
+
+ if (KEY_IS("next_id")) {
+ obd_id *id = (obd_id *)val;
+ int idx, rc;
+
+ /* XXX - this really should be vallen != (2 * sizeof(*id)) *
+ * Just following the precedent set by lov_set_info. */
+ if (vallen != 2)
+ RETURN(-EINVAL);
+
+ if ((idx = *id) != *id)
+ RETURN(-EINVAL);
+
+ CDEBUG(D_CONFIG, "idx: %d id: %llu\n", idx, *(id + 1));
+
+ /* The size of the LOV target table may have increased. */
+ if (idx >= mds->mds_lov_desc.ld_tgt_count) {
+ obd_id *ids;
+ int oldsize, size;
+
+ oldsize = mds->mds_lov_desc.ld_tgt_count * sizeof(*ids);
+ rc = mds_lov_update_desc(obd, mds->mds_osc_exp);
+ if (rc)
+ RETURN(rc);
+ if (idx >= mds->mds_lov_desc.ld_tgt_count)
+ RETURN(-EINVAL);
+ size = mds->mds_lov_desc.ld_tgt_count * sizeof(*ids);
+ OBD_ALLOC(ids, size);
+ if (ids == NULL)
+ RETURN(-ENOMEM);
+ memset(ids, 0, size);
+ if (mds->mds_lov_objids != NULL) {
+ memcpy(ids, mds->mds_lov_objids, oldsize);
+ OBD_FREE(mds->mds_lov_objids, oldsize);
+ }
+ mds->mds_lov_objids = ids;
+ }
+
+ mds->mds_lov_objids[idx] = *++id;
+ CDEBUG(D_CONFIG, "objid: %d: %lld\n", idx, *id);
+ /* XXX - should we be writing this out here ? */
+ RETURN(mds_lov_write_objids(obd));
+ }
+
+ RETURN(-EINVAL);
+}
+
+int mds_lov_update_config(struct obd_device *obd, int clean)
+{
+ struct mds_obd *mds = &obd->u.mds;
+ struct lvfs_run_ctxt saved;
+ struct config_llog_instance cfg;
+ struct llog_ctxt *ctxt;
+ char *profile = mds->mds_profile, *name;
+ int rc, version, namelen;
+ ENTRY;
+
+ if (profile == NULL)
+ RETURN(0);
+
+ cfg.cfg_instance = NULL;
+ cfg.cfg_uuid = mds->mds_lov_uuid;
+
+ namelen = strlen(profile) + 20; /* -clean-######### */
+ OBD_ALLOC(name, namelen);
+ if (name == NULL)
+ RETURN(-ENOMEM);
+
+ if (clean) {
+ version = mds->mds_config_version - 1;
+ sprintf(name, "%s-clean-%d", profile, version);
+ } else {
+ version = mds->mds_config_version + 1;
+ sprintf(name, "%s-%d", profile, version);
+ }
+
+ CWARN("Applying configuration log %s\n", name);
+
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ ctxt = llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
+ rc = class_config_process_llog(ctxt, name, &cfg);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ if (rc == 0) {
+ mds->mds_config_version = version;
+ rc = mds_lov_update_desc(obd, mds->mds_osc_exp);
+ }
+ CWARN("Finished applying configuration log %s: %d\n", name, rc);
+
+ OBD_FREE(name, namelen);
+ RETURN(rc);
+}
+
/* Convert the on-disk LOV EA structre.
* We always try to convert from an old LOV EA format to the common in-memory
* (lsm) format (obd_unpackmd() understands the old on-disk (lmm) format) and
conv_end:
return rc;
}
+
+/* Must be called with i_sem held */
+int mds_revalidate_lov_ea(struct obd_device *obd, struct inode *inode,
+ struct lustre_msg *msg, int offset)
+{
+ struct mds_obd *mds = &obd->u.mds;
+ struct obd_export *osc_exp = mds->mds_osc_exp;
+ struct lov_mds_md *lmm= NULL;
+ struct lov_stripe_md *lsm = NULL;
+ struct obdo *oa;
+ struct obd_trans_info oti = {0};
+ unsigned valid = 0;
+ int lmm_size = 0, lsm_size = 0, err, rc;
+ void *handle;
+ ENTRY;
+
+ LASSERT(down_trylock(&inode->i_sem) != 0);
+
+ /* XXX - add way to know if EA is already up to date & return
+ * without doing anything. Easy to do since we get notified of
+ * LOV updates. */
+
+ lmm = lustre_msg_buf(msg, offset, 0);
+ if (lmm == NULL) {
+ CDEBUG(D_INFO, "no space reserved for inode %lu MD\n",
+ inode->i_ino);
+ RETURN(0);
+ }
+ lmm_size = msg->buflens[offset];
+
+ rc = obd_unpackmd(osc_exp, &lsm, lmm, lmm_size);
+ if (rc < 0)
+ RETURN(0);
+
+ lsm_size = rc;
+
+ LASSERT(lsm->lsm_magic == LOV_MAGIC);
+
+ oa = obdo_alloc();
+ if (oa == NULL)
+ GOTO(out_lsm, rc = -ENOMEM);
+ oa->o_mode = S_IFREG | 0600;
+ oa->o_id = inode->i_ino;
+ oa->o_generation = inode->i_generation;
+ oa->o_uid = 0; /* must have 0 uid / gid on OST */
+ oa->o_gid = 0;
+
+ oa->o_valid = OBD_MD_FLID | OBD_MD_FLGENER | OBD_MD_FLTYPE |
+ OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID;
+ valid = OBD_MD_FLTYPE | OBD_MD_FLATIME | OBD_MD_FLMTIME |
+ OBD_MD_FLCTIME;
+ obdo_from_inode(oa, inode, valid);
+
+ rc = obd_revalidate_md(osc_exp, oa, lsm, &oti);
+ if (rc == 0)
+ GOTO(out_oa, rc);
+ if (rc < 0) {
+ CERROR("Error validating LOV EA on %lu/%u: %d\n",
+ inode->i_ino, inode->i_generation, rc);
+ GOTO(out_oa, rc);
+ }
+
+ rc = obd_packmd(osc_exp, &lmm, lsm);
+ if (rc < 0)
+ GOTO(out_oa, rc);
+ lmm_size = rc;
+
+ handle = fsfilt_start(obd, inode, FSFILT_OP_SETATTR, NULL);
+ if (IS_ERR(handle)) {
+ rc = PTR_ERR(handle);
+ GOTO(out_oa, rc);
+ }
+
+ rc = fsfilt_set_md(obd, inode, handle, lmm, lmm_size);
+ err = fsfilt_commit(obd, inode->i_sb, inode, handle, 0);
+ if (!rc)
+ rc = err;
+out_oa:
+ obdo_free(oa);
+out_lsm:
+ obd_free_memmd(osc_exp, &lsm);
+ RETURN(rc);
+}
up(&dchild->d_inode->i_sem);
RETURN(rc);
}
+ if (S_ISREG(dchild->d_inode->i_mode) &&
+ (body->valid & OBD_MD_FLEASIZE)) {
+ rc = mds_revalidate_lov_ea(obd, dchild->d_inode,
+ req->rq_repmsg, 2);
+ if (!rc)
+ rc = mds_pack_md(obd, req->rq_repmsg, 2, body,
+ dchild->d_inode, 0);
+ if (rc) {
+ up(&dchild->d_inode->i_sem);
+ RETURN(rc);
+ }
+ }
}
- /* If the inode has EA data, then OSTs hold size, mtime */
+ /* If the inode has no EA data, then MDSs hold size, mtime */
if (S_ISREG(dchild->d_inode->i_mode) &&
!(body->valid & OBD_MD_FLEASIZE)) {
body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS |
EXPORT_SYMBOL(class_get_profile);
EXPORT_SYMBOL(class_del_profile);
EXPORT_SYMBOL(class_process_config);
-EXPORT_SYMBOL(class_config_parse_llog);
+EXPORT_SYMBOL(class_config_process_llog);
EXPORT_SYMBOL(class_config_dump_llog);
-EXPORT_SYMBOL(class_attach);
-EXPORT_SYMBOL(class_setup);
-EXPORT_SYMBOL(class_cleanup);
-EXPORT_SYMBOL(class_detach);
/* mea.c */
EXPORT_SYMBOL(mea_name2idx);
if (obd->obd_set_up) {
atomic_dec(&obd->obd_refcount);
wake_up(&obd->obd_refcount_waitq);
+ } else {
+ CERROR("removing export %p from obd %s (%p) -- OBD "
+ "not set up (refcount = %d)\n", exp,
+ obd->obd_name, obd,
+ atomic_read(&obd->obd_refcount));
}
}
}
err = str2logid(&logid, data->ioc_inlbuf1, data->ioc_inllen1);
if (err)
GOTO(out, err);
- err = llog_create(ctxt, &handle, &logid, NULL);
+ err = llog_open(ctxt, &handle, &logid, NULL, 0);
if (err)
GOTO(out, err);
} else if (*data->ioc_inlbuf1 == '$') {
char *name = data->ioc_inlbuf1 + 1;
- err = llog_create(ctxt, &handle, NULL, name);
+ err = llog_open(ctxt, &handle, NULL, name, 0);
if (err)
GOTO(out, err);
} else {
#include <linux/obd_class.h>
#include <linux/lustre_log.h>
+#include <linux/lustre_mds.h>
#include <portals/list.h>
/* helper functions for calling the llog obd methods */
int rc = 0;
ENTRY;
- LASSERT(ctxt);
+ if (ctxt == NULL)
+ RETURN(0);
if (CTXTP(ctxt, cleanup))
rc = CTXTP(ctxt, cleanup)(ctxt);
LASSERT(ctxt);
llog_gen_init(ctxt);
- if (logid->lgl_oid)
- rc = llog_create(ctxt, &handle, logid, NULL);
- else {
- rc = llog_create(ctxt, &handle, NULL, NULL);
+ if (logid->lgl_oid) {
+ rc = llog_open(ctxt, &handle, logid, NULL, 0);
+ } else {
+ rc = llog_open(ctxt, &handle, NULL, NULL, 0);
if (!rc)
*logid = handle->lgh_id;
}
ctxt = llog_get_context(&obd->obd_llogs, LLOG_TEST_ORIG_CTXT);
LASSERT(ctxt);
- rc = llog_create(ctxt, &llh, NULL, name);
+ rc = llog_open(ctxt, &llh, NULL, name, OBD_LLOG_FL_CREATE);
if (rc) {
- CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
+ CERROR("1a: llog_open with name %s failed: %d\n", name, rc);
RETURN(rc);
}
llog_init_handle(llh, LLOG_F_IS_PLAIN, &uuid);
ctxt = llog_get_context(&obd->obd_llogs, LLOG_TEST_ORIG_CTXT);
CWARN("2a: re-open a log with name: %s\n", name);
- rc = llog_create(ctxt, llh, NULL, name);
+ rc = llog_open(ctxt, llh, NULL, name, 0);
if (rc) {
CERROR("2a: re-open log with name %s failed: %d\n", name, rc);
RETURN(rc);
RETURN(rc);
CWARN("2b: create a log without specified NAME & LOGID\n");
- rc = llog_create(ctxt, &loghandle, NULL, NULL);
+ rc = llog_open(ctxt, &loghandle, NULL, NULL, OBD_LLOG_FL_CREATE);
if (rc) {
CERROR("2b: create log failed\n");
RETURN(rc);
llog_close(loghandle);
CWARN("2b: re-open the log by LOGID\n");
- rc = llog_create(ctxt, &loghandle, &logid, NULL);
+ rc = llog_open(ctxt, &loghandle, &logid, NULL, 0);
if (rc) {
CERROR("2b: re-open log by LOGID failed\n");
RETURN(rc);
sprintf(name, "%x", llog_test_rand+1);
CWARN("4a: create a catalog log with name: %s\n", name);
- rc = llog_create(ctxt, &cath, NULL, name);
+ rc = llog_open(ctxt, &cath, NULL, name, OBD_LLOG_FL_CREATE);
if (rc) {
- CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
+ CERROR("1a: llog_open with name %s failed: %d\n", name, rc);
GOTO(out, rc);
}
llog_init_handle(cath, LLOG_F_IS_CAT, &uuid);
lmr.lmr_hdr.lrh_type = 0xf00f00;
CWARN("5a: re-open catalog by id\n");
- rc = llog_create(ctxt, &llh, &cat_logid, NULL);
+ rc = llog_open(ctxt, &llh, &cat_logid, NULL, 0);
if (rc) {
- CERROR("5a: llog_create with logid failed: %d\n", rc);
+ CERROR("5a: llog_open with logid failed: %d\n", rc);
GOTO(out, rc);
}
llog_init_handle(llh, LLOG_F_IS_CAT, &uuid);
exp = class_conn2export(&exph);
nctxt = llog_get_context(&mdc_obd->obd_llogs, LLOG_CONFIG_REPL_CTXT);
- rc = llog_create(nctxt, &llh, NULL, name);
+ rc = llog_open(nctxt, &llh, NULL, name, 0);
if (rc) {
- CERROR("6: llog_create failed %d\n", rc);
+ CERROR("6: llog_open failed %d\n", rc);
RETURN(rc);
}
CWARN("7: create a log with name: %s\n", name);
LASSERT(ctxt);
- rc = llog_create(ctxt, &llh, NULL, name);
+ rc = llog_open(ctxt, &llh, NULL, name, OBD_LLOG_FL_CREATE);
if (rc) {
- CERROR("7: llog_create with name %s failed: %d\n", name, rc);
+ CERROR("7: llog_open with name %s failed: %d\n", name, rc);
RETURN(rc);
}
llog_init_handle(llh, LLOG_F_IS_PLAIN, &uuid);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, setup);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, precleanup);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, cleanup);
+ LPROCFS_OBD_OP_INIT(num_private_stats, stats, process_config);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, postrecov);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, connect);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, disconnect);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, statfs);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, packmd);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, unpackmd);
+ LPROCFS_OBD_OP_INIT(num_private_stats, stats, revalidate_md);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, preallocate);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, create);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, destroy);
/* Create a new device and set the type, name and uuid. If
* successful, the new device can be accessed by either name or uuid.
*/
-int class_attach(struct lustre_cfg *lcfg)
+static int class_attach(struct lustre_cfg *lcfg)
{
struct obd_type *type;
struct obd_device *obd;
GOTO(out, rc = -EINVAL);
/* have we attached a type to this device */
- if (obd->obd_attached || obd->obd_type) {
+ if (obd->obd_attached) {
+ CERROR("OBD: Device %d already attached.\n", obd->obd_minor);
+ GOTO(out, rc = -EBUSY);
+ }
+ if (obd->obd_type != NULL) {
CERROR("OBD: Device %d already typed as %s.\n",
obd->obd_minor, MKSTR(obd->obd_type->typ_name));
GOTO(out, rc = -EBUSY);
case 2:
OBD_FREE(obd->obd_name, strlen(obd->obd_name) + 1);
case 1:
- class_put_type(obd->obd_type);
+ class_put_type(type);
obd->obd_type = NULL;
}
return rc;
}
-int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
+static int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
{
int err = 0;
struct obd_export *exp;
RETURN(err);
}
-int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg)
+static int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg)
{
int minor;
int err = 0;
}
}
-int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
+static int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
{
int flags = 0;
int err = 0;
obd->obd_set_up = obd->obd_stopping = 0;
obd->obd_type->typ_refcnt--;
/* XXX this should be an LASSERT */
- if (atomic_read(&obd->obd_refcount) > 0)
- CERROR("%s still has refcount %d after "
- "cleanup.\n", obd->obd_name,
+ if (atomic_read(&obd->obd_refcount) > 0) {
+ CERROR("%s (%p) still has refcount %d after "
+ "cleanup.\n", obd->obd_name, obd,
atomic_read(&obd->obd_refcount));
+ dump_exports(obd);
+ }
}
RETURN(err);
struct obd_device *obd;
char str[PTL_NALFMT_SIZE];
int err;
+ ENTRY;
LASSERT(lcfg && !IS_ERR(lcfg));
GOTO(out, err = 0);
}
default: {
- CERROR("Unknown command: %d\n", lcfg->lcfg_command);
- GOTO(out, err = -EINVAL);
+ err = obd_process_config(obd, sizeof(*lcfg), lcfg);
+ GOTO(out, err);
}
}
RETURN(err);
}
-static int class_config_llog_handler(struct llog_handle * handle,
- struct llog_rec_hdr *rec, void *data)
+static int class_config_parse_handler(struct llog_handle * handle,
+ struct llog_rec_hdr *rec, void *data)
{
struct config_llog_instance *cfg = data;
int cfg_len = rec->lrh_len;
char *cfg_buf = (char*) (rec + 1);
int rc = 0;
ENTRY;
+
if (rec->lrh_type == OBD_CFG_REC) {
char *buf;
struct lustre_cfg *lcfg;
lustre_cfg_freedata(buf, cfg_len);
} else if (rec->lrh_type == PTL_CFG_REC) {
struct portals_cfg *pcfg = (struct portals_cfg *)cfg_buf;
- if (pcfg->pcfg_command ==NAL_CMD_REGISTER_MYNID &&
+ if (pcfg->pcfg_command == NAL_CMD_REGISTER_MYNID &&
cfg->cfg_local_nid != PTL_NID_ANY) {
pcfg->pcfg_nid = cfg->cfg_local_nid;
}
rc = libcfs_nal_cmd(pcfg);
+ } else {
+ CERROR("unrecognized record type: 0x%x\n", rec->lrh_type);
}
out:
RETURN(rc);
}
-int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
- struct config_llog_instance *cfg)
+int class_config_process_llog(struct llog_ctxt *ctxt, char *name,
+ struct config_llog_instance *cfg)
{
struct llog_handle *llh;
int rc, rc2;
ENTRY;
- rc = llog_create(ctxt, &llh, NULL, name);
+ rc = llog_open(ctxt, &llh, NULL, name, 0);
if (rc)
RETURN(rc);
rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL);
- if (rc)
- GOTO(parse_out, rc);
+ if (rc == 0)
+ rc = llog_process(llh, class_config_parse_handler, cfg, NULL);
- rc = llog_process(llh, class_config_llog_handler, cfg, NULL);
-parse_out:
rc2 = llog_close(llh);
if (rc == 0)
rc = rc2;
RETURN(rc);
-
}
static int class_config_dump_handler(struct llog_handle * handle,
char *cfg_buf = (char*) (rec + 1);
int rc = 0;
ENTRY;
+
if (rec->lrh_type == OBD_CFG_REC) {
char *buf;
struct lustre_cfg *lcfg;
GOTO(out, rc);
lcfg = (struct lustre_cfg* ) buf;
- CDEBUG(D_INFO, "lcfg command: %x\n", lcfg->lcfg_command);
+ CDEBUG(D_INFO, "lcfg command: 0x%x\n", lcfg->lcfg_command);
if (lcfg->lcfg_dev_name)
CDEBUG(D_INFO, " devname: %s\n",
lcfg->lcfg_dev_name);
if (lcfg->lcfg_flags)
- CDEBUG(D_INFO, " flags: %x\n", lcfg->lcfg_flags);
+ CDEBUG(D_INFO, " flags: 0x%x\n", lcfg->lcfg_flags);
if (lcfg->lcfg_nid)
CDEBUG(D_INFO, " nid: "LPX64"\n",
lcfg->lcfg_nid);
if (lcfg->lcfg_inlbuf1)
CDEBUG(D_INFO, " inlbuf1: %s\n",lcfg->lcfg_inlbuf1);
if (lcfg->lcfg_inlbuf2)
- CDEBUG(D_INFO, " inlbuf3: %s\n",lcfg->lcfg_inlbuf2);
+ CDEBUG(D_INFO, " inlbuf2: %s\n",lcfg->lcfg_inlbuf2);
if (lcfg->lcfg_inlbuf3)
CDEBUG(D_INFO, " inlbuf3: %s\n",lcfg->lcfg_inlbuf3);
if (lcfg->lcfg_inlbuf4)
} else if (rec->lrh_type == PTL_CFG_REC) {
struct portals_cfg *pcfg = (struct portals_cfg *)cfg_buf;
- CDEBUG(D_INFO, "pcfg command: %d\n", pcfg->pcfg_command);
+ CDEBUG(D_INFO, "pcfg command: 0x%x\n", pcfg->pcfg_command);
if (pcfg->pcfg_nal)
CDEBUG(D_INFO, " nal: %d\n",
pcfg->pcfg_nal);
CDEBUG(D_INFO, " nid: "LPX64"\n",
pcfg->pcfg_nid);
if (pcfg->pcfg_nid2)
- CDEBUG(D_INFO, " nid: "LPX64"\n",
+ CDEBUG(D_INFO, " nid2: "LPX64"\n",
pcfg->pcfg_nid2);
if (pcfg->pcfg_nid3)
- CDEBUG(D_INFO, " nid: "LPX64"\n",
+ CDEBUG(D_INFO, " nid3: "LPX64"\n",
pcfg->pcfg_nid3);
if (pcfg->pcfg_misc)
- CDEBUG(D_INFO, " nid: %d\n",
+ CDEBUG(D_INFO, " misc: %d\n",
pcfg->pcfg_misc);
if (pcfg->pcfg_id)
- CDEBUG(D_INFO, " id: %x\n",
+ CDEBUG(D_INFO, " id: 0x%x\n",
pcfg->pcfg_id);
if (pcfg->pcfg_flags)
- CDEBUG(D_INFO, " flags: %x\n",
+ CDEBUG(D_INFO, " flags: 0x%x\n",
pcfg->pcfg_flags);
} else {
CERROR("unhandled lrh_type: %#x\n", rec->lrh_type);
int rc, rc2;
ENTRY;
- rc = llog_create(ctxt, &llh, NULL, name);
+ rc = llog_open(ctxt, &llh, NULL, name, 0);
if (rc)
RETURN(rc);
rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL);
- if (rc)
- GOTO(parse_out, rc);
+ if (rc == 0)
+ rc = llog_process(llh, class_config_dump_handler, cfg, NULL);
- rc = llog_process(llh, class_config_dump_handler, cfg, NULL);
-parse_out:
rc2 = llog_close(llh);
if (rc == 0)
rc = rc2;
RETURN(rc);
-
}
struct lov_stripe_md *lsm, int flags, void *opaque)
{
struct obd_device *obd = class_exp2obd(exp);
- struct ldlm_res_id res_id = { .name = {0} };
+ struct ldlm_res_id res_id = { .name = {0} }, *resp = NULL;
- res_id.name[0] = lsm->lsm_object_id;
- res_id.name[2] = lsm->lsm_object_gr;
+ if (lsm != NULL) {
+ res_id.name[0] = lsm->lsm_object_id;
+ res_id.name[2] = lsm->lsm_object_gr;
+ resp = &res_id;
+ }
- return ldlm_cli_cancel_unused(obd->obd_namespace, &res_id, flags,
- opaque);
+ return ldlm_cli_cancel_unused(obd->obd_namespace, resp, flags, opaque);
}
static int osc_statfs(struct obd_device *obd, struct obd_statfs *osfs,
GOTO(out, err = -EINVAL);
}
+ if (data->ioc_inllen3 < sizeof(__u32)) {
+ OBD_FREE(buf, len);
+ GOTO(out, err = -EINVAL);
+ }
+
desc = (struct lov_desc *)data->ioc_inlbuf1;
desc->ld_tgt_count = 1;
desc->ld_active_tgt_count = 1;
desc->ld_default_stripe_offset = 0;
desc->ld_pattern = 0;
memcpy(&desc->ld_uuid, &obd->obd_uuid, sizeof(uuid));
-
memcpy(data->ioc_inlbuf2, &obd->obd_uuid, sizeof(uuid));
+ *((__u32 *)data->ioc_inlbuf3) = 1;
err = copy_to_user((void *)uarg, buf, len);
if (err)
return lprocfs_obd_detach(dev);
}
-int osc_setup(struct obd_device *obd, obd_count len, void *buf)
+static int osc_setup(struct obd_device *obd, obd_count len, void *buf)
{
int rc;
ENTRY;
RETURN(rc);
}
-int osc_cleanup(struct obd_device *obd, int flags)
+static int osc_cleanup(struct obd_device *obd, int flags)
{
int rc;
+ rc = ldlm_cli_cancel_unused(obd->obd_namespace, NULL,
+ LDLM_FL_CONFIG_CHANGE, NULL);
+ if (rc)
+ RETURN(rc);
+
rc = client_obd_cleanup(obd, flags);
ptlrpcd_decref();
RETURN(rc);
#define D_RPCTRACE 0x00100000 /* for distributed debugging */
#define D_VFSTRACE 0x00200000
#define D_READA 0x00400000 /* read-ahead */
+#define D_CONFIG 0x00800000
#ifdef __KERNEL__
# include <linux/sched.h> /* THREAD_SIZE */
{"trace", "inode", "super", "ext2", "malloc", "cache", "info", "ioctl",
"blocks", "net", "warning", "buffs", "other", "dentry", "portals",
"page", "dlmtrace", "error", "emerg", "ha", "rpctrace", "vfstrace",
- "reada", NULL};
+ "reada", "config", NULL};
struct debug_daemon_cmd {
char *cmd;
obd_import_event(imp->imp_obd, imp, IMP_EVENT_INVALIDATE);
}
-static void ptlrpc_activate_import(struct obd_import *imp)
+void ptlrpc_activate_import(struct obd_import *imp)
{
struct obd_device *obd = imp->imp_obd;
unsigned long flags;
/* This is a callback from the llog_* functions.
* Assumes caller has already pushed us into the kernel context. */
-static int llog_client_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+static int llog_client_open(struct llog_ctxt *ctxt, struct llog_handle **res,
+ struct llog_logid *logid, char *name, int flags)
{
struct obd_import *imp;
struct llogd_body req_body;
struct ptlrpc_request *req = NULL;
int size[2] = {sizeof(req_body)};
char *tmp[2] = {(char*) &req_body};
- int bufcount = 1;
- int repsize[] = {sizeof (req_body)};
- int rc;
+ int bufcount = 1, repsize[] = {sizeof (req_body)}, rc;
ENTRY;
LASSERT(ctxt->loc_imp);
if (logid)
req_body.lgd_logid = *logid;
req_body.lgd_ctxt_idx = ctxt->loc_idx - 1;
+ req_body.lgd_llh_flags = flags;
if (name) {
size[bufcount] = strlen(name) + 1;
bufcount++;
}
- req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_CREATE,bufcount,size,tmp);
+ req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_OPEN, bufcount, size,tmp);
if (!req)
GOTO(err_free, rc = -ENOMEM);
lop_prev_block: llog_client_prev_block,
lop_next_block: llog_client_next_block,
lop_read_header: llog_client_read_header,
- lop_create: llog_client_create,
+ lop_open: llog_client_open,
lop_close: llog_client_close,
};
#ifdef __KERNEL__
-int llog_origin_handle_create(struct ptlrpc_request *req)
+int llog_origin_handle_open(struct ptlrpc_request *req)
{
struct obd_export *exp = req->rq_export;
struct obd_device *obd = exp->exp_obd;
struct lvfs_run_ctxt saved;
struct llog_logid *logid = NULL;
struct llog_ctxt *ctxt;
- char * name = NULL;
- int size = sizeof (*body);
- int rc, rc2;
+ char *name = NULL;
+ int rc, rc2, size = sizeof (*body);
ENTRY;
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
- lustre_swab_llogd_body);
+ lustre_swab_llogd_body);
if (body == NULL) {
CERROR ("Can't unpack llogd_body\n");
GOTO(out, rc =-EFAULT);
LASSERT(ctxt != NULL);
push_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, logid, name);
+ rc = llog_open(ctxt, &loghandle, logid, name, body->lgd_llh_flags);
if (rc)
GOTO(out_pop, rc);
if (rc)
GOTO(out_close, rc = -ENOMEM);
- body = lustre_msg_buf(req->rq_repmsg, 0, sizeof (*body));
+ body = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*body));
body->lgd_logid = loghandle->lgh_id;
out_close:
LASSERT(ctxt != NULL);
push_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
+ rc = llog_open(ctxt, &loghandle, &body->lgd_logid, NULL, 0);
if (rc)
GOTO(out_pop, rc);
LASSERT(ctxt != NULL);
push_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
+ rc = llog_open(ctxt, &loghandle, &body->lgd_logid, NULL, 0);
if (rc)
GOTO(out_pop, rc);
LASSERT(ctxt != NULL);
push_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
+ rc = llog_open(ctxt, &loghandle, &body->lgd_logid, NULL, 0);
if (rc)
GOTO(out_pop, rc);
for (i = 0; i < 4; i++) {
int index, uncanceled = 0;
- rc = llog_create(ctxt, &handle, NULL, name[i]);
+ rc = llog_open(ctxt, &handle, NULL, name[i], 0);
if (rc)
GOTO(out_pop, rc);
rc = llog_init_handle(handle, 0, NULL);
lir = (struct llog_logid_rec *)rec;
logid = &lir->lid_id;
- rc = llog_create(ctxt, &handle, logid, NULL);
+ rc = llog_open(ctxt, &handle, logid, NULL, 0);
if (rc)
RETURN(-EINVAL);
rc = llog_init_handle(handle, 0, NULL);
int l, index, uncanceled = 0;
id = &idarray[i].lci_logid;
- rc = llog_create(ctxt, &handle, id, NULL);
+ rc = llog_open(ctxt, &handle, id, NULL, 0);
if (rc)
GOTO(out_pop, rc);
rc = llog_init_handle(handle, 0, NULL);
}
#else /* !__KERNEL__ */
-int llog_origin_handle_create(struct ptlrpc_request *req)
+int llog_origin_handle_open(struct ptlrpc_request *req)
{
LBUG();
return 0;
(long long)offsetof(struct llog_log_hdr, llh_tgtuuid));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid));
- LASSERTF(offsetof(struct llog_log_hdr, llh_reserved) == 84, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_reserved));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_reserved));
LASSERTF(offsetof(struct llog_log_hdr, llh_bitmap) == 88, " found %lld\n",
(long long)offsetof(struct llog_log_hdr, llh_bitmap));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, " found %lld\n",
(long long)offsetof(struct llogd_body, lgd_cur_offset));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_cur_offset));
- LASSERTF(LLOG_ORIGIN_HANDLE_CREATE == 501, " found %lld\n",
- (long long)LLOG_ORIGIN_HANDLE_CREATE);
+ LASSERTF(LLOG_ORIGIN_HANDLE_OPEN == 501, " found %lld\n",
+ (long long)LLOG_ORIGIN_HANDLE_OPEN);
LASSERTF(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502, " found %lld\n",
(long long)LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
LASSERTF(LLOG_ORIGIN_HANDLE_READ_HEADER == 503, " found %lld\n",
EXPORT_SYMBOL(ptlrpc_interrupted_set);
EXPORT_SYMBOL(ptlrpc_mark_interrupted);
+/* import.c */
+EXPORT_SYMBOL(ptlrpc_deactivate_import);
+EXPORT_SYMBOL(ptlrpc_invalidate_import);
+EXPORT_SYMBOL(ptlrpc_activate_import);
+EXPORT_SYMBOL(ptlrpc_fail_import);
+EXPORT_SYMBOL(ptlrpc_disconnect_import);
+
/* service.c */
EXPORT_SYMBOL(ptlrpc_save_lock);
EXPORT_SYMBOL(ptlrpc_schedule_difficult_reply);
/* recover.c */
EXPORT_SYMBOL(ptlrpc_run_recovery_over_upcall);
EXPORT_SYMBOL(ptlrpc_run_failed_import_upcall);
-EXPORT_SYMBOL(ptlrpc_disconnect_import);
EXPORT_SYMBOL(ptlrpc_resend);
EXPORT_SYMBOL(ptlrpc_wake_delayed);
EXPORT_SYMBOL(ptlrpc_set_import_active);
-EXPORT_SYMBOL(ptlrpc_deactivate_import);
-EXPORT_SYMBOL(ptlrpc_invalidate_import);
-EXPORT_SYMBOL(ptlrpc_fail_import);
EXPORT_SYMBOL(ptlrpc_fail_export);
EXPORT_SYMBOL(ptlrpc_recover_import);
EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);
/* llogd.c */
-EXPORT_SYMBOL(llog_origin_handle_create);
+EXPORT_SYMBOL(llog_origin_handle_open);
EXPORT_SYMBOL(llog_origin_handle_prev_block);
EXPORT_SYMBOL(llog_origin_handle_next_block);
EXPORT_SYMBOL(llog_origin_handle_read_header);
SIGNAL_MASK_UNLOCK(current, flags);
unlock_kernel();
- rc = llog_create(ctxt, &llh, &logid, NULL);
+ rc = llog_open(ctxt, &llh, &logid, NULL, 0);
if (rc) {
CERROR("llog_create failed %d\n", rc);
RETURN(rc);
do_lmc --add ost --node ${facet}_facet --ost ${facet}_svc --fstype $FSTYPE $*
}
+del_ost() {
+ facet=$1
+ shift
+ do_lmc --delete ost --node ${facet}_facet --ost ${facet}_svc $*
+}
+
+deactivate_ost() {
+ facet=$1
+ shift
+ do_lmc --deactivate ost --node ${facet}_facet --ost ${facet}_svc $*
+}
+
add_ostfailover() {
facet=$1
shift
do_lmc --add mtpt --node ${facet}_facet $*
}
+config_commit() {
+ do_lmc --commit
+}
#######
# General functions
from error import LconfError, OptionError
from cmdline import Options
-CONFIG_VERSION="2003070801"
+CONFIG_VERSION="2004050202"
uuids = self._get_all_refs()
return uuids
+ def get_lov_tgts(self, tag):
+ """ Returns list of lovtgts. """
+ tgts = self._get_lov_tgts(tag)
+ return tgts
+
def nid2server(self, nid, net_type, cluster_id):
netlist = self.lookup_class('network')
for net_db in netlist:
uuids.append(self.xml_get_ref(r))
return uuids
+ def _get_lov_tgts(self, tag):
+ """ Get all the refs of type TAG. Returns list of lov_tgts. """
+ tgts = []
+ tgtlist = self.dom_node.getElementsByTagName(tag)
+ for tgt in tgtlist:
+ uuidref = tgt.getAttribute('uuidref')
+ index = tgt.getAttribute('index')
+ generation = tgt.getAttribute('generation')
+ active = int(tgt.getAttribute('active'))
+ tgts.append((uuidref, index, generation, active))
+ return tgts
+
def xmllookup_by_uuid(self, dom_node, uuid):
for n in dom_node.childNodes:
if n.nodeType == n.ELEMENT_NODE:
# lconf is the main driver script for starting and stopping
# lustre filesystem services.
#
-# Based in part on the XML obdctl modifications done by Brian Behlendorf
+# Based in part on the XML obdctl modifications done by Brian Behlendorf
import sys, getopt, types
import string, os, stat, popen2, socket, time, random, fcntl, select
PORTALS_DIR = 'portals'
# Needed to call lconf --record
-CONFIG_FILE = ""
+CONFIG_FILE = ""
# Please keep these in sync with the values in portals/kp30.h
-ptldebug_names = {
+ptldebug_names = {
"trace" : (1 << 0),
"inode" : (1 << 1),
"super" : (1 << 2),
"rpctrace" : (1 << 20),
"vfstrace" : (1 << 21),
"reada" : (1 << 22),
+ "config" : (1 << 23),
}
subsystem_names = {
if not first_cleanup_error:
first_cleanup_error = rc
-# ============================================================
+# ============================================================
# debugging and error funcs
def fixme(msg = "this feature"):
- raise Lustre.LconfError, msg + ' not implmemented yet.'
+ raise Lustre.LconfError, msg + ' not implemented yet.'
def panic(*args):
msg = string.join(map(str,args))
return pid
except IOError:
return 0
-
+
def clean_pidfile(self):
""" Remove a stale pidfile """
log("removing stale pidfile:", self.pidfile())
os.unlink(self.pidfile())
except OSError, e:
log(self.pidfile(), e)
-
+
class AcceptorHandler(DaemonHandler):
def __init__(self, port, net_type, send_mem, recv_mem, irq_aff):
DaemonHandler.__init__(self, "acceptor")
def command_line(self):
return string.join(map(str,('-s', self.send_mem, '-r', self.recv_mem, self.flags, self.port)))
-
+
acceptors = {}
# start the acceptors
if not daemon.running():
daemon.start()
else:
- panic("run_one_acceptor: No acceptor defined for port:", port)
-
+ panic("run_one_acceptor: No acceptor defined for port:", port)
+
def stop_acceptor(port):
if acceptors.has_key(port):
daemon = acceptors[port]
if daemon.running():
daemon.stop()
-
+
# ============================================================
# handle lctl interface
def use_save_file(self, file):
self.save_file = file
-
+
def record(self, dev_name, logname):
log("Recording log", logname, "on", dev_name)
self.record_device = dev_name
device $%s
record %s
%s""" % (self.record_device, self.record_log, cmds)
-
+
debug("+", cmd_line, cmds)
if config.noexec: return (0, [])
raise CommandError(self.lctl, out, rc)
return rc, out
-
+
def clear_log(self, dev, log):
""" clear an existing log """
cmds = """
recv_mem,
nid, hostaddr, port, flags )
self.run(cmds)
-
+
def connect(self, srv):
self.add_uuid(srv.net_type, srv.nid_uuid, srv.nid)
if srv.net_type in ('tcp',) and not config.lctl_dump:
device $%s
recover %s""" %(dev_name, new_conn)
self.run(cmds)
-
+
# add a route to a range
def add_route(self, net, gw, lo, hi):
cmds = """
except CommandError, e:
log ("ignore: ")
e.dump()
-
+
def del_route(self, net, gw, lo, hi):
cmds = """
ignore_errors
quit""" % (net_type,
nid, hostaddr)
self.run(cmds)
-
+
# disconnect one connection
def disconnect(self, srv):
self.del_uuid(srv.nid_uuid)
setup %s
quit""" % (name, setup)
self.run(cmds)
-
+
# create a new device with lctl
def newdev(self, type, name, uuid, setup = ""):
except CommandError, e:
self.cleanup(name, uuid, 0)
raise e
-
+
# cleanup a device
def cleanup(self, name, uuid, force, failover = 0):
# create an lov
def lov_setup(self, name, uuid, desc_uuid, mdsuuid, stripe_cnt,
- stripe_sz, stripe_off,
- pattern, devlist):
+ stripe_sz, stripe_off, pattern):
cmds = """
attach lov %s %s
- lov_setup %s %d %d %d %s %s
- quit""" % (name, uuid, desc_uuid, stripe_cnt, stripe_sz, stripe_off,
- pattern, devlist)
+ lov_setup %s %d %d %d %s
+ quit""" % (name, uuid, desc_uuid, stripe_cnt, stripe_sz, stripe_off, pattern)
self.run(cmds)
+
+ # add an OBD to a LOV
+ def lov_add_obd(self, name, uuid, obd_uuid, index, gen):
+ cmds = """
+ lov_modify_tgts add %s %s %s %s
+ quit""" % (name, obd_uuid, index, gen)
+ self.run(cmds)
+
# create an lmv
def lmv_setup(self, name, uuid, desc_uuid, devlist):
cmds = """
lmv_setup %s %s
quit""" % (name, uuid, desc_uuid, devlist)
self.run(cmds)
- # create an lov
- def lov_setconfig(self, uuid, mdsuuid, stripe_cnt, stripe_sz, stripe_off,
- pattern, devlist):
+
+ # delete an OBD from a LOV
+ def lov_del_obd(self, name, uuid, obd_uuid, index, gen):
cmds = """
- cfg_device $%s
- lov_setconfig %s %d %d %d %s %s
- quit""" % (mdsuuid, uuid, stripe_cnt, stripe_sz, stripe_off, pattern, devlist)
+ lov_modify_tgts del %s %s %s %s
+ quit""" % (name, obd_uuid, index, gen)
+ self.run(cmds)
+
+ # deactivate an OBD
+ def deactivate(self, name):
+ cmds = """
+ device $%s
+ deactivate
+ quit""" % (name)
self.run(cmds)
# dump the log file
quit""" % (timeout,)
self.run(cmds)
- # delete mount options
def set_lustre_upcall(self, upcall):
cmds = """
set_lustre_upcall %s
modbase = src_dir +'/'+ dev_dir +'/'+ modname
for modext in '.ko', '.o':
module = modbase + modext
- try:
+ try:
if os.access(module, os.R_OK):
return module
except OSError:
if devsize > 1024 * 1024:
jsize = ((devsize / 102400) * 4)
if jsize > 400:
- jsize = 400
+ jsize = 400
if jsize: jopt = "-J size=%d" %(jsize,)
if isize: iopt = "-I %d" %(isize,)
mkfs = 'mkfs.ext2 -j -b 4096 '
# determine if dev is formatted as a <fstype> filesystem
def need_format(fstype, dev):
- # FIXME don't know how to implement this
+ # FIXME don't know how to implement this
return 0
# initialize a block device if needed
# panic("device:", dev,
# "not prepared, and autoformat is not set.\n",
# "Rerun with --reformat option to format ALL filesystems")
-
+
return dev
def if2addr(iface):
else:
local = sys_get_local_address(net_type, wildcard, cluster_id)
return local
-
+
def sys_get_local_address(net_type, wildcard, cluster_id):
"""Return the local address for the network type."""
local = ""
elan_id = a[1]
break
try:
- nid = my_int(cluster_id) + my_int(elan_id)
+ nid = my_int(cluster_id) + my_int(elan_id)
local = "%d" % (nid)
except ValueError, e:
local = elan_id
except IOError, e:
log(e)
return 0
-
+
class kmod:
"""Manage kernel modules"""
self._server = None
self._connected = 0
self.kmod = kmod(config.lustre, config.portals)
-
+
def info(self, *args):
msg = string.join(map(str,args))
print self.module_name + ":", self.name, self.uuid, msg
log(self.module_name, "cleanup failed: ", self.name)
e.dump()
cleanup_error(e.rc)
-
+
def add_portals_module(self, dev_dir, modname):
"""Append a module to list of modules to load."""
self.kmod.add_portals_module(dev_dir, modname)
def load_module(self):
"""Load all the modules in the list in the order they appear."""
self.kmod.load_module()
-
+
def cleanup_module(self):
"""Unload the modules in the list in reverse order."""
if self.safe_to_clean():
def safe_to_clean(self):
return 1
-
+
def safe_to_clean_modules(self):
return self.safe_to_clean()
-
+
class Network(Module):
def __init__(self,db):
Module.__init__(self, 'NETWORK', db)
return "NID_%s_UUID" %(nid,)
def prepare(self):
- if is_network_prepared():
+ if not config.record and is_network_prepared():
return
self.info(self.net_type, self.nid, self.port)
if not (config.record and self.generic_nid):
return None
return Network(srvdb)
-
+
def prepare(self):
- if is_network_prepared():
+ if not config.record and is_network_prepared():
return
self.info()
for net_type, gw, gw_cluster_id, tgt_cluster_id, lo, hi in self.db.get_route_tbl():
self.add_lustre_module('mgmt', 'mgmt_svc')
def prepare(self):
- if is_prepared(self.name):
+ if not config.record and is_prepared(self.name):
return
self.info()
lctl.newdev("mgmt", self.name, self.uuid)
self.stripe_sz = self.db.get_val_int('stripesize', 1048576)
self.stripe_off = self.db.get_val_int('stripeoffset', 0)
self.pattern = self.db.get_val_int('stripepattern', 0)
- self.devlist = self.db.get_refs('obd')
+ self.devlist = self.db.get_lov_tgts('lov_tgt')
self.stripe_cnt = self.db.get_val_int('stripecount', len(self.devlist))
self.osclist = []
self.desc_uuid = self.uuid
self.config_only = 1
return
self.config_only = None
- mds= self.db.lookup(self.mds_uuid)
+ mds = self.db.lookup(self.mds_uuid)
self.mds_name = mds.getName()
- for obd_uuid in self.devlist:
+ for (obd_uuid, index, gen, active) in self.devlist:
+ if obd_uuid == '':
+ continue
obd = self.db.lookup(obd_uuid)
osc = get_osc(obd, self.uuid, fs_name)
if osc:
- self.osclist.append(osc)
+ self.osclist.append((osc, index, gen, active))
else:
panic('osc not found:', obd_uuid)
def get_uuid(self):
def get_name(self):
return self.name
def prepare(self):
- if is_prepared(self.name):
+ if not config.record and is_prepared(self.name):
return
- if self.config_only:
- panic("Can't prepare config_only LOV ", self.name)
-
- for osc in self.osclist:
+ self.info(self.mds_uuid, self.stripe_cnt, self.stripe_sz,
+ self.stripe_off, self.pattern, self.devlist,
+ self.mds_name)
+ lctl.lov_setup(self.name, self.uuid,
+ self.desc_uuid, self.mds_name, self.stripe_cnt,
+ self.stripe_sz, self.stripe_off, self.pattern)
+ for (osc, index, gen, active) in self.osclist:
+ target_uuid = osc.target_uuid
try:
# Only ignore connect failures with --force, which
# isn't implemented here yet.
+ osc.active = active
osc.prepare(ignore_connect_failure=0)
except CommandError, e:
print "Error preparing OSC %s\n" % osc.uuid
raise e
- self.info(self.mds_uuid, self.stripe_cnt, self.stripe_sz,
- self.stripe_off, self.pattern, self.devlist, self.mds_name)
- lctl.lov_setup(self.name, self.uuid,
- self.desc_uuid, self.mds_name, self.stripe_cnt,
- self.stripe_sz, self.stripe_off, self.pattern,
- string.join(self.devlist))
+ lctl.lov_add_obd(self.name, self.uuid, target_uuid, index, gen)
def cleanup(self):
+ for (osc, index, gen, active) in self.osclist:
+ target_uuid = osc.target_uuid
+ osc.cleanup()
if is_prepared(self.name):
Module.cleanup(self)
if self.config_only:
panic("Can't clean up config_only LOV ", self.name)
- for osc in self.osclist:
- osc.cleanup()
def load_module(self):
if self.config_only:
panic("Can't load modules for config_only LOV ", self.name)
- for osc in self.osclist:
+ for (osc, index, gen, active) in self.osclist:
osc.load_module()
break
Module.load_module(self)
if self.config_only:
panic("Can't cleanup modules for config_only LOV ", self.name)
Module.cleanup_module(self)
- for osc in self.osclist:
- osc.cleanup_module()
+ for (osc, index, gen, active) in self.osclist:
+ if active:
+ osc.cleanup_module()
break
def correct_level(self, level, op=None):
def load_module(self):
if self.active:
Module.load_module(self)
-
+
def prepare(self):
- if is_prepared(self.name):
+ if not config.record and is_prepared(self.name):
return
if not self.active:
debug(self.uuid, "not active")
raise e
def write_conf(self):
- if is_prepared(self.name):
- return
- self.info(self.devpath, self.fstype, self.format)
+ do_cleanup = 0
+ if not is_prepared(self.name):
+ self.info(self.devpath, self.fstype, self.format)
- blkdev = block_dev(self.devpath, self.size, self.fstype,
- config.reformat, self.format, self.journal_size,
- self.inode_size, self.mkfsoptions, self.backfstype,
- self.backdevpath)
+ blkdev = block_dev(self.devpath, self.size, self.fstype,
+ config.reformat, self.format, self.journal_size,
+ self.inode_size, self.mkfsoptions,
+ self.backfstype, self.backdevpath)
- # Even for writing logs we mount mds with supplied mount options
- # because it will not mount smfs (if used) otherwise.
-
- mountfsoptions = def_mount_options(self.fstype, 'mds')
-
- if config.mountfsoptions:
- if mountfsoptions:
- mountfsoptions = mountfsoptions + ',' + config.mountfsoptions
- else:
- mountfsoptions = config.mountfsoptions
- if self.mountfsoptions:
- mountfsoptions = mountfsoptions + ',' + self.mountfsoptions
- else:
- if self.mountfsoptions:
+ # Even for writing logs we mount mds with supplied mount options
+ # because it will not mount smfs (if used) otherwise.
+
+ mountfsoptions = def_mount_options(self.fstype, 'mds')
+
+ if config.mountfsoptions:
if mountfsoptions:
- mountfsoptions = mountfsoptions + ',' + self.mountfsoptions
+ mountfsoptions = mountfsoptions + ',' + config.mountfsoptions
else:
- mountfsoptions = self.mountfsoptions
-
- if self.fstype == 'smfs':
- realdev = self.fstype
+ mountfsoptions = config.mountfsoptions
+ if self.mountfsoptions:
+ mountfsoptions = mountfsoptions + ',' + self.mountfsoptions
+ else:
+ if self.mountfsoptions:
+ if mountfsoptions:
+ mountfsoptions = mountfsoptions + ',' + self.mountfsoptions
+ else:
+ mountfsoptions = self.mountfsoptions
+
+ if self.fstype == 'smfs':
+ realdev = self.fstype
- if mountfsoptions:
- mountfsoptions = "%s,type=%s,dev=%s" % (mountfsoptions,
- self.backfstype,
- blkdev)
+ if mountfsoptions:
+ mountfsoptions = "%s,type=%s,dev=%s" % (mountfsoptions,
+ self.backfstype,
+ blkdev)
+ else:
+ mountfsoptions = "type=%s,dev=%s" % (self.backfstype,
+ blkdev)
else:
- mountfsoptions = "type=%s,dev=%s" % (self.backfstype,
- blkdev)
- else:
- realdev = blkdev
+ realdev = blkdev
- print 'MDS mount options: ' + mountfsoptions
-
- # As mount options are passed by 4th param to config tool, we need
- # to pass something in 3rd param. But we do not want this 3rd param
- # be counted as a profile name for reading log on MDS setup, thus,
- # we pass there some predefined sign like 'dumb', which will be
- # checked in MDS code and skipped. Probably there is more nice way
- # like pass empty string and check it in config tool and pass null
- # as 4th param.
- lctl.newdev("mds", self.name, self.uuid,
- setup ="%s %s %s %s" %(realdev, self.fstype,
- 'dumb', mountfsoptions))
+ print 'MDS mount options: ' + mountfsoptions
+
+ # As mount options are passed by 4th param to config tool, we need
+ # to pass something in 3rd param. But we do not want this 3rd param
+ # be counted as a profile name for reading log on MDS setup, thus,
+ # we pass there some predefined sign like 'dumb', which will be
+ # checked in MDS code and skipped. Probably there is more nice way
+ # like pass empty string and check it in config tool and pass null
+ # as 4th param.
+ lctl.newdev("mds", self.name, self.uuid,
+ setup ="%s %s %s %s" %(realdev, self.fstype,
+ 'dumb', mountfsoptions))
+ do_cleanup = 1
+
# record logs for the MDS lov
for uuid in self.filesystem_uuids:
log("recording clients for filesystem:", uuid)
client.prepare()
lctl.mount_option(self.name, client.get_name(), "")
lctl.end_record()
+ process_updates(self.db, self.name, self.name, client)
config.cleanup = 1
lctl.clear_log(self.name, self.name + '-clean')
client.cleanup()
lctl.del_mount_option(self.name)
lctl.end_record()
+ process_updates(self.db, self.name, self.name + '-clean', client)
config.cleanup = 0
config.record = 0
# record logs for each client
+ if config.noexec:
+ noexec_opt = '-n'
+ else:
+ noexec_opt = ''
if config.ldapurl:
config_options = "--ldapurl " + config.ldapurl + " --config " + config.config
else:
debug("recording", client_name)
old_noexec = config.noexec
config.noexec = 0
- noexec_opt = ('', '-n')
- ret, out = run (sys.argv[0],
- noexec_opt[old_noexec == 1],
+ ret, out = run (sys.argv[0], noexec_opt,
" -v --record --nomod",
"--record_log", client_name,
"--record_device", self.name,
config_options)
if config.verbose:
for s in out: log("record> ", string.strip(s))
- ret, out = run (sys.argv[0],
- noexec_opt[old_noexec == 1],
+ ret, out = run (sys.argv[0], noexec_opt,
"--cleanup -v --record --nomod",
"--record_log", client_name + "-clean",
"--record_device", self.name,
if config.verbose:
for s in out: log("record> ", string.strip(s))
config.noexec = old_noexec
- try:
- lctl.cleanup(self.name, self.uuid, 0, 0)
- except CommandError, e:
- log(self.module_name, "cleanup failed: ", self.name)
- e.dump()
- cleanup_error(e.rc)
- Module.cleanup(self)
+ if do_cleanup:
+ try:
+ lctl.cleanup(self.name, self.uuid, 0, 0)
+ except CommandError, e:
+ log(self.module_name, "cleanup failed: ", self.name)
+ e.dump()
+ cleanup_error(e.rc)
+ Module.cleanup(self)
- if self.fstype == 'smfs':
- clean_loop(self.backdevpath)
- else:
- clean_loop(self.devpath)
+ if self.fstype == 'smfs':
+ clean_loop(self.backdevpath)
+ else:
+ clean_loop(self.devpath)
def msd_remaining(self):
out = lctl.device_list()
self.active = 0
if self.active and config.group and config.group != ost.get_val('group'):
self.active = 0
-
+
self.target_dev_uuid = self.uuid
self.uuid = target_uuid
# modules
self.target_name = tgtdb.getName()
self.target_uuid = tgtdb.getUUID()
self.db = tgtdb
+ self.active = 1
self.tgt_dev_uuid = get_active_target(tgtdb)
if not self.tgt_dev_uuid:
def prepare(self, ignore_connect_failure = 0):
self.info(self.target_uuid)
- if is_prepared(self.name):
+ if not config.record and is_prepared(self.name):
self.cleanup()
try:
srv = choose_local_server(self.get_servers())
if not ignore_connect_failure:
raise e
if srv:
- if self.target_uuid in config.inactive and self.permits_inactive():
+ if self.permits_inactive() and (self.target_uuid in config.inactive or self.active == 0):
debug("%s inactive" % self.target_uuid)
inactive_p = "inactive"
else:
def correct_level(self, level, op=None):
return level
+ def deactivate(self):
+ try:
+ lctl.deactivate(self.name)
+ except CommandError, e:
+ log(self.module_name, "deactivate failed: ", self.name)
+ e.dump()
+ cleanup_error(e.rc)
class MDC(Client):
def __init__(self, db, uuid, fs_name):
Client.__init__(self, db, uuid, 'mgmt_cli', '',
self_name = mgmtcli_name_for_uuid(db.getUUID()),
module_dir = 'mgmt')
-
+
class COBD(Module):
def __init__(self, db, uuid, name, type, name_override = None):
Module.__init__(self, 'COBD', db)
def prepare(self):
self.real.prepare()
self.cache.prepare()
- if is_prepared(self.name):
+ if not config.record and is_prepared(self.name):
return
self.info(self.real_uuid, self.cache_uuid)
lctl.newdev("cobd", self.name, self.uuid,
self.osc = VOSC(obd, self.uuid, self.name)
def prepare(self):
- if is_prepared(self.name):
+ if not config.record and is_prepared(self.name):
return
run_acceptors()
self.osc.prepare() # XXX This is so cheating. -p
self.mgmtcli = None
def prepare(self):
- if fs_is_mounted(self.path):
+ if not config.record and fs_is_mounted(self.path):
log(self.path, "already mounted.")
return
run_acceptors()
return srv_list
-# the order of iniitailization is based on level.
+# the order of iniitailization is based on level.
def getServiceLevel(self):
type = self.get_class()
ret=0;
panic("Unknown type: ", type)
if ret < config.minlevel or ret > config.maxlevel:
- ret = 0
+ ret = 0
return ret
#
############################################################
-# MDC UUID hack -
+# MDC UUID hack -
# FIXME: clean this mess up!
#
# OSC is no longer in the xml, so we have to fake it.
if (r[3] <= to and to <= r[4]) and cluster_id == r[2]:
result.append((srv, r))
return result
-
+
def get_active_target(db):
target_uuid = db.getUUID()
target_name = db.getName()
net = Network(n)
if net.nid_uuid == nid_uuid:
return net
-
+
############################################################
# lconf level logic
#
# Prepare the system to run lustre using a particular profile
-# in a the configuration.
+# in a the configuration.
# * load & the modules
# * setup networking for the current node
# * make sure partitions are in place and prepared
panic("profile:", profile, "not found.")
services = getServices(prof_db)
operation(services)
-
+
+def magic_get_osc(db, rec, lov):
+ if lov:
+ lov_uuid = lov.get_uuid()
+ lov_name = lov.osc.fs_name
+ else:
+ lov_uuid = rec.getAttribute('lov_uuidref')
+ # FIXME: better way to find the mountpoint?
+ filesystems = db.root_node.getElementsByTagName('filesystem')
+ fsuuid = None
+ for fs in filesystems:
+ ref = fs.getElementsByTagName('obd_ref')
+ if ref[0].getAttribute('uuidref') == lov_uuid:
+ fsuuid = fs.getAttribute('uuid')
+ break
+
+ if not fsuuid:
+ panic("malformed xml: lov uuid '" + lov_uuid + "' referenced in 'add' record is not used by any filesystems.")
+
+ mtpts = db.root_node.getElementsByTagName('mountpoint')
+ lov_name = None
+ for fs in mtpts:
+ ref = fs.getElementsByTagName('filesystem_ref')
+ if ref[0].getAttribute('uuidref') == fsuuid:
+ lov_name = fs.getAttribute('name')
+ break
+
+ if not lov_name:
+ panic("malformed xml: 'add' record references lov uuid '" + lov_uuid + "', which references filesystem uuid '" + fsuuid + "', which does not reference a mountpoint.")
+
+ print "lov_uuid: " + lov_uuid + "; lov_name: " + lov_name
+
+ ost_uuid = rec.getAttribute('ost_uuidref')
+ obd = db.lookup(ost_uuid)
+
+ if not obd:
+ panic("malformed xml: 'add' record references ost uuid '" + ost_uuid + "' which cannot be found.")
+
+ osc = get_osc(obd, lov_uuid, lov_name)
+ if not osc:
+ panic('osc not found:', obd_uuid)
+ return osc
+
+# write logs for update records. sadly, logs of all types -- and updates in
+# particular -- are something of an afterthought. lconf needs rewritten with
+# these as core concepts. so this is a pretty big hack.
+def process_update_record(db, update, lov):
+ for rec in update.childNodes:
+ if rec.nodeType != rec.ELEMENT_NODE:
+ continue
+
+ log("found "+rec.nodeName+" record in update version " +
+ str(update.getAttribute('version')))
+
+ lov_uuid = rec.getAttribute('lov_uuidref')
+ ost_uuid = rec.getAttribute('ost_uuidref')
+ index = rec.getAttribute('index')
+ gen = rec.getAttribute('generation')
+
+ if not lov_uuid or not ost_uuid or not index or not gen:
+ panic("malformed xml: 'update' record requires lov_uuid, ost_uuid, index, and generation.")
+
+ if not lov:
+ tmplov = db.lookup(lov_uuid)
+ if not tmplov:
+ panic("malformed xml: 'delete' record contains lov UUID '" + lov_uuid + "', which cannot be located.")
+ lov_name = tmplov.getName()
+ else:
+ lov_name = lov.osc.name
+
+ # ------------------------------------------------------------- add
+ if rec.nodeName == 'add':
+ if config.cleanup:
+ lctl.lov_del_obd(lov_name, lov_uuid, ost_uuid, index, gen)
+ continue
+
+ osc = magic_get_osc(db, rec, lov)
+
+ try:
+ # Only ignore connect failures with --force, which
+ # isn't implemented here yet.
+ osc.prepare(ignore_connect_failure=0)
+ except CommandError, e:
+ print "Error preparing OSC %s\n" % osc.uuid
+ raise e
+
+ lctl.lov_add_obd(lov_name, lov_uuid, ost_uuid, index, gen)
+
+ # ------------------------------------------------------ deactivate
+ elif rec.nodeName == 'deactivate':
+ if config.cleanup:
+ continue
+
+ osc = magic_get_osc(db, rec, lov)
+
+ try:
+ osc.deactivate()
+ except CommandError, e:
+ print "Error deactivating OSC %s\n" % osc.uuid
+ raise e
+
+ # ---------------------------------------------------------- delete
+ elif rec.nodeName == 'delete':
+ if config.cleanup:
+ continue
+
+ osc = magic_get_osc(db, rec, lov)
+
+ try:
+ config.cleanup = 1
+ osc.cleanup()
+ config.cleanup = 0
+ except CommandError, e:
+ print "Error cleaning up OSC %s\n" % osc.uuid
+ raise e
+
+ lctl.lov_del_obd(lov_name, lov_uuid, ost_uuid, index, gen)
+
+def process_updates(db, log_device, log_name, lov = None):
+ updates = db.root_node.getElementsByTagName('update')
+ for u in updates:
+ if not u.childNodes:
+ log("ignoring empty update record (version " +
+ str(u.getAttribute('version')) + ")")
+ continue
+
+ version = u.getAttribute('version')
+ real_name = "%s-%s" % (log_name, version)
+ lctl.clear_log(log_device, real_name)
+ lctl.record(log_device, real_name)
+
+ process_update_record(db, u, lov)
+
+ lctl.end_record()
+
def doWriteconf(services):
- if config.nosetup:
- return
+ #if config.nosetup:
+ # return
for s in services:
if s[1].get_class() == 'mdsdev':
n = newService(s[1])
nlist.sort()
for n in nlist:
n[1].prepare()
-
+
def doModules(services):
if config.nomod:
return
n.cleanup_module()
#
-# Load profile for
+# Load profile for
def doHost(lustreDB, hosts):
global is_router, local_node_name
node_db = None
timeout = node_db.get_val_int('timeout', 0)
ptldebug = node_db.get_val('ptldebug', '')
subsystem = node_db.get_val('subsystem', '')
-
+
find_local_clusters(node_db)
if not is_router:
find_local_routes(lustreDB)
base = os.path.dirname(cmd)
if development_mode():
if not config.lustre:
- debug('using objdir module paths')
+ debug('using objdir module paths')
config.lustre = (os.path.join(base, ".."))
# normalize the portals dir, using command line arg if set
if config.portals:
debug('config.portals', config.portals)
elif config.lustre and config.portals:
# production mode
- # if --lustre and --portals, normalize portals
+ # if --lustre and --portals, normalize portals
# can ignore POTRALS_DIR here, since it is probly useless here
config.portals = os.path.join(config.lustre, config.portals)
debug('config.portals B', config.portals)
fp = open(path, 'w')
fp.write('%d\n' %(max))
fp.close()
-
-
+
+
def sys_make_devices():
if not os.access('/dev/portals', os.R_OK):
run('mknod /dev/portals c 10 240')
if new_dir in syspath:
return
os.environ['PATH'] = os.environ['PATH'] + ':' + new_dir
-
+
def default_debug_path():
path = '/tmp/lustre-log'
if os.path.isdir('/r'):
PARAM),
('minlevel', "Minimum level of services to configure/cleanup",
INTPARAM, 0),
- ('maxlevel', """Maximum level of services to configure/cleanup
+ ('maxlevel', """Maximum level of services to configure/cleanup
Levels are aproximatly like:
10 - netwrk
20 - device, ldlm
('inactive', """The name of an inactive service, to be ignored during
mounting (currently OST-only). Can be repeated.""",
PARAMLIST),
- ]
+ ]
def main():
global lctl, config, toplustreDB, CONFIG_FILE
# in the upcall this is set to SIG_IGN
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
-
+
cl = Lustre.Options("lconf", "config.xml", lconf_options)
try:
config, args = cl.parse(sys.argv[1:])
random.seed(seed)
sanitise_path()
-
+
init_select(config.select)
if len(args) > 0:
doHost(lustreDB, node_list)
- if config.record:
- lctl.end_record()
+ if not config.record:
+ return
+
+ lctl.end_record()
+
+ process_updates(db, config.record_device, config.record_log)
if __name__ == "__main__":
try:
{"detach", jt_obd_detach, 0,
"remove driver (and name and uuid) from current device\n"
"usage: detach"},
- {"lov_setup", jt_lcfg_lov_setup, 0,
- "write setup an lov device\n"
- "usage: lov_setconfig lov-uuid stripe-count stripe-size offset pattern UUID1 [UUID2 ...]"},
+ {"lov_setup", jt_lcfg_lov_setup, 0, "create a LOV device\n"
+ "usage: lov_setup lov-uuid stripe-count stripe-size offset pattern"},
{"lmv_setup", jt_lcfg_lmv_setup, 0,
- "write setup an lmv device\n"
- "usage: lmv_setconfig lmv-uuid UUID1 [UUID2 ...]"},
+ "create an LMV device\n"
+ "usage: lmv_setup lmv-uuid UUID1 [UUID2 ...]"},
+ {"lov_modify_tgts", jt_lcfg_lov_modify_tgts, 0,
+ "add or delete an obd to/from a LOV device\n"
+ "usage: lov_modify_tgts add|del <lov-name> <uuid> <index> <gen>"},
{"lov_getconfig", jt_obd_lov_getconfig, 0,
"read lov configuration from an mds device\n"
"usage: lov_getconfig lov-uuid"},
except ImportError:
stream.write(doc.toxml())
stream.write("\n")
-
+
PYMOD_DIR = "/usr/lib/lustre/python"
import Lustre
-DEFAULT_PORT = 988
+DEFAULT_PORT = 988
DEFAULT_STRIPE_SZ = 1048576
DEFAULT_STRIPE_CNT = 1
DEFAULT_STRIPE_PATTERN = 0
--add net
--node node_name
--nid nid
- --cluster_id
+ --cluster_id
--nettype tcp|elan|gm
--hostaddr addr
--port port
--ost ost_name
--failover
--lov lov_name
+ --index index
--dev path
--backdev path
--size size
--mountfsoptions options
--nspath
+--delete ost
+ --node node_name
+ --ost ost_name
+--deactivate ost
+ --node node_name
+ --ost ost_name
+
--add mtpt - Mountpoint
--node node_name
--path /mnt/point
--node node_name
--real_obd obd_name
--cache_obd obd_name
+
+--commit - Close a configuration version, and start a new one
"""
PARAM = Lustre.Options.PARAM
lmc_options = [
# lmc input/output options
- ('reference', "Print short reference for commands."),
+ ('reference', "Print short reference for commands."),
('verbose,v', "Print system commands as they are run."),
('merge,m', "Append to the specified config file.", PARAM),
('output,o', "Write XML configuration into given output file. Overwrite existing content.", PARAM),
# commands
('add', "", PARAM),
-
+ ('delete', "", PARAM),
+ ('deactivate', "", PARAM),
+ ('commit', "Commit all config changes and start a new version"),
+
# node options
('node', "Add a new node in the cluster configuration.", PARAM),
('timeout', "Set timeout to initiate recovery.", PARAM),
('ptldebug', "Set the portals debug level", PARAM),
('subsystem', "Specify which Lustre subsystems have debug output recorded in the log", PARAM),
- # network
+ # network
('nettype', "Specify the network type. This can be tcp/elan/gm.", PARAM),
('nid', "Give the network ID, e.g ElanID/IP Address as used by portals.", PARAM),
('tcpbuf', "Optional argument to specify the TCP buffer size.", PARAM, "0"),
# lov
('lov', "Specify LOV name.", PARAM,""),
+ ('index', "Specify index for OBD in LOV target table.", PARAM),
('stripe_sz', "Specify the stripe size in bytes.", PARAM),
('stripe_cnt', "Specify the number of OSTs each file should be striped on.", PARAM, 0),
('stripe_pattern', "Specify the stripe pattern. RAID 0 is the only one currently supported.", PARAM, 0),
print msg
sys.exit(1)
-
+
def warning(*args):
msg = string.join(map(str,args))
print "Warning: ", msg
-
+
#
# manage names and uuids
# need to initialize this by walking tree to ensure
ref = self.doc.createElement(tag)
ref.setAttribute("uuidref", uuid)
return ref
-
+
def newService(self, tag, name, uuid):
""" create a new service elmement, which requires name and uuid attributes """
new = self.doc.createElement(tag)
new.setAttribute("uuid", uuid);
new.setAttribute("name", name);
return new
-
+
def addText(self, node, str):
txt = self.doc.createTextNode(str)
node.appendChild(txt)
self.addElement(network, "recvmem", "%d" %(tcpbuf))
if irq_aff:
self.addElement(network, "irqaffinity", "%d" %(irq_aff))
-
+
return network
def routetbl(self, name, uuid):
"""create <routetbl> node"""
rtbl = self.newService("routetbl", name, uuid)
return rtbl
-
+
def route(self, gw_net_type, gw, gw_cluster_id, tgt_cluster_id, lo, hi):
""" create one entry for the route table """
ref = self.doc.createElement('route')
if hi:
ref.setAttribute("hi", hi)
return ref
-
+
def profile(self, name, uuid):
""" create a host """
profile = self.newService("profile", name, uuid)
lov.setAttribute("stripepattern", str(pattern))
return lov
+ def lov_tgt(self, obd_uuid, index, generation):
+ tgt = self.doc.createElement('lov_tgt')
+ tgt.setAttribute("uuidref", obd_uuid)
+ tgt.setAttribute("index", index)
+ tgt.setAttribute("generation", generation)
+ tgt.setAttribute("active", '1')
+ return tgt
+
def lovconfig(self, name, uuid, lov_uuid):
lovconfig = self.newService("lovconfig", name, uuid)
lovconfig.appendChild(self.ref("lov", lov_uuid))
if mgmt_uuid:
fs.appendChild(self.ref("mgmt", mgmt_uuid))
return fs
-
+
def echo_client(self, name, uuid, osc_uuid):
ec = self.newService("echoclient", name, uuid)
ec.appendChild(self.ref("obd", osc_uuid))
return ec
+ def update(self, version):
+ new = self.doc.createElement("update")
+ new.setAttribute("version", version)
+ return new
+
+ def add(self, lov, ost, index, gen):
+ new = self.doc.createElement("add")
+ new.setAttribute("lov_uuidref", lov)
+ new.setAttribute("ost_uuidref", ost)
+ new.setAttribute("index", index)
+ new.setAttribute("generation", gen)
+ return new
+
+ def delete(self, lov, ost, index, gen, options):
+ if options.delete:
+ new = self.doc.createElement("delete")
+ else:
+ new = self.doc.createElement("deactivate")
+ new.setAttribute("lov_uuidref", lov)
+ new.setAttribute("ost_uuidref", ost)
+ new.setAttribute("index", index)
+ new.setAttribute("generation", gen)
+ return new
+
############################################################
# Utilities to query a DOM tree
# Using this functions we can treat use config information
def getUUID(node):
return node.getAttribute('uuid')
+def findLastUpdate(lustre):
+ node = None
+ version = 0
+ for n in lustre.childNodes:
+ if n.nodeType == n.ELEMENT_NODE:
+ if n.nodeName != 'update':
+ continue
+ tmp = int(n.getAttribute('version'))
+ if not tmp:
+ error('malformed XML: update tag without a version attribute')
+ if tmp != version + 1:
+ error('malformed XML: expecting update record '+str(version + 1)+', found '+str(tmp)+'.')
+ version = tmp
+ node = n
+ return node
+
+def addUpdate(gen, lustre, node):
+ update = findLastUpdate(lustre)
+ if not update:
+ return
+ #add_record = update.getElementsByTagName('add')
+ #if not add_record:
+ # add_record = gen.add()
+ # update.appendChild(add_record)
+ #else:
+ # add_record = add_record[0]
+ #add_record.appendChild(node)
+ update.appendChild(node)
+
+def delUpdate(gen, lustre, node):
+ update = findLastUpdate(lustre)
+ if not update:
+ return
+ update.appendChild(node)
def findByName(lustre, name, tag = ""):
for n in lustre.childNodes:
else:
return ""
return getUUID(ret)
-
+
def lookup_filesystem(lustre, mds_uuid, ost_uuid):
for n in lustre.childNodes:
if n.nodeType == n.ELEMENT_NODE and n.nodeName == 'filesystem':
return getUUID(net[0])
return None
+def lov_add_obd(gen, lustre, lov, osc_uuid, options):
+ lov_name = getName(lov)
+ if options.index:
+ lov_index = get_option_int(options, 'index')
+ for tgt in lustre.getElementsByTagName('lov_tgt'):
+ if str(lov_index) == tgt.getAttribute('index'):
+ uuidref = tgt.getAttribute('uuidref')
+ if uuidref != '':
+ raise OptionError("%s --index %d is still in use: %s" %
+ (lov_name, lov_index, uuidref))
+ tgt.setAttribute('uuidref', osc_uuid)
+ gener = int(tgt.getAttribute('generation')) + 1
+ tgt.setAttribute('generation', str(gener))
+ addUpdate(gen, lustre, gen.add(getUUID(lov), osc_uuid,
+ str(lov_index), str(gener)))
+ return
+ lov.appendChild(gen.lov_tgt(osc_uuid, str(lov_index), '1'))
+ addUpdate(gen, lustre, gen.add(getUUID(lov), osc_uuid, str(lov_index),
+ str(gener)))
+ return
+
+ index = -1
+ for tgt in lustre.getElementsByTagName('lov_tgt'):
+ uuidref = tgt.getAttribute('uuidref')
+ tmp = int(tgt.getAttribute('index'))
+ if tmp != index + 1:
+ error('malformed xml: LOV targets are not ordered; found index '+str(tmp)+', expected '+str(index + 1)+'.')
+ index = tmp
+
+ lov.appendChild(gen.lov_tgt(osc_uuid, str(index + 1), '1'))
+ addUpdate(gen, lustre, gen.add(getUUID(lov), osc_uuid, str(index + 1), '1'))
+
+def lov_del_obd(gen, lustre, lov, osc_uuid, options):
+ lov_name = getName(lov)
+ if options.index:
+ lov_index = get_option_int(options, 'index')
+ for tgt in lustre.getElementsByTagName('lov_tgt'):
+ index = tgt.getAttribute('index')
+ if index == lov_index:
+ uuidref = tgt.getAttribute('uuidref')
+ if uuidref != osc_uuid:
+ raise OptionError("%s --index %d contains %s, not %s" %
+ (lov_name, lov_index, osc_uuid, uuidref))
+ if options.delete:
+ tgt.setAttribute('uuidref', '')
+ else:
+ tgt.setAttribute('active', '0')
+ # bump the generation just in case...
+ gen = int(tgt.getAttribute('generation')) + 1
+ tgt.setAttribute('generation', str(gen))
+ return
+ raise OptionError("%s --index %d not in use by %s." %
+ (lov_name, lov_index, osc_uuid))
+
+ for tgt in lustre.getElementsByTagName('lov_tgt'):
+ uuidref = tgt.getAttribute('uuidref')
+ if uuidref == osc_uuid:
+ genera = int(tgt.getAttribute('generation'))
+ delete_rec = gen.delete(getUUID(lov),
+ osc_uuid,tgt.getAttribute('index'),
+ str(genera), options)
+ delUpdate(gen, lustre, delete_rec)
+
+ if options.delete:
+ tgt.setAttribute('uuidref', '')
+ else:
+ tgt.setAttribute('active', '0')
+ genera = genera + 1
+ tgt.setAttribute('generation', str(genera))
-def lov_add_obd(gen, lov, osc_uuid):
- lov.appendChild(gen.ref("obd", osc_uuid))
-
def lmv_add_obd(gen, lmv, mdc_uuid):
lmv.appendChild(gen.ref("mds", mdc_uuid))
if ref == uuid:
return 1
return 0
-
+
# ensure that uuid is not already in the profile
# return true if uuid is added
def node_add_profile(gen, node, ref, uuid):
return 0
profile.appendChild(gen.ref(ref, uuid))
return 1
-
+
def get_attr(dom_node, attr, default=""):
v = dom_node.getAttribute(attr)
if v:
if default_upcall or options.lustre_upcall:
if options.lustre_upcall:
gen.addElement(node, 'lustreUpcall', options.lustre_upcall)
- else:
+ else:
gen.addElement(node, 'lustreUpcall', default_upcall)
if default_upcall or options.portals_upcall:
if options.portals_upcall:
node_add_profile(gen, node, 'ldlm', ldlm_uuid)
set_node_options(gen, node, options)
+
return node
-
+
def add_node(gen, lustre, options):
""" create a node with a network config """
node = findByName(lustre, node_name, "node")
if not node:
error (node_name, " not found.")
-
+
rlist = node.getElementsByTagName('routetbl')
if len(rlist) > 0:
rtbl = rlist[0]
size, journal_size, inode_size, nspath, mkfsoptions,
mountfsoptions, backfstype, backdevname, lmv_uuid)
lustre.appendChild(mdd)
-
+
def add_mgmt(gen, lustre, options):
node_name = get_option(options, 'node')
inode_size = get_option(options, 'inode_size')
mkfsoptions = get_option(options, 'mkfsoptions')
mountfsoptions = get_option(options, 'mountfsoptions')
-
+
nspath = get_option(options, 'nspath')
ostname = get_option(options, 'ost')
ost = gen.ost(ostname, ost_uuid, osd_uuid, options.group)
lustre.appendChild(ost)
+
if lovname:
lov = findByName(lustre, lovname, "lov")
if not lov:
error('add_ost:', '"'+lovname+'"', "lov element not found.")
- lov_add_obd(gen, lov, ost_uuid)
+ lov_add_obd(gen, lustre, lov, ost_uuid, options)
else:
ost = lookup(lustre, ost_uuid)
if options.failover:
ost.setAttribute('failover', "1")
-
+
osd = gen.osd(osdname, osd_uuid, fstype, osdtype, devname,
get_format_flag(options), ost_uuid, node_uuid, size,
node_add_profile(gen, node, 'osd', osd_uuid)
lustre.appendChild(osd)
-
+def del_ost(gen, lustre, options):
+ ostname = get_option(options, 'ost')
+ if not ostname:
+ raise OptionError("del_ost: --ost requires a <ost name>")
+ ost = findByName(lustre, ostname, "ost")
+ if not ost:
+ error('del_ost: ', 'Unable to find ', ostname)
+ ost_uuid = name2uuid(lustre, ostname, fatal=0)
+ if not ost_uuid:
+ error('del_ost: ', 'Unable to find uuid for ', ostname)
+ lovname = get_option(options, 'lov')
+ if lovname:
+ lov = findByName(lustre, lovname, "lov")
+ if not lov:
+ error('del_ost:', '"'+lovname+'"', "lov element not found.")
+ lov_del_obd(gen, lustre, lov, ost_uuid, options)
+ # if the user specified a speficic LOV don't delete the OST itself
+ return
+
+ # remove OSD references from all LOVs
+ for n in lustre.getElementsByTagName('lov'):
+ lov_del_obd(gen, lustre, n, ost_uuid, options)
+ return
+ # delete the OSDs
+ for osd in lustre.getElementsByTagName('osd'):
+ if ref_exists(osd, ost_uuid):
+ osd_uuid = osd.getAttribute('uuid')
+ # delete all profile references to this OSD
+ for profile in lustre.getElementsByTagName('profile'):
+ for osd_ref in profile.getElementsByTagName('osd_ref'):
+ if osd_uuid == osd_ref.getAttribute('uuidref'):
+ profile.removeChild(osd_ref)
+ lustre.removeChild(osd)
+
+ # delete the OST
+ lustre.removeChild(ost)
+
def add_cobd(gen, lustre, options):
node_name = get_option(options, 'node')
name = get_option(options, 'cobd')
real_name = get_option(options, 'real_obd')
cache_name = get_option(options, 'cache_obd')
-
+
real_uuid = name2uuid(lustre, real_name, tag='lov', fatal=0)
cache_uuid = name2uuid(lustre, cache_name, tag='lov', fatal=0)
lov = gen.lov(name, uuid, mds_uuid, stripe_sz, stripe_cnt, pattern)
lustre.appendChild(lov)
-
+
# add an lovconfig entry to the active mdsdev profile
lovconfig_name = new_name('LVCFG_' + name)
lovconfig_uuid = new_uuid(lovconfig_name)
def add_default_lov(gen, lustre, mds_name, lov_name):
""" create a default lov """
-
+
stripe_sz = DEFAULT_STRIPE_SZ
stripe_cnt = DEFAULT_STRIPE_CNT
pattern = DEFAULT_STRIPE_PATTERN
uuid = new_uuid(lov_name)
-
+
ret = findByName(lustre, lov_name, "lov")
if ret:
error("LOV: ", lov_name, " already exists.")
-
+
mds_uuid = name2uuid(lustre, mds_name, 'mds')
lov = gen.lov(lov_name, uuid, mds_uuid, stripe_sz, stripe_cnt, pattern)
lustre.appendChild(lov)
-
+
# add an lovconfig entry to the active mdsdev profile
lovconfig_name = new_name('LVCFG_' + lov_name)
lovconfig_uuid = new_uuid(lovconfig_name)
if not fs_uuid:
fs_uuid = new_filesystem(gen, lustre, mds_uuid, obd_uuid, mgmt_uuid)
return fs_uuid
-
+
def add_mtpt(gen, lustre, options):
""" create mtpt on a node """
node_name = get_option(options, 'node')
if not ost_uuid:
error('add_mtpt:', '"'+ost_name+'"', "ost element not found.")
lov = findByName(lustre, lov_name, "lov")
- lov_add_obd(gen, lov, ost_uuid)
+ lov_add_obd(gen, lustre, lov, ost_uuid, options)
if fs_name == '':
mgmt_name = get_option(options, 'mgmt')
node_add_profile(gen, node, "mountpoint", uuid)
lustre.appendChild(mtpt)
+def commit_version(gen, lustre):
+ update = findLastUpdate(lustre)
+ if update:
+ version = int(update.getAttribute("version")) + 1
+ else:
+ version = 1
+
+ new = gen.update(str(version))
+ lustre.appendChild(new)
+
+
############################################################
# Command line processing
#
try:
n = int(val)
except ValueError:
- raise OptionError("--%s <num> (value must be integer)" % (tag))
+ raise OptionError("--%s <num> (value must be integer)" % (tag))
return n
# simple class for profiling
# function cmdlinesplit used to split cmd line from batch file
#
def cmdlinesplit(cmdline):
-
+
double_quote = re.compile(r'"(([^"\\]|\\.)*)"')
single_quote = re.compile(r"'(.*?)'")
escaped = re.compile(r'\\(.)')
esc_quote = re.compile(r'\\([\\"])')
- outside = re.compile(r"""([^\s\\'"]+)""")
-
+ outside = re.compile(r"""([^\s\\'"]+)""") #" fucking emacs.
+
arg_list = []
i = 0; arg = None
while i < len(cmdline):
i = match.end()
if arg is None: arg = esc_quote.sub(r'\1', match.group(1))
else: arg = arg + esc_quote.sub(r'\1', match.group(1))
-
+
elif c == "'":
match = single_quote.match(cmdline, i)
if not match:
i = match.end()
if arg is None: arg = match.group(1)
else: arg = arg + match.group(1)
-
+
elif c == "\\":
match = escaped.match(cmdline, i)
if not match:
i = match.end()
if arg is None: arg = match.group(1)
else: arg = arg + match.group(1)
-
+
elif c in string.whitespace:
if arg != None:
arg_list.append(str(arg))
i = match.end()
if arg is None: arg = match.group()
else: arg = arg + match.group()
-
+
if arg != None: arg_list.append(str(arg))
-
+
return arg_list
############################################################
add_lmv(gen, lustre, options)
else:
error("unknown device type:", devtype)
-
+
+def delete(devtype, gen, lustre, options):
+ if devtype == 'ost':
+ del_ost(gen, lustre, options)
+ elif options.delete:
+ error("delete not supported for device type:", devtype)
+ elif options.deactivate:
+ error("deactivate not supported for device type:", devtype)
+ else:
+ error("in delete(), but neither .delete nor .deactivate are set. Tell CFS.")
+
+def commit(gen, lustre):
+ commit_version(gen, lustre)
+
def do_command(gen, lustre, options, args):
if options.add:
add(options.add, gen, lustre, options)
+ elif options.delete:
+ delete(options.delete, gen, lustre, options)
+ elif options.deactivate:
+ delete(options.deactivate, gen, lustre, options)
+ elif options.commit:
+ commit(gen, lustre)
else:
error("Missing command")
lcfg.lcfg_dev_name = argv[2];
} else {
fprintf(stderr, "error: %s: LCFG_ATTACH requires a name\n",
- jt_cmdname(argv[0]));
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'cfg_device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'cfg_device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'cfg_device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (argc < 1 || argc > 3)
return CMD_HELP;
- for (n = 1; n < argc; n++)
+ for (n = 1; n < argc; n++)
if (strcmp(argv[n], "force") == 0) {
flags[flag_cnt++] = force;
} else if (strcmp(argv[n], "failover") == 0) {
return rc;
}
-static
-int do_add_uuid(char * func, char *uuid, ptl_nid_t nid, int nal)
+static
+int do_add_uuid(char * func, char *uuid, ptl_nid_t nid, int nal)
{
char tmp[64];
int rc;
{
ptl_nid_t nid = 0;
int nal;
-
- if (argc != 4) {
+
+ if (argc != 4) {
return CMD_HELP;
}
lcfg.lcfg_inllen1 = strlen(argv[1]) + 1;
lcfg.lcfg_inlbuf1 = argv[1];
}
-
+
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
if (rc) {
fprintf(stderr, "IOC_PORTAL_DEL_UUID failed: %s\n",
{
struct lustre_cfg lcfg;
struct lov_desc desc;
- struct obd_uuid *uuidarray, *ptr;
- int rc, i;
+ int rc;
char *end;
- LCFG_INIT(lcfg, LCFG_SETUP, lcfg_devname);
-
- if (argc <= 6)
+ /* argv: lov_setup <LOV uuid> <stripe count> <stripe size>
+ * <stripe offset> <pattern> [ <max tgt index> ]
+ */
+ if (argc < 6 || argc > 7)
return CMD_HELP;
if (strlen(argv[1]) > sizeof(desc.ld_uuid) - 1) {
memset(&desc, 0, sizeof(desc));
obd_str2uuid(&desc.ld_uuid, argv[1]);
- desc.ld_tgt_count = argc - 6;
desc.ld_default_stripe_count = strtoul(argv[2], &end, 0);
if (*end) {
fprintf(stderr, "error: %s: bad default stripe count '%s'\n",
jt_cmdname(argv[0]), argv[2]);
return CMD_HELP;
}
- if (desc.ld_default_stripe_count > desc.ld_tgt_count) {
- fprintf(stderr,
- "error: %s: default stripe count %u > OST count %u\n",
- jt_cmdname(argv[0]), desc.ld_default_stripe_count,
- desc.ld_tgt_count);
- return -EINVAL;
- }
desc.ld_default_stripe_size = strtoull(argv[3], &end, 0);
if (*end) {
return CMD_HELP;
}
- /* NOTE: it is possible to overwrite the default striping parameters,
- * but EXTREME care must be taken when saving the OST UUID list.
- * It must be EXACTLY the same, or have only additions at the
- * end of the list, or only overwrite individual OST entries
- * that are restored from backups of the previous OST.
- */
- uuidarray = calloc(desc.ld_tgt_count, sizeof(*uuidarray));
- if (!uuidarray) {
- fprintf(stderr, "error: %s: no memory for %d UUIDs\n",
- jt_cmdname(argv[0]), desc.ld_tgt_count);
- rc = -ENOMEM;
- goto out;
- }
- for (i = 6, ptr = uuidarray; i < argc; i++, ptr++) {
- if (strlen(argv[i]) >= sizeof(*ptr)) {
- fprintf(stderr, "error: %s: arg %d (%s) too long\n",
- jt_cmdname(argv[0]), i, argv[i]);
- rc = -EINVAL;
- goto out;
+ if (argc == 7) {
+ desc.ld_tgt_count = strtoul(argv[6], &end, 0);
+ if (*end) {
+ fprintf(stderr, "error: %s: bad target count '%s'\n",
+ jt_cmdname(argv[0]), argv[6]);
+ return CMD_HELP;
+ }
+ if (desc.ld_default_stripe_count > desc.ld_tgt_count) {
+ fprintf(stderr,
+ "error: %s: default stripe count %u > "
+ "OST count %u\n", jt_cmdname(argv[0]),
+ desc.ld_default_stripe_count,
+ desc.ld_tgt_count);
+ return -EINVAL;
}
- strcpy((char *)ptr, argv[i]);
}
+ LCFG_INIT(lcfg, LCFG_SETUP, lcfg_devname);
+
lcfg.lcfg_inllen1 = sizeof(desc);
lcfg.lcfg_inlbuf1 = (char *)&desc;
- lcfg.lcfg_inllen2 = desc.ld_tgt_count * sizeof(*uuidarray);
- lcfg.lcfg_inlbuf2 = (char *)uuidarray;
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
if (rc)
fprintf(stderr, "error: %s: ioctl error: %s\n",
jt_cmdname(argv[0]), strerror(rc = errno));
-out:
- free(uuidarray);
return rc;
}
return rc;
}
+int jt_lcfg_lov_modify_tgts(int argc, char **argv)
+{
+ struct lustre_cfg lcfg;
+ char *end;
+ int index;
+ int gen;
+ int rc;
+
+ /* argv: lov_modify_tgts <op> <LOV name> <OBD uuid> <index> <gen> */
+ if (argc != 6)
+ return CMD_HELP;
+
+ if (!strncmp(argv[1], "add", 4)) {
+ LCFG_INIT(lcfg, LCFG_LOV_ADD_OBD, argv[2]);
+ } else if (!strncmp(argv[1], "del", 4)) {
+ LCFG_INIT(lcfg, LCFG_LOV_DEL_OBD, argv[2]);
+ } else {
+ fprintf(stderr, "error: %s: bad operation '%s'\n",
+ jt_cmdname(argv[0]), argv[1]);
+ return CMD_HELP;
+ }
+
+ lcfg.lcfg_inlbuf1 = argv[3];
+ lcfg.lcfg_inllen1 = strlen(lcfg.lcfg_inlbuf1) + 1;
+ if (lcfg.lcfg_inllen1 > sizeof(struct obd_uuid)) {
+ fprintf(stderr,
+ "error: %s: OBD uuid '%s' longer than "LPSZ" chars\n",
+ jt_cmdname(argv[0]), argv[3],
+ sizeof(struct obd_uuid) - 1);
+ return -EINVAL;
+ }
+
+ index = strtoul(argv[4], &end, 0);
+ if (*end) {
+ fprintf(stderr, "error: %s: bad OBD index '%s'\n",
+ jt_cmdname(argv[0]), argv[4]);
+ return CMD_HELP;
+ }
+ lcfg.lcfg_inlbuf2 = argv[4];
+ lcfg.lcfg_inllen2 = strlen(lcfg.lcfg_inlbuf2);
+
+ gen = strtoul(argv[5], &end, 0);
+ if (*end) {
+ fprintf(stderr, "error: %s: bad OBD generation '%s'\n",
+ jt_cmdname(argv[0]), argv[5]);
+ return CMD_HELP;
+ }
+ lcfg.lcfg_inlbuf3 = argv[5];
+ lcfg.lcfg_inllen3 = strlen(lcfg.lcfg_inlbuf3);
+
+ rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
+ if (rc)
+ fprintf(stderr, "error: %s: ioctl error: %s\n",
+ jt_cmdname(argv[0]), strerror(rc = errno));
+
+ return rc;
+}
+
int jt_lcfg_mount_option(int argc, char **argv)
{
int rc;
return CMD_HELP;
lcfg.lcfg_num = atoi(argv[1]);
-
+
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
if (rc < 0) {
fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
FILE *fp = fopen(DEVICES_LIST, "r");
if (fp == NULL) {
- fprintf(stderr, "error: %s: %s opening "DEVICES_LIST"\n",
+ fprintf(stderr, "error: %s: %s could not open file "
+ DEVICES_LIST " .\n",
jt_cmdname(argv[0]), strerror(rc = errno));
return rc;
}
struct obd_ioctl_data data;
struct lov_desc desc;
struct obd_uuid *uuidarray;
+ __u32 *obdgens;
char *path;
int rc, fd;
if (fd < 0) {
fprintf(stderr, "open \"%s\" failed: %s\n", path,
strerror(errno));
- return -1;
+ return -errno;
}
memset(&desc, 0, sizeof(desc));
obd_str2uuid(&desc.ld_uuid, argv[1]);
desc.ld_tgt_count = ((OBD_MAX_IOCTL_BUFFER-sizeof(data)-sizeof(desc)) /
- sizeof(*uuidarray));
+ (sizeof(*uuidarray) + sizeof(*obdgens)));
repeat:
uuidarray = calloc(desc.ld_tgt_count, sizeof(*uuidarray));
rc = -ENOMEM;
goto out;
}
+ obdgens = calloc(desc.ld_tgt_count, sizeof(*obdgens));
+ if (!obdgens) {
+ fprintf(stderr, "error: %s: no memory for %d generation #'s\n",
+ jt_cmdname(argv[0]), desc.ld_tgt_count);
+ rc = -ENOMEM;
+ goto out_uuidarray;
+ }
data.ioc_inllen1 = sizeof(desc);
data.ioc_inlbuf1 = (char *)&desc;
data.ioc_inllen2 = desc.ld_tgt_count * sizeof(*uuidarray);
data.ioc_inlbuf2 = (char *)uuidarray;
+ data.ioc_inllen3 = desc.ld_tgt_count * sizeof(*obdgens);
+ data.ioc_inlbuf3 = (char *)obdgens;
if (obd_ioctl_pack(&data, &buf, max)) {
fprintf(stderr, "error: %s: invalid ioctl\n",
jt_cmdname(argv[0]));
rc = -EINVAL;
- goto out;
+ goto out_obdgens;
}
rc = ioctl(fd, OBD_IOC_LOV_GET_CONFIG, buf);
if (rc == -ENOSPC) {
free(uuidarray);
+ free(obdgens);
goto repeat;
} else if (rc) {
fprintf(stderr, "error: %s: ioctl error: %s\n",
jt_cmdname(argv[0]), strerror(rc = errno));
} else {
- struct obd_uuid *ptr;
+ struct obd_uuid *uuidp;
+ __u32 *genp;
int i;
if (obd_ioctl_unpack(&data, buf, max)) {
desc.ld_default_stripe_offset);
printf("default_stripe_pattern: %u\n", desc.ld_pattern);
printf("obd_count: %u\n", desc.ld_tgt_count);
- for (i = 0, ptr = uuidarray; i < desc.ld_tgt_count; i++, ptr++)
- printf("%u: %s\n", i, (char *)ptr);
- }
-out:
+ printf("OBDS:\tobdidx\t\tobdgen\t\t obduuid\n");
+ uuidp = uuidarray;
+ genp = obdgens;
+ for (i = 0; i < desc.ld_tgt_count; i++, uuidp++, genp++)
+ printf("\t%6u\t%14u\t\t %s\n", i, *genp, (char *)uuidp);
+ }
+out_obdgens:
+ free(obdgens);
+out_uuidarray:
free(uuidarray);
+out:
close(fd);
return rc;
}
return CMD_HELP;
if (!jt_recording) {
- fprintf(stderr, "Not recording, so endrecord doesn't make sense.\n");
+ fprintf(stderr, "Not recording, so endrecord doesn't make "
+ "sense.\n");
return 0;
}
IOC_INIT(data);
data.ioc_inllen1 = max - size_round(sizeof(data));
IOC_PACK(argv[0], data);
-
+
rc = l_ioctl(OBD_DEV_ID, OBD_IOC_CATLOGLIST, buf);
- if (rc == 0)
+ if (rc == 0)
fprintf(stdout, "%s", ((struct obd_ioctl_data*)buf)->ioc_bulk);
else
- fprintf(stderr, "OBD_IOC_CATLOGLIST failed: %s\n",
+ fprintf(stderr, "OBD_IOC_CATLOGLIST failed: %s\n",
strerror(errno));
-
+
return rc;
}
IOC_INIT(data);
data.ioc_inllen1 = strlen(argv[1]) + 1;
data.ioc_inlbuf1 = argv[1];
- data.ioc_inllen2 = max - size_round(sizeof(data)) -
+ data.ioc_inllen2 = max - size_round(sizeof(data)) -
size_round(data.ioc_inllen1);
IOC_PACK(argv[0], data);
int jt_lcfg_del_uuid(int argc, char **argv);
int jt_lcfg_lov_setup(int argc, char **argv);
int jt_lcfg_lmv_setup(int argc, char **argv);
+int jt_lcfg_lov_modify_tgts(int argc, char **argv);
int jt_lcfg_mount_option(int argc, char **argv);
int jt_lcfg_del_mount_option(int argc, char **argv);
int jt_lcfg_set_timeout(int argc, char **argv);
CHECK_MEMBER(llog_log_hdr, llh_flags);
CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
- CHECK_MEMBER(llog_log_hdr, llh_reserved);
CHECK_MEMBER(llog_log_hdr, llh_bitmap);
CHECK_MEMBER(llog_log_hdr, llh_tail);
}
CHECK_MEMBER(llogd_body, lgd_len);
CHECK_MEMBER(llogd_body, lgd_cur_offset);
- CHECK_VALUE(LLOG_ORIGIN_HANDLE_CREATE);
+ CHECK_VALUE(LLOG_ORIGIN_HANDLE_OPEN);
CHECK_VALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
CHECK_VALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
CHECK_VALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
void lustre_assert_wire_constants(void)
{
/* Wire protocol assertions generated by 'wirecheck'
- * running on Linux schnapps.adilger.int 2.4.22-l32 #4 Thu Jan 8 14:32:57 MST 2004 i686 i686
+ * running on Linux innova.tion.org 2.4.20-30.9-87k.40-HEAD.RC_1_3_0_14.200404051618 #1 Mon A
* with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) */
/* Checks for struct lustre_handle */
LASSERTF((int)sizeof(struct lustre_handle) == 8, " found %lld\n",
(long long)(int)sizeof(struct lustre_handle));
- LASSERTF(offsetof(struct lustre_handle, cookie) == 0, " found %lld\n",
- (long long)offsetof(struct lustre_handle, cookie));
+ LASSERTF((int)offsetof(struct lustre_handle, cookie) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_handle, cookie));
LASSERTF((int)sizeof(((struct lustre_handle *)0)->cookie) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_handle *)0)->cookie));
/* Checks for struct lustre_msg */
LASSERTF((int)sizeof(struct lustre_msg) == 64, " found %lld\n",
(long long)(int)sizeof(struct lustre_msg));
- LASSERTF(offsetof(struct lustre_msg, handle) == 0, " found %lld\n",
- (long long)offsetof(struct lustre_msg, handle));
+ LASSERTF((int)offsetof(struct lustre_msg, handle) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, handle));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->handle) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->handle));
- LASSERTF(offsetof(struct lustre_msg, magic) == 8, " found %lld\n",
- (long long)offsetof(struct lustre_msg, magic));
+ LASSERTF((int)offsetof(struct lustre_msg, magic) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, magic));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->magic) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->magic));
- LASSERTF(offsetof(struct lustre_msg, type) == 12, " found %lld\n",
- (long long)offsetof(struct lustre_msg, type));
+ LASSERTF((int)offsetof(struct lustre_msg, type) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, type));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->type) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->type));
- LASSERTF(offsetof(struct lustre_msg, version) == 16, " found %lld\n",
- (long long)offsetof(struct lustre_msg, version));
+ LASSERTF((int)offsetof(struct lustre_msg, version) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, version));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->version) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->version));
- LASSERTF(offsetof(struct lustre_msg, opc) == 20, " found %lld\n",
- (long long)offsetof(struct lustre_msg, opc));
+ LASSERTF((int)offsetof(struct lustre_msg, opc) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, opc));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->opc) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->opc));
- LASSERTF(offsetof(struct lustre_msg, last_xid) == 24, " found %lld\n",
- (long long)offsetof(struct lustre_msg, last_xid));
+ LASSERTF((int)offsetof(struct lustre_msg, last_xid) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, last_xid));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->last_xid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->last_xid));
- LASSERTF(offsetof(struct lustre_msg, last_committed) == 32, " found %lld\n",
- (long long)offsetof(struct lustre_msg, last_committed));
+ LASSERTF((int)offsetof(struct lustre_msg, last_committed) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, last_committed));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->last_committed) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->last_committed));
- LASSERTF(offsetof(struct lustre_msg, transno) == 40, " found %lld\n",
- (long long)offsetof(struct lustre_msg, transno));
+ LASSERTF((int)offsetof(struct lustre_msg, transno) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, transno));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->transno) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->transno));
- LASSERTF(offsetof(struct lustre_msg, status) == 48, " found %lld\n",
- (long long)offsetof(struct lustre_msg, status));
+ LASSERTF((int)offsetof(struct lustre_msg, status) == 48, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, status));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->status) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->status));
- LASSERTF(offsetof(struct lustre_msg, flags) == 52, " found %lld\n",
- (long long)offsetof(struct lustre_msg, flags));
+ LASSERTF((int)offsetof(struct lustre_msg, flags) == 52, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, flags));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->flags));
- LASSERTF(offsetof(struct lustre_msg, bufcount) == 60, " found %lld\n",
- (long long)offsetof(struct lustre_msg, bufcount));
+ LASSERTF((int)offsetof(struct lustre_msg, bufcount) == 60, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, bufcount));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->bufcount) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->bufcount));
- LASSERTF(offsetof(struct lustre_msg, buflens[7]) == 92, " found %lld\n",
- (long long)offsetof(struct lustre_msg, buflens[7]));
+ LASSERTF((int)offsetof(struct lustre_msg, buflens[7]) == 92, " found %lld\n",
+ (long long)(int)offsetof(struct lustre_msg, buflens[7]));
LASSERTF((int)sizeof(((struct lustre_msg *)0)->buflens[7]) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lustre_msg *)0)->buflens[7]));
/* Checks for struct obdo */
LASSERTF((int)sizeof(struct obdo) == 168, " found %lld\n",
(long long)(int)sizeof(struct obdo));
- LASSERTF(offsetof(struct obdo, o_id) == 0, " found %lld\n",
- (long long)offsetof(struct obdo, o_id));
+ LASSERTF((int)offsetof(struct obdo, o_id) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_id));
LASSERTF((int)sizeof(((struct obdo *)0)->o_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_id));
- LASSERTF(offsetof(struct obdo, o_gr) == 8, " found %lld\n",
- (long long)offsetof(struct obdo, o_gr));
+ LASSERTF((int)offsetof(struct obdo, o_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_gr));
LASSERTF((int)sizeof(((struct obdo *)0)->o_gr) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_gr));
- LASSERTF(offsetof(struct obdo, o_atime) == 16, " found %lld\n",
- (long long)offsetof(struct obdo, o_atime));
+ LASSERTF((int)offsetof(struct obdo, o_atime) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_atime));
LASSERTF((int)sizeof(((struct obdo *)0)->o_atime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_atime));
- LASSERTF(offsetof(struct obdo, o_mtime) == 24, " found %lld\n",
- (long long)offsetof(struct obdo, o_mtime));
+ LASSERTF((int)offsetof(struct obdo, o_mtime) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_mtime));
LASSERTF((int)sizeof(((struct obdo *)0)->o_mtime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_mtime));
- LASSERTF(offsetof(struct obdo, o_ctime) == 32, " found %lld\n",
- (long long)offsetof(struct obdo, o_ctime));
+ LASSERTF((int)offsetof(struct obdo, o_ctime) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_ctime));
LASSERTF((int)sizeof(((struct obdo *)0)->o_ctime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_ctime));
- LASSERTF(offsetof(struct obdo, o_size) == 40, " found %lld\n",
- (long long)offsetof(struct obdo, o_size));
+ LASSERTF((int)offsetof(struct obdo, o_size) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_size));
LASSERTF((int)sizeof(((struct obdo *)0)->o_size) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_size));
- LASSERTF(offsetof(struct obdo, o_blocks) == 48, " found %lld\n",
- (long long)offsetof(struct obdo, o_blocks));
+ LASSERTF((int)offsetof(struct obdo, o_blocks) == 48, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_blocks));
LASSERTF((int)sizeof(((struct obdo *)0)->o_blocks) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_blocks));
- LASSERTF(offsetof(struct obdo, o_grant) == 56, " found %lld\n",
- (long long)offsetof(struct obdo, o_grant));
+ LASSERTF((int)offsetof(struct obdo, o_grant) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_grant));
LASSERTF((int)sizeof(((struct obdo *)0)->o_grant) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_grant));
- LASSERTF(offsetof(struct obdo, o_blksize) == 64, " found %lld\n",
- (long long)offsetof(struct obdo, o_blksize));
+ LASSERTF((int)offsetof(struct obdo, o_blksize) == 64, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_blksize));
LASSERTF((int)sizeof(((struct obdo *)0)->o_blksize) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_blksize));
- LASSERTF(offsetof(struct obdo, o_mode) == 68, " found %lld\n",
- (long long)offsetof(struct obdo, o_mode));
+ LASSERTF((int)offsetof(struct obdo, o_mode) == 68, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_mode));
LASSERTF((int)sizeof(((struct obdo *)0)->o_mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_mode));
- LASSERTF(offsetof(struct obdo, o_uid) == 72, " found %lld\n",
- (long long)offsetof(struct obdo, o_uid));
+ LASSERTF((int)offsetof(struct obdo, o_uid) == 72, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_uid));
LASSERTF((int)sizeof(((struct obdo *)0)->o_uid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_uid));
- LASSERTF(offsetof(struct obdo, o_gid) == 76, " found %lld\n",
- (long long)offsetof(struct obdo, o_gid));
+ LASSERTF((int)offsetof(struct obdo, o_gid) == 76, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_gid));
LASSERTF((int)sizeof(((struct obdo *)0)->o_gid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_gid));
- LASSERTF(offsetof(struct obdo, o_flags) == 80, " found %lld\n",
- (long long)offsetof(struct obdo, o_flags));
+ LASSERTF((int)offsetof(struct obdo, o_flags) == 80, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_flags));
LASSERTF((int)sizeof(((struct obdo *)0)->o_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_flags));
- LASSERTF(offsetof(struct obdo, o_nlink) == 84, " found %lld\n",
- (long long)offsetof(struct obdo, o_nlink));
+ LASSERTF((int)offsetof(struct obdo, o_nlink) == 84, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_nlink));
LASSERTF((int)sizeof(((struct obdo *)0)->o_nlink) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_nlink));
- LASSERTF(offsetof(struct obdo, o_generation) == 88, " found %lld\n",
- (long long)offsetof(struct obdo, o_generation));
+ LASSERTF((int)offsetof(struct obdo, o_generation) == 88, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_generation));
LASSERTF((int)sizeof(((struct obdo *)0)->o_generation) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_generation));
- LASSERTF(offsetof(struct obdo, o_valid) == 92, " found %lld\n",
- (long long)offsetof(struct obdo, o_valid));
+ LASSERTF((int)offsetof(struct obdo, o_valid) == 92, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_valid));
LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_valid));
- LASSERTF(offsetof(struct obdo, o_misc) == 96, " found %lld\n",
- (long long)offsetof(struct obdo, o_misc));
+ LASSERTF((int)offsetof(struct obdo, o_misc) == 96, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_misc));
LASSERTF((int)sizeof(((struct obdo *)0)->o_misc) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_misc));
- LASSERTF(offsetof(struct obdo, o_easize) == 100, " found %lld\n",
- (long long)offsetof(struct obdo, o_easize));
+ LASSERTF((int)offsetof(struct obdo, o_easize) == 100, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_easize));
LASSERTF((int)sizeof(((struct obdo *)0)->o_easize) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_easize));
- LASSERTF(offsetof(struct obdo, o_inline) == 104, " found %lld\n",
- (long long)offsetof(struct obdo, o_inline));
+ LASSERTF((int)offsetof(struct obdo, o_inline) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_inline));
LASSERTF((int)sizeof(((struct obdo *)0)->o_inline) == 64, " found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_inline));
LASSERTF(OBD_MD_FLID == 1, " found %lld\n",
/* Checks for struct lov_mds_md_v1 */
LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
(long long)(int)sizeof(struct lov_mds_md_v1));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_magic) == 0, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_magic));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_magic) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_magic));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_pattern) == 4, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_pattern));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_pattern) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_pattern));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_object_id) == 8, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_object_id));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_id) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_id));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_object_gr));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_gr));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_stripe_size));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_size));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_stripe_count));
+ 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) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count));
- LASSERTF(offsetof(struct lov_mds_md_v1, lmm_objects) == 32, " found %lld\n",
- (long long)offsetof(struct lov_mds_md_v1, lmm_objects));
+ LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_objects) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct lov_mds_md_v1, lmm_objects));
LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects) == 0, " found %lld\n",
(long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects));
/* Checks for struct lov_ost_data_v1 */
LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, " found %lld\n",
(long long)(int)sizeof(struct lov_ost_data_v1));
- LASSERTF(offsetof(struct lov_ost_data_v1, l_object_id) == 0, " found %lld\n",
- (long long)offsetof(struct lov_ost_data_v1, l_object_id));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_id) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_object_id));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id));
- LASSERTF(offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
- (long long)offsetof(struct lov_ost_data_v1, l_object_gr));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_object_gr));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr));
- LASSERTF(offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
- (long long)offsetof(struct lov_ost_data_v1, l_ost_gen));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen));
- LASSERTF(offsetof(struct lov_ost_data_v1, l_ost_idx) == 20, " found %lld\n",
- (long long)offsetof(struct lov_ost_data_v1, l_ost_idx));
+ LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_idx) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_idx));
LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx));
LASSERTF(LOV_MAGIC_V0 == 198183888, " found %lld\n",
/* Checks for struct obd_statfs */
LASSERTF((int)sizeof(struct obd_statfs) == 144, " found %lld\n",
(long long)(int)sizeof(struct obd_statfs));
- LASSERTF(offsetof(struct obd_statfs, os_type) == 0, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_type));
+ LASSERTF((int)offsetof(struct obd_statfs, os_type) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_type));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_type) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_type));
- LASSERTF(offsetof(struct obd_statfs, os_blocks) == 8, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_blocks));
+ LASSERTF((int)offsetof(struct obd_statfs, os_blocks) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_blocks));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_blocks) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_blocks));
- LASSERTF(offsetof(struct obd_statfs, os_bfree) == 16, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_bfree));
+ LASSERTF((int)offsetof(struct obd_statfs, os_bfree) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_bfree));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bfree) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_bfree));
- LASSERTF(offsetof(struct obd_statfs, os_bavail) == 24, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_bavail));
+ LASSERTF((int)offsetof(struct obd_statfs, os_bavail) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_bavail));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bavail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_bavail));
- LASSERTF(offsetof(struct obd_statfs, os_ffree) == 40, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_ffree));
+ LASSERTF((int)offsetof(struct obd_statfs, os_ffree) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_ffree));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_ffree) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_ffree));
- LASSERTF(offsetof(struct obd_statfs, os_fsid) == 48, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_fsid));
+ LASSERTF((int)offsetof(struct obd_statfs, os_fsid) == 48, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_fsid));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fsid) == 40, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_fsid));
- LASSERTF(offsetof(struct obd_statfs, os_bsize) == 88, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_bsize));
+ LASSERTF((int)offsetof(struct obd_statfs, os_bsize) == 88, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_bsize));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bsize) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_bsize));
- LASSERTF(offsetof(struct obd_statfs, os_namelen) == 92, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_namelen));
+ LASSERTF((int)offsetof(struct obd_statfs, os_namelen) == 92, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_namelen));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_namelen) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_namelen));
- LASSERTF(offsetof(struct obd_statfs, os_spare) == 104, " found %lld\n",
- (long long)offsetof(struct obd_statfs, os_spare));
+ LASSERTF((int)offsetof(struct obd_statfs, os_spare) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_spare));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare) == 40, " found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_spare));
/* Checks for struct obd_ioobj */
LASSERTF((int)sizeof(struct obd_ioobj) == 24, " found %lld\n",
(long long)(int)sizeof(struct obd_ioobj));
- LASSERTF(offsetof(struct obd_ioobj, ioo_id) == 0, " found %lld\n",
- (long long)offsetof(struct obd_ioobj, ioo_id));
+ LASSERTF((int)offsetof(struct obd_ioobj, ioo_id) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct obd_ioobj, ioo_id));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_id));
- LASSERTF(offsetof(struct obd_ioobj, ioo_gr) == 8, " found %lld\n",
- (long long)offsetof(struct obd_ioobj, ioo_gr));
+ LASSERTF((int)offsetof(struct obd_ioobj, ioo_gr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct obd_ioobj, ioo_gr));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_gr));
- LASSERTF(offsetof(struct obd_ioobj, ioo_type) == 16, " found %lld\n",
- (long long)offsetof(struct obd_ioobj, ioo_type));
+ LASSERTF((int)offsetof(struct obd_ioobj, ioo_type) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct obd_ioobj, ioo_type));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_type));
- LASSERTF(offsetof(struct obd_ioobj, ioo_bufcnt) == 20, " found %lld\n",
- (long long)offsetof(struct obd_ioobj, ioo_bufcnt));
+ LASSERTF((int)offsetof(struct obd_ioobj, ioo_bufcnt) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct obd_ioobj, ioo_bufcnt));
LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4, " found %lld\n",
(long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt));
/* Checks for struct niobuf_remote */
LASSERTF((int)sizeof(struct niobuf_remote) == 16, " found %lld\n",
(long long)(int)sizeof(struct niobuf_remote));
- LASSERTF(offsetof(struct niobuf_remote, offset) == 0, " found %lld\n",
- (long long)offsetof(struct niobuf_remote, offset));
+ LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, offset));
LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, " found %lld\n",
(long long)(int)sizeof(((struct niobuf_remote *)0)->offset));
- LASSERTF(offsetof(struct niobuf_remote, len) == 8, " found %lld\n",
- (long long)offsetof(struct niobuf_remote, len));
+ LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, len));
LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, " found %lld\n",
(long long)(int)sizeof(((struct niobuf_remote *)0)->len));
- LASSERTF(offsetof(struct niobuf_remote, flags) == 12, " found %lld\n",
- (long long)offsetof(struct niobuf_remote, flags));
+ LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, flags));
LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct niobuf_remote *)0)->flags));
LASSERTF(OBD_BRW_READ == 1, " found %lld\n",
/* Checks for struct ost_body */
LASSERTF((int)sizeof(struct ost_body) == 168, " found %lld\n",
(long long)(int)sizeof(struct ost_body));
- LASSERTF(offsetof(struct ost_body, oa) == 0, " found %lld\n",
- (long long)offsetof(struct ost_body, oa));
+ LASSERTF((int)offsetof(struct ost_body, oa) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ost_body, oa));
LASSERTF((int)sizeof(((struct ost_body *)0)->oa) == 168, " found %lld\n",
(long long)(int)sizeof(((struct ost_body *)0)->oa));
/* Checks for struct ll_fid */
LASSERTF((int)sizeof(struct ll_fid) == 16, " found %lld\n",
(long long)(int)sizeof(struct ll_fid));
- LASSERTF(offsetof(struct ll_fid, id) == 0, " found %lld\n",
- (long long)offsetof(struct ll_fid, id));
+ LASSERTF((int)offsetof(struct ll_fid, id) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ll_fid, id));
LASSERTF((int)sizeof(((struct ll_fid *)0)->id) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ll_fid *)0)->id));
- LASSERTF(offsetof(struct ll_fid, generation) == 8, " found %lld\n",
- (long long)offsetof(struct ll_fid, generation));
+ LASSERTF((int)offsetof(struct ll_fid, generation) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ll_fid, generation));
LASSERTF((int)sizeof(((struct ll_fid *)0)->generation) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ll_fid *)0)->generation));
- LASSERTF(offsetof(struct ll_fid, f_type) == 12, " found %lld\n",
- (long long)offsetof(struct ll_fid, f_type));
+ LASSERTF((int)offsetof(struct ll_fid, f_type) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct ll_fid, f_type));
LASSERTF((int)sizeof(((struct ll_fid *)0)->f_type) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ll_fid *)0)->f_type));
/* Checks for struct mds_status_req */
LASSERTF((int)sizeof(struct mds_status_req) == 8, " found %lld\n",
(long long)(int)sizeof(struct mds_status_req));
- LASSERTF(offsetof(struct mds_status_req, flags) == 0, " found %lld\n",
- (long long)offsetof(struct mds_status_req, flags));
+ LASSERTF((int)offsetof(struct mds_status_req, flags) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_status_req, flags));
LASSERTF((int)sizeof(((struct mds_status_req *)0)->flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_status_req *)0)->flags));
- LASSERTF(offsetof(struct mds_status_req, repbuf) == 4, " found %lld\n",
- (long long)offsetof(struct mds_status_req, repbuf));
+ LASSERTF((int)offsetof(struct mds_status_req, repbuf) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct mds_status_req, repbuf));
LASSERTF((int)sizeof(((struct mds_status_req *)0)->repbuf) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_status_req *)0)->repbuf));
/* Checks for struct mds_body */
LASSERTF((int)sizeof(struct mds_body) == 136, " found %lld\n",
(long long)(int)sizeof(struct mds_body));
- LASSERTF(offsetof(struct mds_body, fid1) == 0, " found %lld\n",
- (long long)offsetof(struct mds_body, fid1));
+ LASSERTF((int)offsetof(struct mds_body, fid1) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, fid1));
LASSERTF((int)sizeof(((struct mds_body *)0)->fid1) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->fid1));
- LASSERTF(offsetof(struct mds_body, fid2) == 16, " found %lld\n",
- (long long)offsetof(struct mds_body, fid2));
+ LASSERTF((int)offsetof(struct mds_body, fid2) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, fid2));
LASSERTF((int)sizeof(((struct mds_body *)0)->fid2) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->fid2));
- LASSERTF(offsetof(struct mds_body, handle) == 32, " found %lld\n",
- (long long)offsetof(struct mds_body, handle));
+ LASSERTF((int)offsetof(struct mds_body, handle) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, handle));
LASSERTF((int)sizeof(((struct mds_body *)0)->handle) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->handle));
- LASSERTF(offsetof(struct mds_body, size) == 40, " found %lld\n",
- (long long)offsetof(struct mds_body, size));
+ LASSERTF((int)offsetof(struct mds_body, size) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, size));
LASSERTF((int)sizeof(((struct mds_body *)0)->size) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->size));
- LASSERTF(offsetof(struct mds_body, blocks) == 48, " found %lld\n",
- (long long)offsetof(struct mds_body, blocks));
+ LASSERTF((int)offsetof(struct mds_body, blocks) == 48, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, blocks));
LASSERTF((int)sizeof(((struct mds_body *)0)->blocks) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->blocks));
- LASSERTF(offsetof(struct mds_body, io_epoch) == 56, " found %lld\n",
- (long long)offsetof(struct mds_body, io_epoch));
+ LASSERTF((int)offsetof(struct mds_body, io_epoch) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, io_epoch));
LASSERTF((int)sizeof(((struct mds_body *)0)->io_epoch) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->io_epoch));
- LASSERTF(offsetof(struct mds_body, ino) == 64, " found %lld\n",
- (long long)offsetof(struct mds_body, ino));
+ LASSERTF((int)offsetof(struct mds_body, ino) == 64, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, ino));
LASSERTF((int)sizeof(((struct mds_body *)0)->ino) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->ino));
- LASSERTF(offsetof(struct mds_body, valid) == 68, " found %lld\n",
- (long long)offsetof(struct mds_body, valid));
+ LASSERTF((int)offsetof(struct mds_body, valid) == 68, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, valid));
LASSERTF((int)sizeof(((struct mds_body *)0)->valid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->valid));
- LASSERTF(offsetof(struct mds_body, fsuid) == 72, " found %lld\n",
- (long long)offsetof(struct mds_body, fsuid));
+ LASSERTF((int)offsetof(struct mds_body, fsuid) == 72, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, fsuid));
LASSERTF((int)sizeof(((struct mds_body *)0)->fsuid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->fsuid));
- LASSERTF(offsetof(struct mds_body, fsgid) == 76, " found %lld\n",
- (long long)offsetof(struct mds_body, fsgid));
+ LASSERTF((int)offsetof(struct mds_body, fsgid) == 76, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, fsgid));
LASSERTF((int)sizeof(((struct mds_body *)0)->fsgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->fsgid));
- LASSERTF(offsetof(struct mds_body, capability) == 80, " found %lld\n",
- (long long)offsetof(struct mds_body, capability));
+ LASSERTF((int)offsetof(struct mds_body, capability) == 80, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, capability));
LASSERTF((int)sizeof(((struct mds_body *)0)->capability) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->capability));
- LASSERTF(offsetof(struct mds_body, mode) == 84, " found %lld\n",
- (long long)offsetof(struct mds_body, mode));
+ LASSERTF((int)offsetof(struct mds_body, mode) == 84, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, mode));
LASSERTF((int)sizeof(((struct mds_body *)0)->mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->mode));
- LASSERTF(offsetof(struct mds_body, uid) == 88, " found %lld\n",
- (long long)offsetof(struct mds_body, uid));
+ LASSERTF((int)offsetof(struct mds_body, uid) == 88, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, uid));
LASSERTF((int)sizeof(((struct mds_body *)0)->uid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->uid));
- LASSERTF(offsetof(struct mds_body, gid) == 92, " found %lld\n",
- (long long)offsetof(struct mds_body, gid));
+ LASSERTF((int)offsetof(struct mds_body, gid) == 92, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, gid));
LASSERTF((int)sizeof(((struct mds_body *)0)->gid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->gid));
- LASSERTF(offsetof(struct mds_body, mtime) == 96, " found %lld\n",
- (long long)offsetof(struct mds_body, mtime));
+ LASSERTF((int)offsetof(struct mds_body, mtime) == 96, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, mtime));
LASSERTF((int)sizeof(((struct mds_body *)0)->mtime) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->mtime));
- LASSERTF(offsetof(struct mds_body, ctime) == 100, " found %lld\n",
- (long long)offsetof(struct mds_body, ctime));
+ LASSERTF((int)offsetof(struct mds_body, ctime) == 100, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, ctime));
LASSERTF((int)sizeof(((struct mds_body *)0)->ctime) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->ctime));
- LASSERTF(offsetof(struct mds_body, atime) == 104, " found %lld\n",
- (long long)offsetof(struct mds_body, atime));
+ LASSERTF((int)offsetof(struct mds_body, atime) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, atime));
LASSERTF((int)sizeof(((struct mds_body *)0)->atime) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->atime));
- LASSERTF(offsetof(struct mds_body, flags) == 108, " found %lld\n",
- (long long)offsetof(struct mds_body, flags));
+ LASSERTF((int)offsetof(struct mds_body, flags) == 108, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, flags));
LASSERTF((int)sizeof(((struct mds_body *)0)->flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->flags));
- LASSERTF(offsetof(struct mds_body, rdev) == 112, " found %lld\n",
- (long long)offsetof(struct mds_body, rdev));
+ LASSERTF((int)offsetof(struct mds_body, rdev) == 112, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, rdev));
LASSERTF((int)sizeof(((struct mds_body *)0)->rdev) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->rdev));
- LASSERTF(offsetof(struct mds_body, nlink) == 116, " found %lld\n",
- (long long)offsetof(struct mds_body, nlink));
+ LASSERTF((int)offsetof(struct mds_body, nlink) == 116, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, nlink));
LASSERTF((int)sizeof(((struct mds_body *)0)->nlink) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->nlink));
- LASSERTF(offsetof(struct mds_body, generation) == 120, " found %lld\n",
- (long long)offsetof(struct mds_body, generation));
+ LASSERTF((int)offsetof(struct mds_body, generation) == 120, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, generation));
LASSERTF((int)sizeof(((struct mds_body *)0)->generation) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->generation));
- LASSERTF(offsetof(struct mds_body, suppgid) == 124, " found %lld\n",
- (long long)offsetof(struct mds_body, suppgid));
+ LASSERTF((int)offsetof(struct mds_body, suppgid) == 124, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, suppgid));
LASSERTF((int)sizeof(((struct mds_body *)0)->suppgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->suppgid));
- LASSERTF(offsetof(struct mds_body, eadatasize) == 128, " found %lld\n",
- (long long)offsetof(struct mds_body, eadatasize));
+ LASSERTF((int)offsetof(struct mds_body, eadatasize) == 128, " found %lld\n",
+ (long long)(int)offsetof(struct mds_body, eadatasize));
LASSERTF((int)sizeof(((struct mds_body *)0)->eadatasize) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_body *)0)->eadatasize));
LASSERTF(FMODE_READ == 1, " found %lld\n",
/* Checks for struct mds_rec_setattr */
LASSERTF((int)sizeof(struct mds_rec_setattr) == 88, " found %lld\n",
(long long)(int)sizeof(struct mds_rec_setattr));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_opcode) == 0, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_opcode));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_opcode) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_opcode));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_fsuid) == 4, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_fsuid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_fsuid) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_fsuid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsuid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_fsuid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_fsgid) == 8, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_fsgid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_fsgid) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_fsgid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_fsgid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_cap) == 12, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_cap));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_cap) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_cap));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_cap) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_cap));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_suppgid) == 16, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_suppgid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_suppgid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_suppgid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_suppgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_suppgid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_valid) == 20, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_valid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_valid) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_valid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_valid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_valid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_fid) == 24, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_fid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_fid) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_fid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_fid) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_fid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_mode) == 40, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_mode));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_mode) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_mode));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_mode));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_uid) == 44, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_uid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_uid) == 44, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_uid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_uid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_uid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_gid) == 48, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_gid));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_gid) == 48, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_gid));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_gid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_gid));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_attr_flags) == 52, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_attr_flags));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_attr_flags) == 52, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_attr_flags));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_size) == 56, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_size));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_size) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_size));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_size) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_size));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_atime) == 64, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_atime));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_atime) == 64, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_atime));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_atime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_atime));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_mtime) == 72, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_mtime));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_mtime) == 72, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_mtime));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime));
- LASSERTF(offsetof(struct mds_rec_setattr, sa_ctime) == 80, " found %lld\n",
- (long long)offsetof(struct mds_rec_setattr, sa_ctime));
+ LASSERTF((int)offsetof(struct mds_rec_setattr, sa_ctime) == 80, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_setattr, sa_ctime));
LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime));
/* Checks for struct mds_rec_create */
LASSERTF((int)sizeof(struct mds_rec_create) == 80, " found %lld\n",
(long long)(int)sizeof(struct mds_rec_create));
- LASSERTF(offsetof(struct mds_rec_create, cr_opcode) == 0, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_opcode));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_opcode) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_opcode));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_opcode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_opcode));
- LASSERTF(offsetof(struct mds_rec_create, cr_fsuid) == 4, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_fsuid));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_fsuid) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_fsuid));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_fsuid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_fsuid));
- LASSERTF(offsetof(struct mds_rec_create, cr_fsgid) == 8, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_fsgid));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_fsgid) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_fsgid));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_fsgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_fsgid));
- LASSERTF(offsetof(struct mds_rec_create, cr_cap) == 12, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_cap));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_cap) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_cap));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_cap) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_cap));
- LASSERTF(offsetof(struct mds_rec_create, cr_flags) == 16, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_flags));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_flags) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_flags));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_flags));
- LASSERTF(offsetof(struct mds_rec_create, cr_mode) == 20, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_mode));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_mode) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_mode));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_mode));
- LASSERTF(offsetof(struct mds_rec_create, cr_fid) == 24, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_fid));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_fid) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_fid));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_fid) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_fid));
- LASSERTF(offsetof(struct mds_rec_create, cr_replayfid) == 40, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_replayfid));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_replayfid) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_replayfid));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_replayfid) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_replayfid));
- LASSERTF(offsetof(struct mds_rec_create, cr_time) == 56, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_time));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_time) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_time));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_time) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_time));
- LASSERTF(offsetof(struct mds_rec_create, cr_rdev) == 64, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_rdev));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_rdev) == 64, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_rdev));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_rdev) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_rdev));
- LASSERTF(offsetof(struct mds_rec_create, cr_suppgid) == 72, " found %lld\n",
- (long long)offsetof(struct mds_rec_create, cr_suppgid));
+ LASSERTF((int)offsetof(struct mds_rec_create, cr_suppgid) == 72, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_create, cr_suppgid));
LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_suppgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_create *)0)->cr_suppgid));
/* Checks for struct mds_rec_link */
LASSERTF((int)sizeof(struct mds_rec_link) == 64, " found %lld\n",
(long long)(int)sizeof(struct mds_rec_link));
- LASSERTF(offsetof(struct mds_rec_link, lk_opcode) == 0, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_opcode));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_opcode) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_opcode));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_opcode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_opcode));
- LASSERTF(offsetof(struct mds_rec_link, lk_fsuid) == 4, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_fsuid));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_fsuid) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_fsuid));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_fsuid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_fsuid));
- LASSERTF(offsetof(struct mds_rec_link, lk_fsgid) == 8, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_fsgid));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_fsgid) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_fsgid));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_fsgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_fsgid));
- LASSERTF(offsetof(struct mds_rec_link, lk_cap) == 12, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_cap));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_cap) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_cap));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_cap) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_cap));
- LASSERTF(offsetof(struct mds_rec_link, lk_suppgid1) == 16, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_suppgid1));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_suppgid1) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_suppgid1));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid1) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_suppgid1));
- LASSERTF(offsetof(struct mds_rec_link, lk_suppgid2) == 20, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_suppgid2));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_suppgid2) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_suppgid2));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid2) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_suppgid2));
- LASSERTF(offsetof(struct mds_rec_link, lk_fid1) == 24, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_fid1));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_fid1) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_fid1));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_fid1) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_fid1));
- LASSERTF(offsetof(struct mds_rec_link, lk_fid2) == 40, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_fid2));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_fid2) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_fid2));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_fid2) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_fid2));
- LASSERTF(offsetof(struct mds_rec_link, lk_time) == 56, " found %lld\n",
- (long long)offsetof(struct mds_rec_link, lk_time));
+ LASSERTF((int)offsetof(struct mds_rec_link, lk_time) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_link, lk_time));
LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_time) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_link *)0)->lk_time));
/* Checks for struct mds_rec_unlink */
LASSERTF((int)sizeof(struct mds_rec_unlink) == 64, " found %lld\n",
(long long)(int)sizeof(struct mds_rec_unlink));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_opcode) == 0, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_opcode));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_opcode) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_opcode));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_fsuid) == 4, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_fsuid));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_fsuid) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_fsuid));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsuid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_fsuid));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_fsgid) == 8, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_fsgid));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_fsgid) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_fsgid));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_fsgid));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_cap) == 12, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_cap));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_cap) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_cap));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_cap) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_cap));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_suppgid) == 16, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_suppgid));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_suppgid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_suppgid));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_suppgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_suppgid));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_mode) == 20, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_mode));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_mode) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_mode));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_mode));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_fid1) == 24, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_fid1));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_fid1) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_fid1));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_fid2) == 40, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_fid2));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_fid2) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_fid2));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2));
- LASSERTF(offsetof(struct mds_rec_unlink, ul_time) == 56, " found %lld\n",
- (long long)offsetof(struct mds_rec_unlink, ul_time));
+ LASSERTF((int)offsetof(struct mds_rec_unlink, ul_time) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_unlink, ul_time));
LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_time) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_time));
/* Checks for struct mds_rec_rename */
LASSERTF((int)sizeof(struct mds_rec_rename) == 64, " found %lld\n",
(long long)(int)sizeof(struct mds_rec_rename));
- LASSERTF(offsetof(struct mds_rec_rename, rn_opcode) == 0, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_opcode));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_opcode) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_opcode));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_opcode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_opcode));
- LASSERTF(offsetof(struct mds_rec_rename, rn_fsuid) == 4, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_fsuid));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_fsuid) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_fsuid));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_fsuid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_fsuid));
- LASSERTF(offsetof(struct mds_rec_rename, rn_fsgid) == 8, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_fsgid));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_fsgid) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_fsgid));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_fsgid) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_fsgid));
- LASSERTF(offsetof(struct mds_rec_rename, rn_cap) == 12, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_cap));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_cap) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_cap));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_cap) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_cap));
- LASSERTF(offsetof(struct mds_rec_rename, rn_suppgid1) == 16, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_suppgid1));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_suppgid1) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_suppgid1));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid1) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid1));
- LASSERTF(offsetof(struct mds_rec_rename, rn_suppgid2) == 20, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_suppgid2));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_suppgid2) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_suppgid2));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid2) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid2));
- LASSERTF(offsetof(struct mds_rec_rename, rn_fid1) == 24, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_fid1));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_fid1) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_fid1));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_fid1) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_fid1));
- LASSERTF(offsetof(struct mds_rec_rename, rn_fid2) == 40, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_fid2));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_fid2) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_fid2));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_fid2) == 16, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_fid2));
- LASSERTF(offsetof(struct mds_rec_rename, rn_time) == 56, " found %lld\n",
- (long long)offsetof(struct mds_rec_rename, rn_time));
+ LASSERTF((int)offsetof(struct mds_rec_rename, rn_time) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct mds_rec_rename, rn_time));
LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_time) == 8, " found %lld\n",
(long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_time));
/* Checks for struct lov_desc */
LASSERTF((int)sizeof(struct lov_desc) == 72, " found %lld\n",
(long long)(int)sizeof(struct lov_desc));
- LASSERTF(offsetof(struct lov_desc, ld_tgt_count) == 0, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_tgt_count));
+ LASSERTF((int)offsetof(struct lov_desc, ld_tgt_count) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_tgt_count));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_tgt_count) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_tgt_count));
- LASSERTF(offsetof(struct lov_desc, ld_active_tgt_count) == 4, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_active_tgt_count));
+ LASSERTF((int)offsetof(struct lov_desc, ld_active_tgt_count) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_active_tgt_count));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count));
- LASSERTF(offsetof(struct lov_desc, ld_default_stripe_count) == 8, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_default_stripe_count));
+ LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_count) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_default_stripe_count));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count));
- LASSERTF(offsetof(struct lov_desc, ld_pattern) == 12, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_pattern));
+ LASSERTF((int)offsetof(struct lov_desc, ld_pattern) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_pattern));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_pattern) == 4, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_pattern));
- LASSERTF(offsetof(struct lov_desc, ld_default_stripe_size) == 16, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_default_stripe_size));
+ LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_size) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_default_stripe_size));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size));
- LASSERTF(offsetof(struct lov_desc, ld_default_stripe_offset) == 24, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_default_stripe_offset));
+ LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_offset) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_default_stripe_offset));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset) == 8, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset));
- LASSERTF(offsetof(struct lov_desc, ld_uuid) == 32, " found %lld\n",
- (long long)offsetof(struct lov_desc, ld_uuid));
+ LASSERTF((int)offsetof(struct lov_desc, ld_uuid) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct lov_desc, ld_uuid));
LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_uuid) == 40, " found %lld\n",
(long long)(int)sizeof(((struct lov_desc *)0)->ld_uuid));
/* Checks for struct ldlm_res_id */
LASSERTF((int)sizeof(struct ldlm_res_id) == 32, " found %lld\n",
(long long)(int)sizeof(struct ldlm_res_id));
- LASSERTF(offsetof(struct ldlm_res_id, name[4]) == 32, " found %lld\n",
- (long long)offsetof(struct ldlm_res_id, name[4]));
+ LASSERTF((int)offsetof(struct ldlm_res_id, name[4]) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_res_id, name[4]));
LASSERTF((int)sizeof(((struct ldlm_res_id *)0)->name[4]) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_res_id *)0)->name[4]));
/* Checks for struct ldlm_extent */
LASSERTF((int)sizeof(struct ldlm_extent) == 24, " found %lld\n",
(long long)(int)sizeof(struct ldlm_extent));
- LASSERTF(offsetof(struct ldlm_extent, start) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_extent, start));
+ LASSERTF((int)offsetof(struct ldlm_extent, start) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_extent, start));
LASSERTF((int)sizeof(((struct ldlm_extent *)0)->start) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_extent *)0)->start));
- LASSERTF(offsetof(struct ldlm_extent, end) == 8, " found %lld\n",
- (long long)offsetof(struct ldlm_extent, end));
+ LASSERTF((int)offsetof(struct ldlm_extent, end) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_extent, end));
LASSERTF((int)sizeof(((struct ldlm_extent *)0)->end) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_extent *)0)->end));
- LASSERTF(offsetof(struct ldlm_extent, gid) == 16, " found %lld\n",
- (long long)offsetof(struct ldlm_extent, gid));
+ LASSERTF((int)offsetof(struct ldlm_extent, gid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_extent, gid));
LASSERTF((int)sizeof(((struct ldlm_extent *)0)->gid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
/* Checks for struct ldlm_flock */
LASSERTF((int)sizeof(struct ldlm_flock) == 40, " found %lld\n",
(long long)(int)sizeof(struct ldlm_flock));
- LASSERTF(offsetof(struct ldlm_flock, start) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_flock, start));
+ LASSERTF((int)offsetof(struct ldlm_flock, start) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_flock, start));
LASSERTF((int)sizeof(((struct ldlm_flock *)0)->start) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_flock *)0)->start));
- LASSERTF(offsetof(struct ldlm_flock, end) == 8, " found %lld\n",
- (long long)offsetof(struct ldlm_flock, end));
+ LASSERTF((int)offsetof(struct ldlm_flock, end) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_flock, end));
LASSERTF((int)sizeof(((struct ldlm_flock *)0)->end) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_flock *)0)->end));
- LASSERTF(offsetof(struct ldlm_flock, pid) == 16, " found %lld\n",
- (long long)offsetof(struct ldlm_flock, pid));
+ LASSERTF((int)offsetof(struct ldlm_flock, pid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_flock, pid));
LASSERTF((int)sizeof(((struct ldlm_flock *)0)->pid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_flock *)0)->pid));
- LASSERTF(offsetof(struct ldlm_flock, blocking_pid) == 24, " found %lld\n",
- (long long)offsetof(struct ldlm_flock, blocking_pid));
+ LASSERTF((int)offsetof(struct ldlm_flock, blocking_pid) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_flock, blocking_pid));
LASSERTF((int)sizeof(((struct ldlm_flock *)0)->blocking_pid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_flock *)0)->blocking_pid));
- LASSERTF(offsetof(struct ldlm_flock, blocking_export) == 32, " found %lld\n",
- (long long)offsetof(struct ldlm_flock, blocking_export));
+ LASSERTF((int)offsetof(struct ldlm_flock, blocking_export) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_flock, blocking_export));
LASSERTF((int)sizeof(((struct ldlm_flock *)0)->blocking_export) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_flock *)0)->blocking_export));
/* Checks for struct ldlm_intent */
LASSERTF((int)sizeof(struct ldlm_intent) == 8, " found %lld\n",
(long long)(int)sizeof(struct ldlm_intent));
- LASSERTF(offsetof(struct ldlm_intent, opc) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_intent, opc));
+ LASSERTF((int)offsetof(struct ldlm_intent, opc) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_intent, opc));
LASSERTF((int)sizeof(((struct ldlm_intent *)0)->opc) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_intent *)0)->opc));
/* Checks for struct ldlm_resource_desc */
LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, " found %lld\n",
(long long)(int)sizeof(struct ldlm_resource_desc));
- LASSERTF(offsetof(struct ldlm_resource_desc, lr_type) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_resource_desc, lr_type));
+ LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_type) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_resource_desc, lr_type));
LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_type));
- LASSERTF(offsetof(struct ldlm_resource_desc, lr_name) == 8, " found %lld\n",
- (long long)offsetof(struct ldlm_resource_desc, lr_name));
+ LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_name) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_resource_desc, lr_name));
LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_name));
/* Checks for struct ldlm_lock_desc */
LASSERTF((int)sizeof(struct ldlm_lock_desc) == 88, " found %lld\n",
(long long)(int)sizeof(struct ldlm_lock_desc));
- LASSERTF(offsetof(struct ldlm_lock_desc, l_resource) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_lock_desc, l_resource));
+ LASSERTF((int)offsetof(struct ldlm_lock_desc, l_resource) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_lock_desc, l_resource));
LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_resource) == 40, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_resource));
- LASSERTF(offsetof(struct ldlm_lock_desc, l_req_mode) == 40, " found %lld\n",
- (long long)offsetof(struct ldlm_lock_desc, l_req_mode));
+ LASSERTF((int)offsetof(struct ldlm_lock_desc, l_req_mode) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_lock_desc, l_req_mode));
LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode));
- LASSERTF(offsetof(struct ldlm_lock_desc, l_granted_mode) == 44, " found %lld\n",
- (long long)offsetof(struct ldlm_lock_desc, l_granted_mode));
+ LASSERTF((int)offsetof(struct ldlm_lock_desc, l_granted_mode) == 44, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_lock_desc, l_granted_mode));
LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode));
- LASSERTF(offsetof(struct ldlm_lock_desc, l_policy_data) == 48, " found %lld\n",
- (long long)offsetof(struct ldlm_lock_desc, l_policy_data));
+ LASSERTF((int)offsetof(struct ldlm_lock_desc, l_policy_data) == 48, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_lock_desc, l_policy_data));
LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data) == 40, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data));
/* Checks for struct ldlm_request */
LASSERTF((int)sizeof(struct ldlm_request) == 112, " found %lld\n",
(long long)(int)sizeof(struct ldlm_request));
- LASSERTF(offsetof(struct ldlm_request, lock_flags) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_request, lock_flags));
+ LASSERTF((int)offsetof(struct ldlm_request, lock_flags) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_request, lock_flags));
LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_request *)0)->lock_flags));
- LASSERTF(offsetof(struct ldlm_request, lock_desc) == 8, " found %lld\n",
- (long long)offsetof(struct ldlm_request, lock_desc));
+ LASSERTF((int)offsetof(struct ldlm_request, lock_desc) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_request, lock_desc));
LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 88, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_request *)0)->lock_desc));
- LASSERTF(offsetof(struct ldlm_request, lock_handle1) == 96, " found %lld\n",
- (long long)offsetof(struct ldlm_request, lock_handle1));
+ LASSERTF((int)offsetof(struct ldlm_request, lock_handle1) == 96, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_request, lock_handle1));
LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_handle1) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_request *)0)->lock_handle1));
- LASSERTF(offsetof(struct ldlm_request, lock_handle2) == 104, " found %lld\n",
- (long long)offsetof(struct ldlm_request, lock_handle2));
+ LASSERTF((int)offsetof(struct ldlm_request, lock_handle2) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_request, lock_handle2));
LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_handle2) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_request *)0)->lock_handle2));
/* Checks for struct ldlm_reply */
LASSERTF((int)sizeof(struct ldlm_reply) == 120, " found %lld\n",
(long long)(int)sizeof(struct ldlm_reply));
- LASSERTF(offsetof(struct ldlm_reply, lock_flags) == 0, " found %lld\n",
- (long long)offsetof(struct ldlm_reply, lock_flags));
+ LASSERTF((int)offsetof(struct ldlm_reply, lock_flags) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_reply, lock_flags));
LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_reply *)0)->lock_flags));
- LASSERTF(offsetof(struct ldlm_request, lock_desc) == 8, " found %lld\n",
- (long long)offsetof(struct ldlm_request, lock_desc));
+ LASSERTF((int)offsetof(struct ldlm_request, lock_desc) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_request, lock_desc));
LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 88, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_request *)0)->lock_desc));
- LASSERTF(offsetof(struct ldlm_reply, lock_handle) == 96, " found %lld\n",
- (long long)offsetof(struct ldlm_reply, lock_handle));
+ LASSERTF((int)offsetof(struct ldlm_reply, lock_handle) == 96, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_reply, lock_handle));
LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_handle) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_reply *)0)->lock_handle));
- LASSERTF(offsetof(struct ldlm_reply, lock_policy_res1) == 104, " found %lld\n",
- (long long)offsetof(struct ldlm_reply, lock_policy_res1));
+ LASSERTF((int)offsetof(struct ldlm_reply, lock_policy_res1) == 104, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_reply, lock_policy_res1));
LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1));
- LASSERTF(offsetof(struct ldlm_reply, lock_policy_res2) == 112, " found %lld\n",
- (long long)offsetof(struct ldlm_reply, lock_policy_res2));
+ LASSERTF((int)offsetof(struct ldlm_reply, lock_policy_res2) == 112, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_reply, lock_policy_res2));
LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2));
/* Checks for struct ost_lvb */
LASSERTF((int)sizeof(struct ost_lvb) == 40, " found %lld\n",
(long long)(int)sizeof(struct ost_lvb));
- LASSERTF(offsetof(struct ost_lvb, lvb_size) == 0, " found %lld\n",
- (long long)offsetof(struct ost_lvb, lvb_size));
+ LASSERTF((int)offsetof(struct ost_lvb, lvb_size) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ost_lvb, lvb_size));
LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_size) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ost_lvb *)0)->lvb_size));
- LASSERTF(offsetof(struct ost_lvb, lvb_mtime) == 8, " found %lld\n",
- (long long)offsetof(struct ost_lvb, lvb_mtime));
+ LASSERTF((int)offsetof(struct ost_lvb, lvb_mtime) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ost_lvb, lvb_mtime));
LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_mtime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ost_lvb *)0)->lvb_mtime));
- LASSERTF(offsetof(struct ost_lvb, lvb_atime) == 16, " found %lld\n",
- (long long)offsetof(struct ost_lvb, lvb_atime));
+ LASSERTF((int)offsetof(struct ost_lvb, lvb_atime) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct ost_lvb, lvb_atime));
LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_atime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ost_lvb *)0)->lvb_atime));
- LASSERTF(offsetof(struct ost_lvb, lvb_ctime) == 24, " found %lld\n",
- (long long)offsetof(struct ost_lvb, lvb_ctime));
+ LASSERTF((int)offsetof(struct ost_lvb, lvb_ctime) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct ost_lvb, lvb_ctime));
LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_ctime) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ost_lvb *)0)->lvb_ctime));
- LASSERTF(offsetof(struct ost_lvb, lvb_blocks) == 32, " found %lld\n",
- (long long)offsetof(struct ost_lvb, lvb_blocks));
+ LASSERTF((int)offsetof(struct ost_lvb, lvb_blocks) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct ost_lvb, lvb_blocks));
LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_blocks) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ost_lvb *)0)->lvb_blocks));
/* Checks for struct ptlbd_op */
LASSERTF((int)sizeof(struct ptlbd_op) == 12, " found %lld\n",
(long long)(int)sizeof(struct ptlbd_op));
- LASSERTF(offsetof(struct ptlbd_op, op_cmd) == 0, " found %lld\n",
- (long long)offsetof(struct ptlbd_op, op_cmd));
+ LASSERTF((int)offsetof(struct ptlbd_op, op_cmd) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_op, op_cmd));
LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_cmd) == 2, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_op *)0)->op_cmd));
- LASSERTF(offsetof(struct ptlbd_op, op_lun) == 2, " found %lld\n",
- (long long)offsetof(struct ptlbd_op, op_lun));
+ LASSERTF((int)offsetof(struct ptlbd_op, op_lun) == 2, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_op, op_lun));
LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_lun) == 2, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_op *)0)->op_lun));
- LASSERTF(offsetof(struct ptlbd_op, op_niob_cnt) == 4, " found %lld\n",
- (long long)offsetof(struct ptlbd_op, op_niob_cnt));
+ LASSERTF((int)offsetof(struct ptlbd_op, op_niob_cnt) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_op, op_niob_cnt));
LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt) == 2, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt));
- LASSERTF(offsetof(struct ptlbd_op, op__padding) == 6, " found %lld\n",
- (long long)offsetof(struct ptlbd_op, op__padding));
+ LASSERTF((int)offsetof(struct ptlbd_op, op__padding) == 6, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_op, op__padding));
LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op__padding) == 2, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_op *)0)->op__padding));
- LASSERTF(offsetof(struct ptlbd_op, op_block_cnt) == 8, " found %lld\n",
- (long long)offsetof(struct ptlbd_op, op_block_cnt));
+ LASSERTF((int)offsetof(struct ptlbd_op, op_block_cnt) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_op, op_block_cnt));
LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_block_cnt) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_op *)0)->op_block_cnt));
/* Checks for struct ptlbd_niob */
LASSERTF((int)sizeof(struct ptlbd_niob) == 24, " found %lld\n",
(long long)(int)sizeof(struct ptlbd_niob));
- LASSERTF(offsetof(struct ptlbd_niob, n_xid) == 0, " found %lld\n",
- (long long)offsetof(struct ptlbd_niob, n_xid));
+ LASSERTF((int)offsetof(struct ptlbd_niob, n_xid) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_niob, n_xid));
LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_xid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_niob *)0)->n_xid));
- LASSERTF(offsetof(struct ptlbd_niob, n_block_nr) == 8, " found %lld\n",
- (long long)offsetof(struct ptlbd_niob, n_block_nr));
+ LASSERTF((int)offsetof(struct ptlbd_niob, n_block_nr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_niob, n_block_nr));
LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_block_nr) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_niob *)0)->n_block_nr));
- LASSERTF(offsetof(struct ptlbd_niob, n_offset) == 16, " found %lld\n",
- (long long)offsetof(struct ptlbd_niob, n_offset));
+ LASSERTF((int)offsetof(struct ptlbd_niob, n_offset) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_niob, n_offset));
LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_offset) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_niob *)0)->n_offset));
- LASSERTF(offsetof(struct ptlbd_niob, n_length) == 20, " found %lld\n",
- (long long)offsetof(struct ptlbd_niob, n_length));
+ LASSERTF((int)offsetof(struct ptlbd_niob, n_length) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_niob, n_length));
LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_length) == 4, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_niob *)0)->n_length));
/* Checks for struct ptlbd_rsp */
LASSERTF((int)sizeof(struct ptlbd_rsp) == 4, " found %lld\n",
(long long)(int)sizeof(struct ptlbd_rsp));
- LASSERTF(offsetof(struct ptlbd_rsp, r_status) == 0, " found %lld\n",
- (long long)offsetof(struct ptlbd_rsp, r_status));
+ LASSERTF((int)offsetof(struct ptlbd_rsp, r_status) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_rsp, r_status));
LASSERTF((int)sizeof(((struct ptlbd_rsp *)0)->r_status) == 2, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_rsp *)0)->r_status));
- LASSERTF(offsetof(struct ptlbd_rsp, r_error_cnt) == 2, " found %lld\n",
- (long long)offsetof(struct ptlbd_rsp, r_error_cnt));
+ LASSERTF((int)offsetof(struct ptlbd_rsp, r_error_cnt) == 2, " found %lld\n",
+ (long long)(int)offsetof(struct ptlbd_rsp, r_error_cnt));
LASSERTF((int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt) == 2, " found %lld\n",
(long long)(int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt));
/* Checks for struct llog_logid */
LASSERTF((int)sizeof(struct llog_logid) == 20, " found %lld\n",
(long long)(int)sizeof(struct llog_logid));
- LASSERTF(offsetof(struct llog_logid, lgl_oid) == 0, " found %lld\n",
- (long long)offsetof(struct llog_logid, lgl_oid));
+ LASSERTF((int)offsetof(struct llog_logid, lgl_oid) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid, lgl_oid));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_oid));
- LASSERTF(offsetof(struct llog_logid, lgl_ogr) == 8, " found %lld\n",
- (long long)offsetof(struct llog_logid, lgl_ogr));
+ LASSERTF((int)offsetof(struct llog_logid, lgl_ogr) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid, lgl_ogr));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogr));
- LASSERTF(offsetof(struct llog_logid, lgl_ogen) == 16, " found %lld\n",
- (long long)offsetof(struct llog_logid, lgl_ogen));
+ LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid, lgl_ogen));
LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogen));
LASSERTF(OST_SZ_REC == 274730752, " found %lld\n",
/* Checks for struct llog_catid */
LASSERTF((int)sizeof(struct llog_catid) == 32, " found %lld\n",
(long long)(int)sizeof(struct llog_catid));
- LASSERTF(offsetof(struct llog_catid, lci_logid) == 0, " found %lld\n",
- (long long)offsetof(struct llog_catid, lci_logid));
+ LASSERTF((int)offsetof(struct llog_catid, lci_logid) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_catid, lci_logid));
LASSERTF((int)sizeof(((struct llog_catid *)0)->lci_logid) == 20, " found %lld\n",
(long long)(int)sizeof(((struct llog_catid *)0)->lci_logid));
/* Checks for struct llog_rec_hdr */
LASSERTF((int)sizeof(struct llog_rec_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(struct llog_rec_hdr));
- LASSERTF(offsetof(struct llog_rec_hdr, lrh_len) == 0, " found %lld\n",
- (long long)offsetof(struct llog_rec_hdr, lrh_len));
+ LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_len) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_rec_hdr, lrh_len));
LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_len) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_len));
- LASSERTF(offsetof(struct llog_rec_hdr, lrh_index) == 4, " found %lld\n",
- (long long)offsetof(struct llog_rec_hdr, lrh_index));
+ LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_index) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct llog_rec_hdr, lrh_index));
LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_index) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_index));
- LASSERTF(offsetof(struct llog_rec_hdr, lrh_type) == 8, " found %lld\n",
- (long long)offsetof(struct llog_rec_hdr, lrh_type));
+ LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_type) == 8, " found %lld\n",
+ (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));
/* Checks for struct llog_rec_tail */
LASSERTF((int)sizeof(struct llog_rec_tail) == 8, " found %lld\n",
(long long)(int)sizeof(struct llog_rec_tail));
- LASSERTF(offsetof(struct llog_rec_tail, lrt_len) == 0, " found %lld\n",
- (long long)offsetof(struct llog_rec_tail, lrt_len));
+ LASSERTF((int)offsetof(struct llog_rec_tail, lrt_len) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_rec_tail, lrt_len));
LASSERTF((int)sizeof(((struct llog_rec_tail *)0)->lrt_len) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_rec_tail *)0)->lrt_len));
- LASSERTF(offsetof(struct llog_rec_tail, lrt_index) == 4, " found %lld\n",
- (long long)offsetof(struct llog_rec_tail, lrt_index));
+ LASSERTF((int)offsetof(struct llog_rec_tail, lrt_index) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct llog_rec_tail, lrt_index));
LASSERTF((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_rec_tail *)0)->lrt_index));
/* Checks for struct llog_logid_rec */
LASSERTF((int)sizeof(struct llog_logid_rec) == 64, " found %lld\n",
(long long)(int)sizeof(struct llog_logid_rec));
- LASSERTF(offsetof(struct llog_logid_rec, lid_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_logid_rec, lid_hdr));
+ LASSERTF((int)offsetof(struct llog_logid_rec, lid_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid_rec, lid_hdr));
LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_hdr));
- LASSERTF(offsetof(struct llog_logid_rec, lid_id) == 16, " found %lld\n",
- (long long)offsetof(struct llog_logid_rec, lid_id));
+ LASSERTF((int)offsetof(struct llog_logid_rec, lid_id) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid_rec, lid_id));
LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_id));
- LASSERTF(offsetof(struct llog_logid_rec, lid_tail) == 56, " found %lld\n",
- (long long)offsetof(struct llog_logid_rec, lid_tail));
+ LASSERTF((int)offsetof(struct llog_logid_rec, lid_tail) == 56, " found %lld\n",
+ (long long)(int)offsetof(struct llog_logid_rec, lid_tail));
LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_tail));
/* Checks for struct llog_create_rec */
LASSERTF((int)sizeof(struct llog_create_rec) == 56, " found %lld\n",
(long long)(int)sizeof(struct llog_create_rec));
- LASSERTF(offsetof(struct llog_create_rec, lcr_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_create_rec, lcr_hdr));
+ LASSERTF((int)offsetof(struct llog_create_rec, lcr_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_create_rec, lcr_hdr));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_hdr));
- LASSERTF(offsetof(struct llog_create_rec, lcr_fid) == 16, " found %lld\n",
- (long long)offsetof(struct llog_create_rec, lcr_fid));
+ LASSERTF((int)offsetof(struct llog_create_rec, lcr_fid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_create_rec, lcr_fid));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_fid) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_fid));
- LASSERTF(offsetof(struct llog_create_rec, lcr_oid) == 32, " found %lld\n",
- (long long)offsetof(struct llog_create_rec, lcr_oid));
+ LASSERTF((int)offsetof(struct llog_create_rec, lcr_oid) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llog_create_rec, lcr_oid));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_oid));
- LASSERTF(offsetof(struct llog_create_rec, lcr_ogen) == 40, " found %lld\n",
- (long long)offsetof(struct llog_create_rec, lcr_ogen));
+ LASSERTF((int)offsetof(struct llog_create_rec, lcr_ogen) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct llog_create_rec, lcr_ogen));
LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_ogen) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_ogen));
/* Checks for struct llog_orphan_rec */
LASSERTF((int)sizeof(struct llog_orphan_rec) == 40, " found %lld\n",
(long long)(int)sizeof(struct llog_orphan_rec));
- LASSERTF(offsetof(struct llog_orphan_rec, lor_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_orphan_rec, lor_hdr));
+ LASSERTF((int)offsetof(struct llog_orphan_rec, lor_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_orphan_rec, lor_hdr));
LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr));
- LASSERTF(offsetof(struct llog_orphan_rec, lor_oid) == 16, " found %lld\n",
- (long long)offsetof(struct llog_orphan_rec, lor_oid));
+ LASSERTF((int)offsetof(struct llog_orphan_rec, lor_oid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_orphan_rec, lor_oid));
LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_oid));
- LASSERTF(offsetof(struct llog_orphan_rec, lor_ogen) == 24, " found %lld\n",
- (long long)offsetof(struct llog_orphan_rec, lor_ogen));
+ LASSERTF((int)offsetof(struct llog_orphan_rec, lor_ogen) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_orphan_rec, lor_ogen));
LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen));
- LASSERTF(offsetof(struct llog_orphan_rec, lor_tail) == 32, " found %lld\n",
- (long long)offsetof(struct llog_orphan_rec, lor_tail));
+ LASSERTF((int)offsetof(struct llog_orphan_rec, lor_tail) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llog_orphan_rec, lor_tail));
LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_tail));
/* Checks for struct llog_unlink_rec */
LASSERTF((int)sizeof(struct llog_unlink_rec) == 40, " found %lld\n",
(long long)(int)sizeof(struct llog_unlink_rec));
- LASSERTF(offsetof(struct llog_unlink_rec, lur_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_unlink_rec, lur_hdr));
+ LASSERTF((int)offsetof(struct llog_unlink_rec, lur_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_unlink_rec, lur_hdr));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr));
- LASSERTF(offsetof(struct llog_unlink_rec, lur_oid) == 16, " found %lld\n",
- (long long)offsetof(struct llog_unlink_rec, lur_oid));
+ LASSERTF((int)offsetof(struct llog_unlink_rec, lur_oid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_unlink_rec, lur_oid));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oid));
- LASSERTF(offsetof(struct llog_unlink_rec, lur_ogen) == 24, " found %lld\n",
- (long long)offsetof(struct llog_unlink_rec, lur_ogen));
+ LASSERTF((int)offsetof(struct llog_unlink_rec, lur_ogen) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_unlink_rec, lur_ogen));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen));
- LASSERTF(offsetof(struct llog_unlink_rec, lur_tail) == 32, " found %lld\n",
- (long long)offsetof(struct llog_unlink_rec, lur_tail));
+ LASSERTF((int)offsetof(struct llog_unlink_rec, lur_tail) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llog_unlink_rec, lur_tail));
LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_tail));
/* Checks for struct llog_size_change_rec */
LASSERTF((int)sizeof(struct llog_size_change_rec) == 48, " found %lld\n",
(long long)(int)sizeof(struct llog_size_change_rec));
- LASSERTF(offsetof(struct llog_size_change_rec, lsc_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_size_change_rec, lsc_hdr));
+ LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_size_change_rec, lsc_hdr));
LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr));
- LASSERTF(offsetof(struct llog_size_change_rec, lsc_fid) == 16, " found %lld\n",
- (long long)offsetof(struct llog_size_change_rec, lsc_fid));
+ LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_fid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_size_change_rec, lsc_fid));
LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid));
- LASSERTF(offsetof(struct llog_size_change_rec, lsc_io_epoch) == 32, " found %lld\n",
- (long long)offsetof(struct llog_size_change_rec, lsc_io_epoch));
+ LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_io_epoch) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llog_size_change_rec, lsc_io_epoch));
LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch));
- LASSERTF(offsetof(struct llog_size_change_rec, lsc_tail) == 40, " found %lld\n",
- (long long)offsetof(struct llog_size_change_rec, lsc_tail));
+ LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_tail) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct llog_size_change_rec, lsc_tail));
LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail));
/* Checks for struct llog_gen */
LASSERTF((int)sizeof(struct llog_gen) == 16, " found %lld\n",
(long long)(int)sizeof(struct llog_gen));
- LASSERTF(offsetof(struct llog_gen, mnt_cnt) == 0, " found %lld\n",
- (long long)offsetof(struct llog_gen, mnt_cnt));
+ LASSERTF((int)offsetof(struct llog_gen, mnt_cnt) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_gen, mnt_cnt));
LASSERTF((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_gen *)0)->mnt_cnt));
- LASSERTF(offsetof(struct llog_gen, conn_cnt) == 8, " found %lld\n",
- (long long)offsetof(struct llog_gen, conn_cnt));
+ LASSERTF((int)offsetof(struct llog_gen, conn_cnt) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct llog_gen, conn_cnt));
LASSERTF((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_gen *)0)->conn_cnt));
/* Checks for struct llog_gen_rec */
LASSERTF((int)sizeof(struct llog_gen_rec) == 40, " found %lld\n",
(long long)(int)sizeof(struct llog_gen_rec));
- LASSERTF(offsetof(struct llog_gen_rec, lgr_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_gen_rec, lgr_hdr));
+ LASSERTF((int)offsetof(struct llog_gen_rec, lgr_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_gen_rec, lgr_hdr));
LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr));
- LASSERTF(offsetof(struct llog_gen_rec, lgr_gen) == 16, " found %lld\n",
- (long long)offsetof(struct llog_gen_rec, lgr_gen));
+ LASSERTF((int)offsetof(struct llog_gen_rec, lgr_gen) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_gen_rec, lgr_gen));
LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_gen));
- LASSERTF(offsetof(struct llog_gen_rec, lgr_tail) == 32, " found %lld\n",
- (long long)offsetof(struct llog_gen_rec, lgr_tail));
+ LASSERTF((int)offsetof(struct llog_gen_rec, lgr_tail) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llog_gen_rec, lgr_tail));
LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_tail));
/* Checks for struct llog_log_hdr */
LASSERTF((int)sizeof(struct llog_log_hdr) == 8192, " found %lld\n",
(long long)(int)sizeof(struct llog_log_hdr));
- LASSERTF(offsetof(struct llog_log_hdr, llh_hdr) == 0, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_hdr));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_hdr) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_hdr));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_hdr) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_hdr));
- LASSERTF(offsetof(struct llog_log_hdr, llh_timestamp) == 16, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_timestamp));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_timestamp) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_timestamp));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp));
- LASSERTF(offsetof(struct llog_log_hdr, llh_count) == 24, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_count));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_count) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_count));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_count) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_count));
- LASSERTF(offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_bitmap_offset));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap_offset));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset));
- LASSERTF(offsetof(struct llog_log_hdr, llh_size) == 32, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_size));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_size) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_size));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_size) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_size));
- LASSERTF(offsetof(struct llog_log_hdr, llh_flags) == 36, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_flags));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_flags) == 36, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_flags));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_flags));
- LASSERTF(offsetof(struct llog_log_hdr, llh_cat_idx) == 40, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_cat_idx));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_cat_idx) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_cat_idx));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx));
- LASSERTF(offsetof(struct llog_log_hdr, llh_tgtuuid) == 44, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_tgtuuid));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_tgtuuid) == 44, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_tgtuuid));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid));
- LASSERTF(offsetof(struct llog_log_hdr, llh_reserved) == 84, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_reserved));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_reserved));
- LASSERTF(offsetof(struct llog_log_hdr, llh_bitmap) == 88, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_bitmap));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap) == 88, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap));
- LASSERTF(offsetof(struct llog_log_hdr, llh_tail) == 8184, " found %lld\n",
- (long long)offsetof(struct llog_log_hdr, llh_tail));
+ LASSERTF((int)offsetof(struct llog_log_hdr, llh_tail) == 8184, " found %lld\n",
+ (long long)(int)offsetof(struct llog_log_hdr, llh_tail));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tail));
/* Checks for struct llog_cookie */
LASSERTF((int)sizeof(struct llog_cookie) == 32, " found %lld\n",
(long long)(int)sizeof(struct llog_cookie));
- LASSERTF(offsetof(struct llog_cookie, lgc_lgl) == 0, " found %lld\n",
- (long long)offsetof(struct llog_cookie, lgc_lgl));
+ LASSERTF((int)offsetof(struct llog_cookie, lgc_lgl) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llog_cookie, lgc_lgl));
LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_lgl) == 20, " found %lld\n",
(long long)(int)sizeof(((struct llog_cookie *)0)->lgc_lgl));
- LASSERTF(offsetof(struct llog_cookie, lgc_subsys) == 20, " found %lld\n",
- (long long)offsetof(struct llog_cookie, lgc_subsys));
+ LASSERTF((int)offsetof(struct llog_cookie, lgc_subsys) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct llog_cookie, lgc_subsys));
LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_subsys) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_cookie *)0)->lgc_subsys));
- LASSERTF(offsetof(struct llog_cookie, lgc_index) == 24, " found %lld\n",
- (long long)offsetof(struct llog_cookie, lgc_index));
+ LASSERTF((int)offsetof(struct llog_cookie, lgc_index) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llog_cookie, lgc_index));
LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_index) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llog_cookie *)0)->lgc_index));
/* Checks for struct llogd_body */
LASSERTF((int)sizeof(struct llogd_body) == 48, " found %lld\n",
(long long)(int)sizeof(struct llogd_body));
- LASSERTF(offsetof(struct llogd_body, lgd_logid) == 0, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_logid));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_logid) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_logid));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_logid) == 20, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_logid));
- LASSERTF(offsetof(struct llogd_body, lgd_ctxt_idx) == 20, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_ctxt_idx));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_ctxt_idx) == 20, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_ctxt_idx));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx));
- LASSERTF(offsetof(struct llogd_body, lgd_llh_flags) == 24, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_llh_flags));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_llh_flags) == 24, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_llh_flags));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_llh_flags) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_llh_flags));
- LASSERTF(offsetof(struct llogd_body, lgd_index) == 28, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_index));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_index) == 28, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_index));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_index) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_index));
- LASSERTF(offsetof(struct llogd_body, lgd_saved_index) == 32, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_saved_index));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_saved_index) == 32, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_saved_index));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_saved_index) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_saved_index));
- LASSERTF(offsetof(struct llogd_body, lgd_len) == 36, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_len));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_len) == 36, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_len));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_len) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_len));
- LASSERTF(offsetof(struct llogd_body, lgd_cur_offset) == 40, " found %lld\n",
- (long long)offsetof(struct llogd_body, lgd_cur_offset));
+ LASSERTF((int)offsetof(struct llogd_body, lgd_cur_offset) == 40, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_body, lgd_cur_offset));
LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8, " found %lld\n",
(long long)(int)sizeof(((struct llogd_body *)0)->lgd_cur_offset));
- LASSERTF(LLOG_ORIGIN_HANDLE_CREATE == 501, " found %lld\n",
- (long long)LLOG_ORIGIN_HANDLE_CREATE);
+ LASSERTF(LLOG_ORIGIN_HANDLE_OPEN == 501, " found %lld\n",
+ (long long)LLOG_ORIGIN_HANDLE_OPEN);
LASSERTF(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502, " found %lld\n",
(long long)LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
LASSERTF(LLOG_ORIGIN_HANDLE_READ_HEADER == 503, " found %lld\n",
/* Checks for struct llogd_conn_body */
LASSERTF((int)sizeof(struct llogd_conn_body) == 40, " found %lld\n",
(long long)(int)sizeof(struct llogd_conn_body));
- LASSERTF(offsetof(struct llogd_conn_body, lgdc_gen) == 0, " found %lld\n",
- (long long)offsetof(struct llogd_conn_body, lgdc_gen));
+ LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_gen) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_conn_body, lgdc_gen));
LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen) == 16, " found %lld\n",
(long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen));
- LASSERTF(offsetof(struct llogd_conn_body, lgdc_logid) == 16, " found %lld\n",
- (long long)offsetof(struct llogd_conn_body, lgdc_logid));
+ LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_logid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_conn_body, lgdc_logid));
LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid) == 20, " found %lld\n",
(long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid));
- LASSERTF(offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36, " found %lld\n",
- (long long)offsetof(struct llogd_conn_body, lgdc_ctxt_idx));
+ LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36, " found %lld\n",
+ (long long)(int)offsetof(struct llogd_conn_body, lgdc_ctxt_idx));
LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx) == 4, " found %lld\n",
(long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx));
}