From 72855636a60fe76ea105506178052b01816f1cbc Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 10 Feb 2004 20:32:56 +0000 Subject: [PATCH] Landing b_smallfix onto HEAD (20040210_1202) --- lnet/include/linux/kp30.h | 7 +- lnet/klnds/socklnd/socklnd.c | 2 +- lnet/utils/wirecheck.c | 168 +-- .../patches/ext3-truncate-buffer-head.patch | 2 +- lustre/ldlm/ldlm_lock.c | 13 +- lustre/ldlm/ldlm_request.c | 6 +- lustre/ldlm/ldlm_resource.c | 6 +- lustre/llite/file.c | 2 - lustre/lov/lov_obd.c | 8 +- lustre/lov/lproc_lov.c | 2 +- lustre/mds/mds_open.c | 8 +- lustre/mds/mds_reint.c | 4 +- lustre/mds/mds_unlink_open.c | 17 +- lustre/obdclass/lprocfs_status.c | 2 +- lustre/obdclass/obd_config.c | 215 ++-- lustre/obdclass/sysctl.c | 76 +- lustre/osc/osc_request.c | 12 +- lustre/portals/include/linux/kp30.h | 7 +- lustre/portals/knals/socknal/socknal.c | 2 +- lustre/portals/utils/wirecheck.c | 168 +-- lustre/ptlrpc/pack_generic.c | 1206 ++++++++++++-------- lustre/scripts/lustre.spec.in | 24 +- lustre/tests/openfile.c | 22 +- lustre/tests/sanity.sh | 77 +- lustre/tests/sanityN.sh | 23 +- lustre/utils/lfs.c | 6 +- lustre/utils/lmc | 14 +- lustre/utils/wirecheck.c | 77 +- lustre/utils/wirehdr.c | 4 + lustre/utils/wiretest.c | 78 +- 30 files changed, 1340 insertions(+), 918 deletions(-) diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index 12d9f56..0c4c4a0 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -97,10 +97,9 @@ extern unsigned int portal_cerror; #define CHECK_STACK(stack) \ do { \ if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) { \ - portals_debug_msg(DEBUG_SUBSYSTEM, D_ERROR, \ + portals_debug_msg(DEBUG_SUBSYSTEM, D_WARNING, \ __FILE__, __FUNCTION__, __LINE__, \ - (stack), \ - "maximum lustre stack %u\n", \ + (stack),"maximum lustre stack %u\n",\ portal_stack = (stack)); \ /*panic("LBUG");*/ \ } \ @@ -185,7 +184,7 @@ do { \ PREPARE_TQUEUE((wq), (cb), (cbdata)); \ } while (0) -#define ll_invalidate_inode_pages invalidate_inode_pages +#define ll_invalidate_inode_pages(inode) invalidate_inode_pages(inode) #define PageUptodate Page_Uptodate #define our_recalc_sigpending(current) recalc_sigpending(current) #define num_online_cpus() smp_num_cpus diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 0775fcc..9ae1c87 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -56,7 +56,7 @@ static ctl_table ksocknal_ctl_table[] = { &ksocknal_data.ksnd_eager_ack, sizeof (int), 0644, NULL, &proc_dointvec}, #if SOCKNAL_ZC - {SOCKNAL_SYSCTL_EAGER_ACK, "zero_copy", + {SOCKNAL_SYSCTL_ZERO_COPY, "zero_copy", &ksocknal_data.ksnd_zc_min_frag, sizeof (int), 0644, NULL, &proc_dointvec}, #endif diff --git a/lnet/utils/wirecheck.c b/lnet/utils/wirecheck.c index 77ad126..a73a5217 100644 --- a/lnet/utils/wirecheck.c +++ b/lnet/utils/wirecheck.c @@ -10,80 +10,80 @@ extern size_t strnlen(const char *, size_t); -#define BLANK_LINE() \ -do { \ - printf ("\n"); \ +#define BLANK_LINE() \ +do { \ + printf ("\n"); \ } while (0) -#define COMMENT(c) \ -do { \ - printf (" /* "c" */\n"); \ +#define COMMENT(c) \ +do { \ + printf (" /* "c" */\n"); \ } while (0) #define STRINGIFY(a) #a -#define CHECK_DEFINE(a) \ -do { \ - printf (" LASSERT ("#a" == "STRINGIFY(a)");\n"); \ +#define CHECK_DEFINE(a) \ +do { \ + printf (" LASSERT ("#a" == "STRINGIFY(a)");\n"); \ } while (0) -#define CHECK_VALUE(a) \ -do { \ - printf (" LASSERT ("#a" == %d);\n", a); \ +#define CHECK_VALUE(a) \ +do { \ + printf (" LASSERT ("#a" == %d);\n", a); \ } while (0) -#define CHECK_MEMBER_OFFSET(s,m) \ -do { \ - CHECK_VALUE(offsetof(s, m)); \ +#define CHECK_MEMBER_OFFSET(s,m) \ +do { \ + CHECK_VALUE(offsetof(s, m)); \ } while (0) -#define CHECK_MEMBER_SIZEOF(s,m) \ -do { \ - CHECK_VALUE((int)sizeof(((s *)0)->m)); \ +#define CHECK_MEMBER_SIZEOF(s,m) \ +do { \ + CHECK_VALUE((int)sizeof(((s *)0)->m)); \ } while (0) -#define CHECK_MEMBER(s,m) \ -do { \ - CHECK_MEMBER_OFFSET(s, m); \ - CHECK_MEMBER_SIZEOF(s, m); \ +#define CHECK_MEMBER(s,m) \ +do { \ + CHECK_MEMBER_OFFSET(s, m); \ + CHECK_MEMBER_SIZEOF(s, m); \ } while (0) #define CHECK_STRUCT(s) \ do { \ BLANK_LINE (); \ COMMENT ("Checks for struct "#s); \ - CHECK_VALUE((int)sizeof(s)); \ + CHECK_VALUE((int)sizeof(s)); \ } while (0) void check_ptl_handle_wire (void) { - CHECK_STRUCT (ptl_handle_wire_t); - CHECK_MEMBER (ptl_handle_wire_t, wh_interface_cookie); - CHECK_MEMBER (ptl_handle_wire_t, wh_object_cookie); + CHECK_STRUCT (ptl_handle_wire_t); + CHECK_MEMBER (ptl_handle_wire_t, wh_interface_cookie); + CHECK_MEMBER (ptl_handle_wire_t, wh_object_cookie); } void check_ptl_magicversion (void) { - CHECK_STRUCT (ptl_magicversion_t); - CHECK_MEMBER (ptl_magicversion_t, magic); - CHECK_MEMBER (ptl_magicversion_t, version_major); - CHECK_MEMBER (ptl_magicversion_t, version_minor); + CHECK_STRUCT (ptl_magicversion_t); + CHECK_MEMBER (ptl_magicversion_t, magic); + CHECK_MEMBER (ptl_magicversion_t, version_major); + CHECK_MEMBER (ptl_magicversion_t, version_minor); } void check_ptl_hdr (void) { - CHECK_STRUCT (ptl_hdr_t); - CHECK_MEMBER (ptl_hdr_t, dest_nid); - CHECK_MEMBER (ptl_hdr_t, src_nid); - CHECK_MEMBER (ptl_hdr_t, dest_pid); - CHECK_MEMBER (ptl_hdr_t, src_pid); - CHECK_MEMBER (ptl_hdr_t, type); - CHECK_MEMBER (ptl_hdr_t, payload_length); + CHECK_STRUCT (ptl_hdr_t); + CHECK_MEMBER (ptl_hdr_t, dest_nid); + CHECK_MEMBER (ptl_hdr_t, src_nid); + CHECK_MEMBER (ptl_hdr_t, dest_pid); + CHECK_MEMBER (ptl_hdr_t, src_pid); + CHECK_MEMBER (ptl_hdr_t, type); + CHECK_MEMBER (ptl_hdr_t, payload_length); CHECK_MEMBER (ptl_hdr_t, msg); - + BLANK_LINE (); COMMENT ("Ack"); CHECK_MEMBER (ptl_hdr_t, msg.ack.dst_wmd); @@ -92,28 +92,28 @@ check_ptl_hdr (void) BLANK_LINE (); COMMENT ("Put"); - CHECK_MEMBER (ptl_hdr_t, msg.put.ack_wmd); - CHECK_MEMBER (ptl_hdr_t, msg.put.match_bits); - CHECK_MEMBER (ptl_hdr_t, msg.put.hdr_data); - CHECK_MEMBER (ptl_hdr_t, msg.put.ptl_index); - CHECK_MEMBER (ptl_hdr_t, msg.put.offset); + CHECK_MEMBER (ptl_hdr_t, msg.put.ack_wmd); + CHECK_MEMBER (ptl_hdr_t, msg.put.match_bits); + CHECK_MEMBER (ptl_hdr_t, msg.put.hdr_data); + CHECK_MEMBER (ptl_hdr_t, msg.put.ptl_index); + CHECK_MEMBER (ptl_hdr_t, msg.put.offset); BLANK_LINE (); COMMENT ("Get"); - CHECK_MEMBER (ptl_hdr_t, msg.get.return_wmd); - CHECK_MEMBER (ptl_hdr_t, msg.get.match_bits); - CHECK_MEMBER (ptl_hdr_t, msg.get.ptl_index); - CHECK_MEMBER (ptl_hdr_t, msg.get.src_offset); - CHECK_MEMBER (ptl_hdr_t, msg.get.sink_length); + CHECK_MEMBER (ptl_hdr_t, msg.get.return_wmd); + CHECK_MEMBER (ptl_hdr_t, msg.get.match_bits); + CHECK_MEMBER (ptl_hdr_t, msg.get.ptl_index); + CHECK_MEMBER (ptl_hdr_t, msg.get.src_offset); + CHECK_MEMBER (ptl_hdr_t, msg.get.sink_length); BLANK_LINE (); COMMENT ("Reply"); - CHECK_MEMBER (ptl_hdr_t, msg.reply.dst_wmd); + CHECK_MEMBER (ptl_hdr_t, msg.reply.dst_wmd); BLANK_LINE (); COMMENT ("Hello"); - CHECK_MEMBER (ptl_hdr_t, msg.hello.incarnation); - CHECK_MEMBER (ptl_hdr_t, msg.hello.type); + CHECK_MEMBER (ptl_hdr_t, msg.hello.incarnation); + CHECK_MEMBER (ptl_hdr_t, msg.hello.type); } void @@ -122,11 +122,11 @@ system_string (char *cmdline, char *str, int len) int fds[2]; int rc; pid_t pid; - + rc = pipe (fds); if (rc != 0) abort (); - + pid = fork (); if (pid == 0) { /* child */ @@ -145,25 +145,25 @@ system_string (char *cmdline, char *str, int len) if (f == NULL) abort(); - + close(fds[1]); - + if (fgets(str, len, f) == NULL) abort(); - + if (waitpid(pid, &rc, 0) != pid) abort(); - + if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0) abort(); if (strnlen(str, len) == len) str[len - 1] = 0; - + if (str[strlen(str) - 1] == '\n') str[strlen(str) - 1] = 0; - + fclose(f); } } @@ -173,35 +173,35 @@ main (int argc, char **argv) { char unameinfo[80]; char gccinfo[80]; - + system_string("uname -a", unameinfo, sizeof(unameinfo)); system_string("gcc -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo)); - - printf ("void lib_assert_wire_constants (void)\n" - "{\n" + + printf ("void lib_assert_wire_constants (void)\n" + "{\n" " /* Wire protocol assertions generated by 'wirecheck'\n" " * running on %s\n" " * with %s */\n" "\n", unameinfo, gccinfo); - - BLANK_LINE (); - - COMMENT ("Constants..."); - CHECK_DEFINE (PORTALS_PROTO_MAGIC); - CHECK_DEFINE (PORTALS_PROTO_VERSION_MAJOR); - CHECK_DEFINE (PORTALS_PROTO_VERSION_MINOR); - - CHECK_VALUE (PTL_MSG_ACK); - CHECK_VALUE (PTL_MSG_PUT); - CHECK_VALUE (PTL_MSG_GET); - CHECK_VALUE (PTL_MSG_REPLY); - CHECK_VALUE (PTL_MSG_HELLO); - - check_ptl_handle_wire (); - check_ptl_magicversion (); - check_ptl_hdr (); - - printf ("}\n\n"); - - return (0); + + BLANK_LINE (); + + COMMENT ("Constants..."); + CHECK_DEFINE (PORTALS_PROTO_MAGIC); + CHECK_DEFINE (PORTALS_PROTO_VERSION_MAJOR); + CHECK_DEFINE (PORTALS_PROTO_VERSION_MINOR); + + CHECK_VALUE (PTL_MSG_ACK); + CHECK_VALUE (PTL_MSG_PUT); + CHECK_VALUE (PTL_MSG_GET); + CHECK_VALUE (PTL_MSG_REPLY); + CHECK_VALUE (PTL_MSG_HELLO); + + check_ptl_handle_wire (); + check_ptl_magicversion (); + check_ptl_hdr (); + + printf ("}\n\n"); + + return (0); } diff --git a/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch b/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch index f6be984..3741213 100644 --- a/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch +++ b/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch @@ -4,7 +4,7 @@ if (ext3_should_order_data(inode)) err = ext3_journal_dirty_data(handle, bh, 0); __mark_buffer_dirty(bh); -+ buffer_insert_inode_data_queue(bh, inode); ++ buffer_insert_inode_data_queue(bh, inode); } unlock: diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 14b2971..9ed2684 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -1059,7 +1059,6 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, void ldlm_lock_dump(int level, struct ldlm_lock *lock, int pos) { - char ver[128]; char str[PTL_NALFMT_SIZE]; struct obd_device *obd = NULL; @@ -1074,13 +1073,11 @@ void ldlm_lock_dump(int level, struct ldlm_lock *lock, int pos) return; } - snprintf(ver, sizeof(ver), "%x %x %x %x", - lock->l_version[0], lock->l_version[1], - lock->l_version[2], lock->l_version[3]); - - CDEBUG(level, " -- Lock dump: %p/"LPX64" (%s) (rc: %d) (pos: %d)\n", - lock, lock->l_handle.h_cookie, ver, atomic_read(&lock->l_refc), - pos); + CDEBUG(level, + " -- Lock dump: %p/"LPX64" (%x %x %x %x) (rc: %d) (pos: %d)\n", + lock, lock->l_handle.h_cookie, lock->l_version[0], + lock->l_version[1], lock->l_version[2], lock->l_version[3], + atomic_read(&lock->l_refc), pos); if (lock->l_conn_export != NULL) obd = lock->l_conn_export->exp_obd; if (lock->l_export && lock->l_export->exp_connection) { diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index a8f006a..9c03aeb 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -42,20 +42,18 @@ struct lock_wait_data { int ldlm_expired_completion_wait(void *data) { - static unsigned long next_dump = 0; struct lock_wait_data *lwd = data; struct ldlm_lock *lock = lwd->lwd_lock; struct obd_import *imp; struct obd_device *obd; if (lock->l_conn_export == NULL) { + static unsigned long next_dump = 0; + LDLM_ERROR(lock, "lock timed out; not entering recovery in " "server code, just going back to sleep"); if (time_after(jiffies, next_dump)) { - unsigned int debug = portal_debug; - portal_debug |= D_OTHER; ldlm_namespace_dump(lock->l_resource->lr_namespace); - portal_debug = debug; if (next_dump == 0) portals_debug_dumplog(); next_dump = jiffies + 300 * HZ; diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 7043171..416b28b 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -40,7 +40,8 @@ struct proc_dir_entry *ldlm_ns_proc_dir = NULL; struct proc_dir_entry *ldlm_svc_proc_dir = NULL; #ifdef __KERNEL__ -static int ldlm_proc_dump_ns(struct file *file, const char *buffer, unsigned long count, void *data) +static int ldlm_proc_dump_ns(struct file *file, const char *buffer, + unsigned long count, void *data) { ldlm_dump_all_namespaces(); RETURN(count); @@ -646,7 +647,9 @@ void ldlm_dump_all_namespaces(void) void ldlm_namespace_dump(struct ldlm_namespace *ns) { struct list_head *tmp; + unsigned int debug_save = portal_debug; + portal_debug |= D_OTHER; l_lock(&ns->ns_lock); CDEBUG(D_OTHER, "--- Namespace: %s (rc: %d, client: %d)\n", ns->ns_name, ns->ns_refcount, ns->ns_client); @@ -660,6 +663,7 @@ void ldlm_namespace_dump(struct ldlm_namespace *ns) ldlm_resource_dump(res); } l_unlock(&ns->ns_lock); + portal_debug = debug_save; } void ldlm_resource_dump(struct ldlm_resource *res) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index c7bb5a6..1f6c88a 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -25,8 +25,6 @@ #define DEBUG_SUBSYSTEM S_LLITE #include #include -#include /* for lov_mds_md_size() in lov_setstripe() */ -#include #include #include #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 061cd61..0f5715b 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -361,8 +361,8 @@ static int lov_setup(struct obd_device *obd, obd_count len, void *buf) count = desc->ld_tgt_count; uuids = (struct obd_uuid *)lcfg->lcfg_inlbuf2; if (sizeof(*uuids) * count != lcfg->lcfg_inllen2) { - CERROR("UUID array size wrong: "LPSZ" * %u != %u\n", - sizeof(*uuids), count, lcfg->lcfg_inllen2); + CERROR("UUID array size wrong: %u * %u != %u\n", + (int)sizeof(*uuids), count, lcfg->lcfg_inllen2); RETURN(-EINVAL); } @@ -736,8 +736,8 @@ static int lov_create(struct obd_export *exp, struct obdo *src_oa, } } - CERROR("reallocating LSM for objid "LPX64": old %u new %u\n", - lsm->lsm_object_id, lsm->lsm_stripe_count, obj_alloc); + CWARN("using fewer stripes for object "LPX64": old %u new %u\n", + lsm->lsm_object_id, lsm->lsm_stripe_count, obj_alloc); oldsize = lov_stripe_md_size(lsm->lsm_stripe_count); newsize = lov_stripe_md_size(obj_alloc); OBD_ALLOC(lsm_new, newsize); diff --git a/lustre/lov/lproc_lov.c b/lustre/lov/lproc_lov.c index d65c682..2a322e6 100644 --- a/lustre/lov/lproc_lov.c +++ b/lustre/lov/lproc_lov.c @@ -147,7 +147,7 @@ static int lov_tgt_seq_show(struct seq_file *p, void *v) struct obd_device *dev = p->private; struct lov_obd *lov = &dev->u.lov; int idx = tgt - &(lov->tgts[0]); - return seq_printf(p, "%d: %s %sACTIVE\n", idx+1, tgt->uuid.uuid, + return seq_printf(p, "%d: %s %sACTIVE\n", idx, tgt->uuid.uuid, tgt->active ? "" : "IN"); } diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index a71ee06..7a12362 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -54,7 +54,7 @@ * mds_mfd_close - for force closing files when a client dies */ -/* +/* * MDS file data handling: file data holds a handle for a file opened * by a client. */ @@ -132,7 +132,7 @@ static void mds_free_filterdata(struct inode *inode) iput(inode); } -/* Write access to a file: executors cause a negative count, +/* Write access to a file: executors cause a negative count, * writers a positive count. The semaphore is needed to perform * a check for the sign and then increment or decrement atomically. * @@ -243,7 +243,7 @@ static struct mds_file_data *mds_dentry_open(struct dentry *dentry, struct mds_body *body; int error; ENTRY; - + mfd = mds_mfd_new(); if (mfd == NULL) { CERROR("mds: out of memory\n"); @@ -1012,7 +1012,7 @@ int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd, if (last_orphan && unlink_orphan) { LASSERT(rc == 0); /* mds_put_write_access must have succeeded */ - CWARN("destroying orphan object %s\n", fidname); + CDEBUG(D_HA, "destroying orphan object %s\n", fidname); /* Sadly, there is no easy way to save pending_child from * mds_reint_unlink() into mfd, so we need to re-lookup, diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 20aa83d..dcacdcf 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -990,7 +990,7 @@ int mds_get_parent_child_locked(struct obd_device *obd, struct mds_obd *mds, cleanup_phase = 1; /* parent dentry */ - /* Step 2: Lookup child (without lock, to get resource name) */ + /* Step 2: Lookup child (without DLM lock, to get resource name) */ *dchildp = ll_lookup_one_len(name, *dparentp, namelen - 1); if (IS_ERR(*dchildp)) { rc = PTR_ERR(*dchildp); @@ -1746,8 +1746,8 @@ typedef int (*mds_reinter)(struct mds_update_record *, int offset, static mds_reinter reinters[REINT_MAX + 1] = { [REINT_SETATTR] mds_reint_setattr, [REINT_CREATE] mds_reint_create, - [REINT_UNLINK] mds_reint_unlink, [REINT_LINK] mds_reint_link, + [REINT_UNLINK] mds_reint_unlink, [REINT_RENAME] mds_reint_rename, [REINT_OPEN] mds_open }; diff --git a/lustre/mds/mds_unlink_open.c b/lustre/mds/mds_unlink_open.c index 84a4090..56e6dcc 100644 --- a/lustre/mds/mds_unlink_open.c +++ b/lustre/mds/mds_unlink_open.c @@ -68,9 +68,8 @@ int mds_open_unlink_rename(struct mds_update_record *rec, fidlen = ll_fid2str(fidname, dchild->d_inode->i_ino, dchild->d_inode->i_generation); - CWARN("pending destroy of %dx open file %s = %s\n", - mds_open_orphan_count(dchild->d_inode), - rec->ur_name, fidname); + CDEBUG(D_HA, "pending destroy of %dx open file %s = %s\n", + mds_open_orphan_count(dchild->d_inode), rec->ur_name, fidname); pending_child = lookup_one_len(fidname, mds->mds_pending_dir, fidlen); if (IS_ERR(pending_child)) @@ -101,7 +100,7 @@ out_lock: RETURN(rc); } -static int mds_osc_destroy_orphan(struct mds_obd *mds, +static int mds_osc_destroy_orphan(struct mds_obd *mds, struct ptlrpc_request *request) { struct mds_body *body; @@ -117,7 +116,7 @@ static int mds_osc_destroy_orphan(struct mds_obd *mds, RETURN(0); if (body->eadatasize == 0) { CERROR("OBD_MD_FLEASIZE set but eadatasize zero\n"); - RETURN(rc = -EPROTO); + RETURN(rc = -EPROTO); } lmm = lustre_msg_buf(request->rq_repmsg, 1, body->eadatasize); @@ -141,7 +140,7 @@ static int mds_osc_destroy_orphan(struct mds_obd *mds, if (body->valid & OBD_MD_FLCOOKIE) { oa->o_valid |= OBD_MD_FLCOOKIE; - oti.oti_logcookies = + oti.oti_logcookies = lustre_msg_buf(request->rq_repmsg, 2, sizeof(struct llog_cookie) * lsm->lsm_stripe_count); @@ -152,7 +151,7 @@ static int mds_osc_destroy_orphan(struct mds_obd *mds, rc = obd_destroy(mds->mds_osc_exp, oa, lsm, &oti); obdo_free(oa); - if (rc) + if (rc) CERROR("destroy orphan objid 0x"LPX64" on ost error " "%d\n", lsm->lsm_object_id, rc); out_free_memmd: @@ -203,7 +202,7 @@ static int mds_unlink_orphan(struct obd_device *obd, struct dentry *dchild, } else { rc = vfs_unlink(pending_dir, dchild); } - if (rc) + if (rc) CERROR("error %d unlinking orphan %*s from PENDING directory\n", rc, dchild->d_name.len, dchild->d_name.name); @@ -275,7 +274,7 @@ int mds_cleanup_orphans(struct obd_device *obd) CDEBUG(D_INODE, "entry "LPU64" of PENDING DIR: %s\n", i, d_name); - + if (((namlen == 1) && !strcmp(d_name, ".")) || ((namlen == 2) && !strcmp(d_name, ".."))) { continue; diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 8fd0175..3547ea7 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -662,7 +662,7 @@ int lprocfs_write_helper(const char *buffer, unsigned long count, int *val) { char kernbuf[20], *end; - + if (count > (sizeof(kernbuf) - 1)) return -EINVAL; diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 5bf82b3..fcaa7a7 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -30,7 +30,7 @@ #include #include #include -#else +#else #include #include #include @@ -49,45 +49,45 @@ int class_attach(struct lustre_cfg *lcfg) struct obd_type *type; int err = 0; int len; - char *typename; - char *name; - char *uuid; - struct obd_device *obd; - int dev; - - if (!lcfg->lcfg_inllen1 || !lcfg->lcfg_inlbuf1) { - CERROR("No type passed!\n"); - RETURN(-EINVAL); - } - if (lcfg->lcfg_inlbuf1[lcfg->lcfg_inllen1 - 1] != 0) { - CERROR("Type not nul terminated!\n"); - RETURN(-EINVAL); - } - typename = lcfg->lcfg_inlbuf1; - - if (!lcfg->lcfg_dev_namelen || !lcfg->lcfg_dev_name) { - CERROR("No name passed!\n"); - RETURN(-EINVAL); - } - if (lcfg->lcfg_dev_name[lcfg->lcfg_dev_namelen - 1] != 0) { - CERROR("Name not nul terminated!\n"); - RETURN(-EINVAL); - } - name = lcfg->lcfg_dev_name; - - if (!lcfg->lcfg_inllen2 || !lcfg->lcfg_inlbuf2) { - CERROR("No UUID passed!\n"); - RETURN(-EINVAL); - } - if (lcfg->lcfg_inlbuf2[lcfg->lcfg_inllen2 - 1] != 0) { - CERROR("UUID not nul terminated!\n"); - RETURN(-EINVAL); - } - uuid = lcfg->lcfg_inlbuf2; - - CDEBUG(D_IOCTL, "attach type %s name: %s uuid: %s\n", - MKSTR(lcfg->lcfg_inlbuf1), - MKSTR(lcfg->lcfg_dev_name), MKSTR(lcfg->lcfg_inlbuf2)); + char *typename; + char *name; + char *uuid; + struct obd_device *obd; + int dev; + + if (!lcfg->lcfg_inllen1 || !lcfg->lcfg_inlbuf1) { + CERROR("No type passed!\n"); + RETURN(-EINVAL); + } + if (lcfg->lcfg_inlbuf1[lcfg->lcfg_inllen1 - 1] != 0) { + CERROR("Type not nul terminated!\n"); + RETURN(-EINVAL); + } + typename = lcfg->lcfg_inlbuf1; + + if (!lcfg->lcfg_dev_namelen || !lcfg->lcfg_dev_name) { + CERROR("No name passed!\n"); + RETURN(-EINVAL); + } + if (lcfg->lcfg_dev_name[lcfg->lcfg_dev_namelen - 1] != 0) { + CERROR("Name not nul terminated!\n"); + RETURN(-EINVAL); + } + name = lcfg->lcfg_dev_name; + + if (!lcfg->lcfg_inllen2 || !lcfg->lcfg_inlbuf2) { + CERROR("No UUID passed!\n"); + RETURN(-EINVAL); + } + if (lcfg->lcfg_inlbuf2[lcfg->lcfg_inllen2 - 1] != 0) { + CERROR("UUID not nul terminated!\n"); + RETURN(-EINVAL); + } + uuid = lcfg->lcfg_inlbuf2; + + CDEBUG(D_IOCTL, "attach type %s name: %s uuid: %s\n", + MKSTR(lcfg->lcfg_inlbuf1), + MKSTR(lcfg->lcfg_dev_name), MKSTR(lcfg->lcfg_inlbuf2)); /* find the type */ type = class_get_type(typename); @@ -95,23 +95,23 @@ int class_attach(struct lustre_cfg *lcfg) CERROR("OBD: unknown type: %s\n", typename); RETURN(-EINVAL); } - + obd = class_name2obd(name); if (obd != NULL) { CERROR("obd %s already attached\n", name); RETURN(-EEXIST); } - obd = class_newdev(&dev); - if (obd == NULL) - RETURN(-EINVAL); + obd = class_newdev(&dev); + if (obd == NULL) + RETURN(-EINVAL); - /* have we attached a type to this device */ - if (obd->obd_attached || obd->obd_type) { - CERROR("OBD: Device %d already typed as %s.\n", - obd->obd_minor, MKSTR(obd->obd_type->typ_name)); - RETURN(-EBUSY); - } + /* have we attached a type to this device */ + if (obd->obd_attached || obd->obd_type) { + CERROR("OBD: Device %d already typed as %s.\n", + obd->obd_minor, MKSTR(obd->obd_type->typ_name)); + RETURN(-EBUSY); + } LASSERT(obd == (obd_dev + obd->obd_minor)); @@ -123,16 +123,16 @@ int class_attach(struct lustre_cfg *lcfg) obd->obd_num_exports = 0; spin_lock_init(&obd->obd_dev_lock); init_waitqueue_head(&obd->obd_refcount_waitq); - + /* XXX belongs in setup not attach */ /* recovery data */ spin_lock_init(&obd->obd_processing_task_lock); init_waitqueue_head(&obd->obd_next_transno_waitq); INIT_LIST_HEAD(&obd->obd_recovery_queue); INIT_LIST_HEAD(&obd->obd_delayed_reply_queue); - + init_waitqueue_head(&obd->obd_commit_waitq); - + len = strlen(name) + 1; OBD_ALLOC(obd->obd_name, len); if (!obd->obd_name) { @@ -141,7 +141,7 @@ int class_attach(struct lustre_cfg *lcfg) RETURN(-ENOMEM); } memcpy(obd->obd_name, name, len); - + len = strlen(uuid); if (len >= sizeof(obd->obd_uuid)) { CERROR("uuid must be < "LPSZ" bytes long\n", @@ -192,19 +192,19 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg) } atomic_set(&obd->obd_refcount, 0); - + exp = class_new_export(obd); - if (exp == NULL) + if (exp == NULL) RETURN(err); - memcpy(&exp->exp_client_uuid, &obd->obd_uuid, + memcpy(&exp->exp_client_uuid, &obd->obd_uuid, sizeof(exp->exp_client_uuid)); obd->obd_self_export = exp; class_export_put(exp); err = obd_setup(obd, sizeof(*lcfg), lcfg); - if (err) + if (err) GOTO(err_exp, err); - + obd->obd_type->typ_refcnt++; obd->obd_set_up = 1; @@ -236,8 +236,9 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg) if (obd->obd_name) { OBD_FREE(obd->obd_name, strlen(obd->obd_name)+1); obd->obd_name = NULL; - } else + } else { CERROR("device %d: no name at detach\n", obd->obd_minor); + } obd->obd_attached = 0; obd->obd_type->typ_refcnt--; @@ -264,9 +265,9 @@ static void dump_exports(struct obd_device *obd) int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg) { int flags = 0; - int err = 0; + int err = 0; char *flag; - + ENTRY; if (!obd->obd_set_up) { CERROR("Device %d not setup\n", obd->obd_minor); @@ -330,7 +331,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg) if (obd->obd_self_export) { err = obd_precleanup(obd, flags); - if (err) + if (err) GOTO(out, err); class_unlink_export(obd->obd_self_export); obd->obd_self_export = NULL; @@ -342,11 +343,11 @@ out: 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) + if (atomic_read(&obd->obd_refcount) > 0) CERROR("%s still has refcount %d after " "cleanup.\n", obd->obd_name, atomic_read(&obd->obd_refcount)); - } + } RETURN(err); @@ -357,7 +358,7 @@ LIST_HEAD(lustre_profile_list); struct lustre_profile *class_get_profile(char * prof) { struct lustre_profile *lprof; - + list_for_each_entry(lprof, &lustre_profile_list, lp_list) { if (!strcmp(lprof->lp_profile, prof)) { RETURN(lprof); @@ -366,8 +367,7 @@ struct lustre_profile *class_get_profile(char * prof) RETURN(NULL); } -int class_add_profile(int proflen, char *prof, - int osclen, char *osc, +int class_add_profile(int proflen, char *prof, int osclen, char *osc, int mdclen, char *mdc) { struct lustre_profile *lprof; @@ -383,7 +383,7 @@ int class_add_profile(int proflen, char *prof, if (lprof->lp_profile == NULL) GOTO(out, err = -ENOMEM); memcpy(lprof->lp_profile, prof, proflen); - + LASSERT(osclen == (strlen(osc) + 1)); OBD_ALLOC(lprof->lp_osc, osclen); if (lprof->lp_profile == NULL) @@ -407,7 +407,7 @@ out: void class_del_profile(char *prof) { struct lustre_profile *lprof; - + lprof = class_get_profile(prof); if (lprof) { list_del(&lprof->lp_list); @@ -421,7 +421,7 @@ void class_del_profile(char *prof) int class_process_config(struct lustre_cfg *lcfg) { - struct obd_device *obd; + struct obd_device *obd; char str[PTL_NALFMT_SIZE]; int err; @@ -430,7 +430,7 @@ int class_process_config(struct lustre_cfg *lcfg) CDEBUG(D_IOCTL, "processing cmd: %x\n", lcfg->lcfg_command); /* Commands that don't need a device */ - switch(lcfg->lcfg_command) { + switch(lcfg->lcfg_command) { case LCFG_ATTACH: { err = class_attach(lcfg); GOTO(out, err); @@ -454,12 +454,13 @@ int class_process_config(struct lustre_cfg *lcfg) GOTO(out, err); } case LCFG_MOUNTOPT: { - CDEBUG(D_IOCTL, "mountopt: profile %s osc %s mdc %s\n", - lcfg->lcfg_inlbuf1, lcfg->lcfg_inlbuf2, lcfg->lcfg_inlbuf3); + CDEBUG(D_IOCTL, "mountopt: profile %s osc %s mdc %s\n", + lcfg->lcfg_inlbuf1, lcfg->lcfg_inlbuf2, + lcfg->lcfg_inlbuf3); /* set these mount options somewhere, so ll_fill_super * can find them. */ - err = class_add_profile(lcfg->lcfg_inllen1, lcfg->lcfg_inlbuf1, - lcfg->lcfg_inllen2, lcfg->lcfg_inlbuf2, + err = class_add_profile(lcfg->lcfg_inllen1, lcfg->lcfg_inlbuf1, + lcfg->lcfg_inllen2, lcfg->lcfg_inlbuf2, lcfg->lcfg_inllen3, lcfg->lcfg_inlbuf3); GOTO(out, err); } @@ -471,35 +472,34 @@ int class_process_config(struct lustre_cfg *lcfg) GOTO(out, err = 0); } case LCFG_SET_TIMEOUT: { - CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n", + CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n", obd_timeout, lcfg->lcfg_num); obd_timeout = lcfg->lcfg_num; GOTO(out, err = 0); } case LCFG_SET_UPCALL: { - CDEBUG(D_IOCTL, "setting lustre ucpall to: %s\n", + CDEBUG(D_IOCTL, "setting lustre ucpall to: %s\n", lcfg->lcfg_inlbuf1); if (lcfg->lcfg_inllen1 > sizeof obd_lustre_upcall) GOTO(out, err = -EINVAL); - memcpy(obd_lustre_upcall, lcfg->lcfg_inlbuf1, + memcpy(obd_lustre_upcall, lcfg->lcfg_inlbuf1, lcfg->lcfg_inllen1); GOTO(out, err = 0); } - } - + } - /* Commands that require a device */ + /* Commands that require a device */ obd = class_name2obd(lcfg->lcfg_dev_name); if (obd == NULL) { - if (lcfg->lcfg_dev_name == NULL) { + if (lcfg->lcfg_dev_name == NULL) CERROR("this lcfg command requires a device name\n"); - } else { + else CERROR("no device for: %s\n", lcfg->lcfg_dev_name); - } + GOTO(out, err = -EINVAL); - } - + } + switch(lcfg->lcfg_command) { case LCFG_SETUP: { err = class_setup(obd, lcfg); @@ -513,16 +513,16 @@ int class_process_config(struct lustre_cfg *lcfg) err = class_cleanup(obd, lcfg); GOTO(out, err = 0); } - default: { + default: { CERROR("Unknown command: %d\n", lcfg->lcfg_command); GOTO(out, err = -EINVAL); } - } + } out: RETURN(err); } - + static int class_config_llog_handler(struct llog_handle * handle, struct llog_rec_hdr *rec, void *data) { @@ -542,24 +542,24 @@ static int class_config_llog_handler(struct llog_handle * handle, int inst_len = 0; rc = lustre_cfg_getdata(&buf, cfg_len, cfg_buf, 1); - if (rc) + if (rc) GOTO(out, rc); lcfg = (struct lustre_cfg* ) buf; if (cfg && cfg->cfg_instance && lcfg->lcfg_dev_name) { - inst_len = strlen(lcfg->lcfg_dev_name) + + inst_len = strlen(lcfg->lcfg_dev_name) + strlen(cfg->cfg_instance) + 2; OBD_ALLOC(inst_name, inst_len); - if (inst_name == NULL) + if (inst_name == NULL) GOTO(out, rc = -ENOMEM); - sprintf(inst_name, "%s-%s", lcfg->lcfg_dev_name, + sprintf(inst_name, "%s-%s", lcfg->lcfg_dev_name, cfg->cfg_instance); old_name = lcfg->lcfg_dev_name; old_len = lcfg->lcfg_dev_namelen; lcfg->lcfg_dev_name = inst_name; lcfg->lcfg_dev_namelen = strlen(inst_name) + 1; } - + if (cfg && lcfg->lcfg_command == LCFG_ATTACH) { old_uuid = lcfg->lcfg_inlbuf2; old_uuid_len = lcfg->lcfg_inllen2; @@ -575,12 +575,12 @@ static int class_config_llog_handler(struct llog_handle * handle, lcfg->lcfg_dev_namelen = old_len; OBD_FREE(inst_name, inst_len); } - + if (old_uuid) { lcfg->lcfg_inlbuf2 = old_uuid; lcfg->lcfg_inllen2 = old_uuid_len; } - + lustre_cfg_freedata(buf, cfg_len); } else if (rec->lrh_type == PTL_CFG_REC) { struct portals_cfg *pcfg = (struct portals_cfg *)cfg_buf; @@ -595,19 +595,19 @@ out: RETURN(rc); } -int class_config_parse_llog(struct llog_ctxt *ctxt, char *name, - struct config_llog_instance *cfg) +int class_config_parse_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); - if (rc) + if (rc) RETURN(rc); rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL); - if (rc) + if (rc) GOTO(parse_out, rc); rc = llog_process(llh, class_config_llog_handler, cfg, NULL); @@ -632,10 +632,10 @@ static int class_config_dump_handler(struct llog_handle * handle, struct lustre_cfg *lcfg; rc = lustre_cfg_getdata(&buf, cfg_len, cfg_buf, 1); - if (rc) + if (rc) GOTO(out, rc); lcfg = (struct lustre_cfg* ) buf; - + CDEBUG(D_INFO, "lcfg command: %x\n", lcfg->lcfg_command); if (lcfg->lcfg_dev_name) CDEBUG(D_INFO, " devname: %s\n", @@ -692,19 +692,19 @@ out: RETURN(rc); } -int class_config_dump_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) { struct llog_handle *llh; int rc, rc2; ENTRY; rc = llog_create(ctxt, &llh, NULL, name); - if (rc) + if (rc) RETURN(rc); rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL); - if (rc) + if (rc) GOTO(parse_out, rc); rc = llog_process(llh, class_config_dump_handler, cfg, NULL); @@ -716,4 +716,3 @@ parse_out: RETURN(rc); } - diff --git a/lustre/obdclass/sysctl.c b/lustre/obdclass/sysctl.c index 610fbc7..f474985 100644 --- a/lustre/obdclass/sysctl.c +++ b/lustre/obdclass/sysctl.c @@ -45,38 +45,23 @@ struct ctl_table_header *obd_table_header = NULL; -static int vars[2]; -static int index = 0; - -static int obd_sctl_vars( ctl_table * table, int write, struct file * - filp, void * buffer, size_t * lenp ); -static int obd_sctl_reset( ctl_table * table, int write, struct file - * filp, void * buffer, size_t * lenp ); - #define OBD_SYSCTL 300 -#define OBD_FAIL_LOC 1 /* control test failures instrumentation */ -#define OBD_ENTRY 2 /* control enter/leave pattern */ -#define OBD_VARS 3 -#define OBD_INDEX 4 -#define OBD_RESET 5 -#define OBD_TIMEOUT 6 /* RPC timeout before recovery/intr */ -/* XXX move to /proc/sys/lustre/recovery? */ -#define OBD_UPCALL 7 /* path to recovery upcall */ -/* XXX temporary, as we play with sync osts.. */ -#define OBD_SYNCFILTER 8 - -#define OBD_VARS_SLOT 2 +enum { + OBD_FAIL_LOC = 1, /* control test failures instrumentation */ + OBD_TIMEOUT, /* RPC timeout before recovery/intr */ + OBD_UPCALL, /* path to recovery upcall */ + OBD_SYNCFILTER, /* XXX temporary, as we play with sync osts.. */ +}; static ctl_table obd_table[] = { - {OBD_FAIL_LOC, "fail_loc", &obd_fail_loc, sizeof(int), 0644, NULL, &proc_dointvec}, - {OBD_VARS, "vars", &vars[0], sizeof(int), 0644, NULL, &proc_dointvec}, - {OBD_INDEX, "index", &index, sizeof(int), 0644, NULL, &obd_sctl_vars}, - {OBD_RESET, "reset", NULL, 0, 0644, NULL, &obd_sctl_reset}, - {OBD_TIMEOUT, "timeout", &obd_timeout, sizeof(int), 0644, NULL, &proc_dointvec}, - /* XXX need to lock so we avoid update races with the recovery upcall! */ + {OBD_FAIL_LOC, "fail_loc", &obd_fail_loc, sizeof(int), 0644, NULL, + &proc_dointvec}, + {OBD_TIMEOUT, "timeout", &obd_timeout, sizeof(int), 0644, NULL, + &proc_dointvec}, + /* XXX need to lock so we avoid update races with recovery upcall! */ {OBD_UPCALL, "upcall", obd_lustre_upcall, 128, 0644, NULL, - &proc_dostring, &sysctl_string }, + &proc_dostring, &sysctl_string }, {OBD_SYNCFILTER, "filter_sync_on_commit", &obd_sync_filter, sizeof(int), 0644, NULL, &proc_dointvec}, { 0 } @@ -91,7 +76,7 @@ void obd_sysctl_init (void) { #ifdef CONFIG_SYSCTL if ( !obd_table_header ) - obd_table_header = register_sysctl_table(parent_table, 0); + obd_table_header = register_sysctl_table(parent_table, 0); #endif } @@ -103,38 +88,3 @@ void obd_sysctl_clean (void) obd_table_header = NULL; #endif } - -int obd_sctl_reset (ctl_table * table, int write, - struct file * filp, void * buffer, - size_t * lenp) -{ - if ( write ) { - /* do something here */ - vars[0]=0; - vars[1]=0; - } - - *lenp = 0; - return 0; -} - -int obd_sctl_vars (ctl_table * table, int write, - struct file * filp, void * buffer, - size_t * lenp) -{ - int rc; - - rc = proc_dointvec(table, write, filp, buffer, lenp); - - if ( rc ) - return rc; - - if ( index < 0 || index > 1 ) { - CERROR("Illegal index %d!\n", index); - index = 0; - } else { - obd_table[OBD_VARS_SLOT].data = &vars[index]; - } - - return rc; -} diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 54de594..9ca56d8 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2281,12 +2281,12 @@ static void osc_set_data_with_check(struct lustre_handle *lockh, void *data) if (lock->l_ast_data && lock->l_ast_data != data) { struct inode *new_inode = data; struct inode *old_inode = lock->l_ast_data; - unsigned long state = old_inode->i_state & I_FREEING; - CERROR("Found existing inode %p/%lu/%u state %lu in lock: " - "setting data to %p/%lu/%u\n", old_inode, - old_inode->i_ino, old_inode->i_generation, state, - new_inode, new_inode->i_ino, new_inode->i_generation); - LASSERT(state); + LASSERTF(old_inode->i_state & I_FREEING, + "Found existing inode %p/%lu/%u state %lu in lock: " + "setting data to %p/%lu/%u\n", old_inode, + old_inode->i_ino, old_inode->i_generation, + old_inode->i_state, + new_inode, new_inode->i_ino, new_inode->i_generation); } #endif lock->l_ast_data = data; diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index 12d9f56..0c4c4a0 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -97,10 +97,9 @@ extern unsigned int portal_cerror; #define CHECK_STACK(stack) \ do { \ if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) { \ - portals_debug_msg(DEBUG_SUBSYSTEM, D_ERROR, \ + portals_debug_msg(DEBUG_SUBSYSTEM, D_WARNING, \ __FILE__, __FUNCTION__, __LINE__, \ - (stack), \ - "maximum lustre stack %u\n", \ + (stack),"maximum lustre stack %u\n",\ portal_stack = (stack)); \ /*panic("LBUG");*/ \ } \ @@ -185,7 +184,7 @@ do { \ PREPARE_TQUEUE((wq), (cb), (cbdata)); \ } while (0) -#define ll_invalidate_inode_pages invalidate_inode_pages +#define ll_invalidate_inode_pages(inode) invalidate_inode_pages(inode) #define PageUptodate Page_Uptodate #define our_recalc_sigpending(current) recalc_sigpending(current) #define num_online_cpus() smp_num_cpus diff --git a/lustre/portals/knals/socknal/socknal.c b/lustre/portals/knals/socknal/socknal.c index 0775fcc..9ae1c87 100644 --- a/lustre/portals/knals/socknal/socknal.c +++ b/lustre/portals/knals/socknal/socknal.c @@ -56,7 +56,7 @@ static ctl_table ksocknal_ctl_table[] = { &ksocknal_data.ksnd_eager_ack, sizeof (int), 0644, NULL, &proc_dointvec}, #if SOCKNAL_ZC - {SOCKNAL_SYSCTL_EAGER_ACK, "zero_copy", + {SOCKNAL_SYSCTL_ZERO_COPY, "zero_copy", &ksocknal_data.ksnd_zc_min_frag, sizeof (int), 0644, NULL, &proc_dointvec}, #endif diff --git a/lustre/portals/utils/wirecheck.c b/lustre/portals/utils/wirecheck.c index 77ad126..a73a5217 100644 --- a/lustre/portals/utils/wirecheck.c +++ b/lustre/portals/utils/wirecheck.c @@ -10,80 +10,80 @@ extern size_t strnlen(const char *, size_t); -#define BLANK_LINE() \ -do { \ - printf ("\n"); \ +#define BLANK_LINE() \ +do { \ + printf ("\n"); \ } while (0) -#define COMMENT(c) \ -do { \ - printf (" /* "c" */\n"); \ +#define COMMENT(c) \ +do { \ + printf (" /* "c" */\n"); \ } while (0) #define STRINGIFY(a) #a -#define CHECK_DEFINE(a) \ -do { \ - printf (" LASSERT ("#a" == "STRINGIFY(a)");\n"); \ +#define CHECK_DEFINE(a) \ +do { \ + printf (" LASSERT ("#a" == "STRINGIFY(a)");\n"); \ } while (0) -#define CHECK_VALUE(a) \ -do { \ - printf (" LASSERT ("#a" == %d);\n", a); \ +#define CHECK_VALUE(a) \ +do { \ + printf (" LASSERT ("#a" == %d);\n", a); \ } while (0) -#define CHECK_MEMBER_OFFSET(s,m) \ -do { \ - CHECK_VALUE(offsetof(s, m)); \ +#define CHECK_MEMBER_OFFSET(s,m) \ +do { \ + CHECK_VALUE(offsetof(s, m)); \ } while (0) -#define CHECK_MEMBER_SIZEOF(s,m) \ -do { \ - CHECK_VALUE((int)sizeof(((s *)0)->m)); \ +#define CHECK_MEMBER_SIZEOF(s,m) \ +do { \ + CHECK_VALUE((int)sizeof(((s *)0)->m)); \ } while (0) -#define CHECK_MEMBER(s,m) \ -do { \ - CHECK_MEMBER_OFFSET(s, m); \ - CHECK_MEMBER_SIZEOF(s, m); \ +#define CHECK_MEMBER(s,m) \ +do { \ + CHECK_MEMBER_OFFSET(s, m); \ + CHECK_MEMBER_SIZEOF(s, m); \ } while (0) #define CHECK_STRUCT(s) \ do { \ BLANK_LINE (); \ COMMENT ("Checks for struct "#s); \ - CHECK_VALUE((int)sizeof(s)); \ + CHECK_VALUE((int)sizeof(s)); \ } while (0) void check_ptl_handle_wire (void) { - CHECK_STRUCT (ptl_handle_wire_t); - CHECK_MEMBER (ptl_handle_wire_t, wh_interface_cookie); - CHECK_MEMBER (ptl_handle_wire_t, wh_object_cookie); + CHECK_STRUCT (ptl_handle_wire_t); + CHECK_MEMBER (ptl_handle_wire_t, wh_interface_cookie); + CHECK_MEMBER (ptl_handle_wire_t, wh_object_cookie); } void check_ptl_magicversion (void) { - CHECK_STRUCT (ptl_magicversion_t); - CHECK_MEMBER (ptl_magicversion_t, magic); - CHECK_MEMBER (ptl_magicversion_t, version_major); - CHECK_MEMBER (ptl_magicversion_t, version_minor); + CHECK_STRUCT (ptl_magicversion_t); + CHECK_MEMBER (ptl_magicversion_t, magic); + CHECK_MEMBER (ptl_magicversion_t, version_major); + CHECK_MEMBER (ptl_magicversion_t, version_minor); } void check_ptl_hdr (void) { - CHECK_STRUCT (ptl_hdr_t); - CHECK_MEMBER (ptl_hdr_t, dest_nid); - CHECK_MEMBER (ptl_hdr_t, src_nid); - CHECK_MEMBER (ptl_hdr_t, dest_pid); - CHECK_MEMBER (ptl_hdr_t, src_pid); - CHECK_MEMBER (ptl_hdr_t, type); - CHECK_MEMBER (ptl_hdr_t, payload_length); + CHECK_STRUCT (ptl_hdr_t); + CHECK_MEMBER (ptl_hdr_t, dest_nid); + CHECK_MEMBER (ptl_hdr_t, src_nid); + CHECK_MEMBER (ptl_hdr_t, dest_pid); + CHECK_MEMBER (ptl_hdr_t, src_pid); + CHECK_MEMBER (ptl_hdr_t, type); + CHECK_MEMBER (ptl_hdr_t, payload_length); CHECK_MEMBER (ptl_hdr_t, msg); - + BLANK_LINE (); COMMENT ("Ack"); CHECK_MEMBER (ptl_hdr_t, msg.ack.dst_wmd); @@ -92,28 +92,28 @@ check_ptl_hdr (void) BLANK_LINE (); COMMENT ("Put"); - CHECK_MEMBER (ptl_hdr_t, msg.put.ack_wmd); - CHECK_MEMBER (ptl_hdr_t, msg.put.match_bits); - CHECK_MEMBER (ptl_hdr_t, msg.put.hdr_data); - CHECK_MEMBER (ptl_hdr_t, msg.put.ptl_index); - CHECK_MEMBER (ptl_hdr_t, msg.put.offset); + CHECK_MEMBER (ptl_hdr_t, msg.put.ack_wmd); + CHECK_MEMBER (ptl_hdr_t, msg.put.match_bits); + CHECK_MEMBER (ptl_hdr_t, msg.put.hdr_data); + CHECK_MEMBER (ptl_hdr_t, msg.put.ptl_index); + CHECK_MEMBER (ptl_hdr_t, msg.put.offset); BLANK_LINE (); COMMENT ("Get"); - CHECK_MEMBER (ptl_hdr_t, msg.get.return_wmd); - CHECK_MEMBER (ptl_hdr_t, msg.get.match_bits); - CHECK_MEMBER (ptl_hdr_t, msg.get.ptl_index); - CHECK_MEMBER (ptl_hdr_t, msg.get.src_offset); - CHECK_MEMBER (ptl_hdr_t, msg.get.sink_length); + CHECK_MEMBER (ptl_hdr_t, msg.get.return_wmd); + CHECK_MEMBER (ptl_hdr_t, msg.get.match_bits); + CHECK_MEMBER (ptl_hdr_t, msg.get.ptl_index); + CHECK_MEMBER (ptl_hdr_t, msg.get.src_offset); + CHECK_MEMBER (ptl_hdr_t, msg.get.sink_length); BLANK_LINE (); COMMENT ("Reply"); - CHECK_MEMBER (ptl_hdr_t, msg.reply.dst_wmd); + CHECK_MEMBER (ptl_hdr_t, msg.reply.dst_wmd); BLANK_LINE (); COMMENT ("Hello"); - CHECK_MEMBER (ptl_hdr_t, msg.hello.incarnation); - CHECK_MEMBER (ptl_hdr_t, msg.hello.type); + CHECK_MEMBER (ptl_hdr_t, msg.hello.incarnation); + CHECK_MEMBER (ptl_hdr_t, msg.hello.type); } void @@ -122,11 +122,11 @@ system_string (char *cmdline, char *str, int len) int fds[2]; int rc; pid_t pid; - + rc = pipe (fds); if (rc != 0) abort (); - + pid = fork (); if (pid == 0) { /* child */ @@ -145,25 +145,25 @@ system_string (char *cmdline, char *str, int len) if (f == NULL) abort(); - + close(fds[1]); - + if (fgets(str, len, f) == NULL) abort(); - + if (waitpid(pid, &rc, 0) != pid) abort(); - + if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0) abort(); if (strnlen(str, len) == len) str[len - 1] = 0; - + if (str[strlen(str) - 1] == '\n') str[strlen(str) - 1] = 0; - + fclose(f); } } @@ -173,35 +173,35 @@ main (int argc, char **argv) { char unameinfo[80]; char gccinfo[80]; - + system_string("uname -a", unameinfo, sizeof(unameinfo)); system_string("gcc -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo)); - - printf ("void lib_assert_wire_constants (void)\n" - "{\n" + + printf ("void lib_assert_wire_constants (void)\n" + "{\n" " /* Wire protocol assertions generated by 'wirecheck'\n" " * running on %s\n" " * with %s */\n" "\n", unameinfo, gccinfo); - - BLANK_LINE (); - - COMMENT ("Constants..."); - CHECK_DEFINE (PORTALS_PROTO_MAGIC); - CHECK_DEFINE (PORTALS_PROTO_VERSION_MAJOR); - CHECK_DEFINE (PORTALS_PROTO_VERSION_MINOR); - - CHECK_VALUE (PTL_MSG_ACK); - CHECK_VALUE (PTL_MSG_PUT); - CHECK_VALUE (PTL_MSG_GET); - CHECK_VALUE (PTL_MSG_REPLY); - CHECK_VALUE (PTL_MSG_HELLO); - - check_ptl_handle_wire (); - check_ptl_magicversion (); - check_ptl_hdr (); - - printf ("}\n\n"); - - return (0); + + BLANK_LINE (); + + COMMENT ("Constants..."); + CHECK_DEFINE (PORTALS_PROTO_MAGIC); + CHECK_DEFINE (PORTALS_PROTO_VERSION_MAJOR); + CHECK_DEFINE (PORTALS_PROTO_VERSION_MINOR); + + CHECK_VALUE (PTL_MSG_ACK); + CHECK_VALUE (PTL_MSG_PUT); + CHECK_VALUE (PTL_MSG_GET); + CHECK_VALUE (PTL_MSG_REPLY); + CHECK_VALUE (PTL_MSG_HELLO); + + check_ptl_handle_wire (); + check_ptl_magicversion (); + check_ptl_hdr (); + + printf ("}\n\n"); + + return (0); } diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 7a5c3a2..e0e725a 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -611,537 +611,787 @@ void lustre_swab_llogd_conn_body (struct llogd_conn_body *d) __swab32s (&d->lgdc_ctxt_idx); } -void lustre_assert_wire_constants (void) +#ifdef BUG_1343 +void lustre_assert_wire_constants(void) { -#if BUG_1343 - /* Wire protocol assertions generated by 'wirecheck' */ + /* 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 + * with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) */ + /* Constants... */ - LASSERT (PTLRPC_MSG_MAGIC == 0x0BD00BD0); - LASSERT (PTLRPC_MSG_VERSION == 0x00040002); - LASSERT (PTL_RPC_MSG_REQUEST == 4711); - LASSERT (PTL_RPC_MSG_ERR == 4712); - LASSERT (PTL_RPC_MSG_REPLY == 4713); - LASSERT (MSG_LAST_REPLAY == 1); - LASSERT (MSG_RESENT == 2); - LASSERT (MSG_CONNECT_RECOVERING == 1); - LASSERT (MSG_CONNECT_RECONNECT == 2); - LASSERT (MSG_CONNECT_REPLAYABLE == 4); - LASSERT (OST_REPLY == 0); - LASSERT (OST_GETATTR == 1); - LASSERT (OST_SETATTR == 2); - LASSERT (OST_READ == 3); - LASSERT (OST_WRITE == 4); - LASSERT (OST_CREATE == 5); - LASSERT (OST_DESTROY == 6); - LASSERT (OST_GET_INFO == 7); - LASSERT (OST_CONNECT == 8); - LASSERT (OST_DISCONNECT == 9); - LASSERT (OST_PUNCH == 10); - LASSERT (OST_OPEN == 11); - LASSERT (OST_CLOSE == 12); - LASSERT (OST_STATFS == 13); - LASSERT (OST_SAN_READ == 14); - LASSERT (OST_SAN_WRITE == 15); - LASSERT (OST_SYNC == 16); - LASSERT (OST_LAST_OPC == 17); - LASSERT (OST_FIRST_OPC == 0); - LASSERT (OBD_FL_INLINEDATA == 1); - LASSERT (OBD_FL_OBDMDEXISTS == 2); - LASSERT (LOV_MAGIC == 198183888); - LASSERT (OBD_MD_FLALL == -1); - LASSERT (OBD_MD_FLID == 1); - LASSERT (OBD_MD_FLATIME == 2); - LASSERT (OBD_MD_FLMTIME == 4); - LASSERT (OBD_MD_FLCTIME == 8); - LASSERT (OBD_MD_FLSIZE == 16); - LASSERT (OBD_MD_FLBLOCKS == 32); - LASSERT (OBD_MD_FLBLKSZ == 64); - LASSERT (OBD_MD_FLMODE == 128); - LASSERT (OBD_MD_FLTYPE == 256); - LASSERT (OBD_MD_FLUID == 512); - LASSERT (OBD_MD_FLGID == 1024); - LASSERT (OBD_MD_FLFLAGS == 2048); - LASSERT (OBD_MD_FLOBDFLG == 4096); - LASSERT (OBD_MD_FLNLINK == 8192); - LASSERT (OBD_MD_FLGENER == 16384); - LASSERT (OBD_MD_FLINLINE == 32768); - LASSERT (OBD_MD_FLRDEV == 65536); - LASSERT (OBD_MD_FLEASIZE == 131072); - LASSERT (OBD_MD_LINKNAME == 262144); - LASSERT (OBD_MD_FLHANDLE == 524288); - LASSERT (OBD_MD_FLCKSUM == 1048576); - LASSERT (OBD_BRW_READ == 1); - LASSERT (OBD_BRW_WRITE == 2); - LASSERT (OBD_BRW_CREATE == 4); - LASSERT (OBD_BRW_SYNC == 8); - LASSERT (OBD_OBJECT_EOF == 0xffffffffffffffffULL); - LASSERT (OST_REQ_HAS_OA1 == 1); - LASSERT (MDS_GETATTR == 33); - LASSERT (MDS_GETATTR_NAME == 34); - LASSERT (MDS_CLOSE == 35); - LASSERT (MDS_REINT == 36); - LASSERT (MDS_READPAGE == 37); - LASSERT (MDS_CONNECT == 38); - LASSERT (MDS_DISCONNECT == 39); - LASSERT (MDS_GETSTATUS == 40); - LASSERT (MDS_STATFS == 41); - LASSERT (MDS_GETLOVINFO == 42); - LASSERT (MDS_LAST_OPC == 43); - LASSERT (MDS_FIRST_OPC == 33); - LASSERT (REINT_SETATTR == 1); - LASSERT (REINT_CREATE == 2); - LASSERT (REINT_LINK == 3); - LASSERT (REINT_UNLINK == 4); - LASSERT (REINT_RENAME == 5); - LASSERT (REINT_OPEN == 6); - LASSERT (REINT_MAX == 6); - LASSERT (DISP_IT_EXECD == 1); - LASSERT (DISP_LOOKUP_EXECD == 2); - LASSERT (DISP_LOOKUP_NEG == 4); - LASSERT (DISP_LOOKUP_POS == 8); - LASSERT (DISP_OPEN_CREATE == 16); - LASSERT (DISP_OPEN_OPEN == 32); - LASSERT (MDS_STATUS_CONN == 1); - LASSERT (MDS_STATUS_LOV == 2); - LASSERT (MDS_OPEN_HAS_EA == (1 << 30)); - LASSERT (LOV_RAID0 == 0); - LASSERT (LOV_RAIDRR == 1); - LASSERT (LDLM_ENQUEUE == 101); - LASSERT (LDLM_CONVERT == 102); - LASSERT (LDLM_CANCEL == 103); - LASSERT (LDLM_BL_CALLBACK == 104); - LASSERT (LDLM_CP_CALLBACK == 105); - LASSERT (LDLM_LAST_OPC == 106); - LASSERT (LDLM_FIRST_OPC == 101); - LASSERT (PTLBD_QUERY == 200); - LASSERT (PTLBD_READ == 201); - LASSERT (PTLBD_WRITE == 202); - LASSERT (PTLBD_FLUSH == 203); - LASSERT (PTLBD_CONNECT == 204); - LASSERT (PTLBD_DISCONNECT == 205); - LASSERT (PTLBD_LAST_OPC == 204); - LASSERT (PTLBD_FIRST_OPC == 200); - LASSERT (OBD_PING == 400); + LASSERT(PTLRPC_MSG_MAGIC == 0x0BD00BD0); + LASSERT(PTLRPC_MSG_VERSION == 0x00000003); + LASSERT(PTL_RPC_MSG_REQUEST == 4711); + LASSERT(PTL_RPC_MSG_ERR == 4712); + LASSERT(PTL_RPC_MSG_REPLY == 4713); + LASSERT(MSG_LAST_REPLAY == 1); + LASSERT(MSG_RESENT == 2); + LASSERT(MSG_CONNECT_RECOVERING == 1); + LASSERT(MSG_CONNECT_RECONNECT == 2); + LASSERT(MSG_CONNECT_REPLAYABLE == 4); + LASSERT(OST_REPLY == 0); + LASSERT(OST_GETATTR == 1); + LASSERT(OST_SETATTR == 2); + LASSERT(OST_READ == 3); + LASSERT(OST_WRITE == 4); + LASSERT(OST_CREATE == 5); + LASSERT(OST_DESTROY == 6); + LASSERT(OST_GET_INFO == 7); + LASSERT(OST_CONNECT == 8); + LASSERT(OST_DISCONNECT == 9); + LASSERT(OST_PUNCH == 10); + LASSERT(OST_OPEN == 11); + LASSERT(OST_CLOSE == 12); + LASSERT(OST_STATFS == 13); + LASSERT(OST_SAN_READ == 14); + LASSERT(OST_SAN_WRITE == 15); + LASSERT(OST_SYNC == 16); + LASSERT(OST_LAST_OPC == 18); + LASSERT(OBD_OBJECT_EOF == 0xffffffffffffffffULL); + LASSERT(OST_REQ_HAS_OA1 == 1); + LASSERT(MDS_GETATTR == 33); + LASSERT(MDS_GETATTR_NAME == 34); + LASSERT(MDS_CLOSE == 35); + LASSERT(MDS_REINT == 36); + LASSERT(MDS_READPAGE == 37); + LASSERT(MDS_CONNECT == 38); + LASSERT(MDS_DISCONNECT == 39); + LASSERT(MDS_GETSTATUS == 40); + LASSERT(MDS_STATFS == 41); + LASSERT(MDS_PIN == 42); + LASSERT(MDS_UNPIN == 43); + LASSERT(MDS_SYNC == 44); + LASSERT(MDS_DONE_WRITING == 45); + LASSERT(MDS_LAST_OPC == 46); + LASSERT(REINT_SETATTR == 1); + LASSERT(REINT_CREATE == 2); + LASSERT(REINT_LINK == 3); + LASSERT(REINT_UNLINK == 4); + LASSERT(REINT_RENAME == 5); + LASSERT(REINT_OPEN == 6); + LASSERT(REINT_MAX == 6); + LASSERT(DISP_IT_EXECD == 1); + LASSERT(DISP_LOOKUP_EXECD == 2); + LASSERT(DISP_LOOKUP_NEG == 4); + LASSERT(DISP_LOOKUP_POS == 8); + LASSERT(DISP_OPEN_CREATE == 16); + LASSERT(DISP_OPEN_OPEN == 32); + LASSERT(MDS_STATUS_CONN == 1); + LASSERT(MDS_STATUS_LOV == 2); + LASSERT(MDS_OPEN_HAS_EA == 1073741824); + LASSERT(LDLM_ENQUEUE == 101); + LASSERT(LDLM_CONVERT == 102); + LASSERT(LDLM_CANCEL == 103); + LASSERT(LDLM_BL_CALLBACK == 104); + LASSERT(LDLM_CP_CALLBACK == 105); + LASSERT(LDLM_LAST_OPC == 106); + LASSERT(LCK_EX == 1); + LASSERT(LCK_PW == 2); + LASSERT(LCK_PR == 3); + LASSERT(LCK_CW == 4); + LASSERT(LCK_CR == 5); + LASSERT(LCK_NL == 6); + LASSERT(PTLBD_QUERY == 200); + LASSERT(PTLBD_READ == 201); + LASSERT(PTLBD_WRITE == 202); + LASSERT(PTLBD_FLUSH == 203); + LASSERT(PTLBD_CONNECT == 204); + LASSERT(PTLBD_DISCONNECT == 205); + LASSERT(PTLBD_LAST_OPC == 206); + LASSERT(MGMT_CONNECT == 250); + LASSERT(MGMT_DISCONNECT == 251); + LASSERT(MGMT_EXCEPTION == 252); + LASSERT(OBD_PING == 400); + LASSERT(OBD_LOG_CANCEL == 401); + LASSERT(OBD_LAST_OPC == 402); /* Sizes and Offsets */ /* Checks for struct lustre_handle */ - LASSERT (sizeof (struct lustre_handle) == 8); - LASSERT (offsetof (struct lustre_handle, cookie) == 0); - LASSERT (sizeof (((struct lustre_handle *)0)->cookie) == 8); + LASSERT((int)sizeof(struct lustre_handle) == 8); + LASSERT(offsetof(struct lustre_handle, cookie) == 0); + LASSERT((int)sizeof(((struct lustre_handle *)0)->cookie) == 8); /* Checks for struct lustre_msg */ - LASSERT (sizeof (struct lustre_msg) == 60); - LASSERT (offsetof (struct lustre_msg, handle) == 0); - LASSERT (sizeof (((struct lustre_msg *)0)->handle) == 8); - LASSERT (offsetof (struct lustre_msg, magic) == 8); - LASSERT (sizeof (((struct lustre_msg *)0)->magic) == 4); - LASSERT (offsetof (struct lustre_msg, type) == 12); - LASSERT (sizeof (((struct lustre_msg *)0)->type) == 4); - LASSERT (offsetof (struct lustre_msg, version) == 16); - LASSERT (sizeof (((struct lustre_msg *)0)->version) == 4); - LASSERT (offsetof (struct lustre_msg, opc) == 20); - LASSERT (sizeof (((struct lustre_msg *)0)->opc) == 4); - LASSERT (offsetof (struct lustre_msg, last_xid) == 24); - LASSERT (sizeof (((struct lustre_msg *)0)->last_xid) == 8); - LASSERT (offsetof (struct lustre_msg, last_committed) == 32); - LASSERT (sizeof (((struct lustre_msg *)0)->last_committed) == 8); - LASSERT (offsetof (struct lustre_msg, transno) == 40); - LASSERT (sizeof (((struct lustre_msg *)0)->transno) == 8); - LASSERT (offsetof (struct lustre_msg, status) == 48); - LASSERT (sizeof (((struct lustre_msg *)0)->status) == 4); - LASSERT (offsetof (struct lustre_msg, flags) == 52); - LASSERT (sizeof (((struct lustre_msg *)0)->flags) == 4); - LASSERT (offsetof (struct lustre_msg, bufcount) == 56); - LASSERT (sizeof (((struct lustre_msg *)0)->bufcount) == 4); - LASSERT (offsetof (struct lustre_msg, buflens[7]) == 88); - LASSERT (sizeof (((struct lustre_msg *)0)->buflens[7]) == 4); + LASSERT((int)sizeof(struct lustre_msg) == 64); + LASSERT(offsetof(struct lustre_msg, handle) == 0); + LASSERT((int)sizeof(((struct lustre_msg *)0)->handle) == 8); + LASSERT(offsetof(struct lustre_msg, magic) == 8); + LASSERT((int)sizeof(((struct lustre_msg *)0)->magic) == 4); + LASSERT(offsetof(struct lustre_msg, type) == 12); + LASSERT((int)sizeof(((struct lustre_msg *)0)->type) == 4); + LASSERT(offsetof(struct lustre_msg, version) == 16); + LASSERT((int)sizeof(((struct lustre_msg *)0)->version) == 4); + LASSERT(offsetof(struct lustre_msg, opc) == 20); + LASSERT((int)sizeof(((struct lustre_msg *)0)->opc) == 4); + LASSERT(offsetof(struct lustre_msg, last_xid) == 24); + LASSERT((int)sizeof(((struct lustre_msg *)0)->last_xid) == 8); + LASSERT(offsetof(struct lustre_msg, last_committed) == 32); + LASSERT((int)sizeof(((struct lustre_msg *)0)->last_committed) == 8); + LASSERT(offsetof(struct lustre_msg, transno) == 40); + LASSERT((int)sizeof(((struct lustre_msg *)0)->transno) == 8); + LASSERT(offsetof(struct lustre_msg, status) == 48); + LASSERT((int)sizeof(((struct lustre_msg *)0)->status) == 4); + LASSERT(offsetof(struct lustre_msg, flags) == 52); + LASSERT((int)sizeof(((struct lustre_msg *)0)->flags) == 4); + LASSERT(offsetof(struct lustre_msg, bufcount) == 60); + LASSERT((int)sizeof(((struct lustre_msg *)0)->bufcount) == 4); + LASSERT(offsetof(struct lustre_msg, buflens[7]) == 92); + LASSERT((int)sizeof(((struct lustre_msg *)0)->buflens[7]) == 4); /* Checks for struct obdo */ - LASSERT (sizeof (struct obdo) == 164); - LASSERT (offsetof (struct obdo, o_id) == 0); - LASSERT (sizeof (((struct obdo *)0)->o_id) == 8); - LASSERT (offsetof (struct obdo, o_gr) == 8); - LASSERT (sizeof (((struct obdo *)0)->o_gr) == 8); - LASSERT (offsetof (struct obdo, o_atime) == 16); - LASSERT (sizeof (((struct obdo *)0)->o_atime) == 8); - LASSERT (offsetof (struct obdo, o_mtime) == 24); - LASSERT (sizeof (((struct obdo *)0)->o_mtime) == 8); - LASSERT (offsetof (struct obdo, o_ctime) == 32); - LASSERT (sizeof (((struct obdo *)0)->o_ctime) == 8); - LASSERT (offsetof (struct obdo, o_size) == 40); - LASSERT (sizeof (((struct obdo *)0)->o_size) == 8); - LASSERT (offsetof (struct obdo, o_blocks) == 48); - LASSERT (sizeof (((struct obdo *)0)->o_blocks) == 8); - LASSERT (offsetof (struct obdo, o_rdev) == 56); - LASSERT (sizeof (((struct obdo *)0)->o_rdev) == 8); - LASSERT (offsetof (struct obdo, o_blksize) == 64); - LASSERT (sizeof (((struct obdo *)0)->o_blksize) == 4); - LASSERT (offsetof (struct obdo, o_mode) == 68); - LASSERT (sizeof (((struct obdo *)0)->o_mode) == 4); - LASSERT (offsetof (struct obdo, o_uid) == 72); - LASSERT (sizeof (((struct obdo *)0)->o_uid) == 4); - LASSERT (offsetof (struct obdo, o_gid) == 76); - LASSERT (sizeof (((struct obdo *)0)->o_gid) == 4); - LASSERT (offsetof (struct obdo, o_flags) == 80); - LASSERT (sizeof (((struct obdo *)0)->o_flags) == 4); - LASSERT (offsetof (struct obdo, o_nlink) == 84); - LASSERT (sizeof (((struct obdo *)0)->o_nlink) == 4); - LASSERT (offsetof (struct obdo, o_generation) == 88); - LASSERT (sizeof (((struct obdo *)0)->o_generation) == 4); - LASSERT (offsetof (struct obdo, o_valid) == 92); - LASSERT (sizeof (((struct obdo *)0)->o_valid) == 4); - LASSERT (offsetof (struct obdo, o_obdflags) == 96); - LASSERT (sizeof (((struct obdo *)0)->o_obdflags) == 4); - LASSERT (offsetof (struct obdo, o_easize) == 100); - LASSERT (sizeof (((struct obdo *)0)->o_easize) == 4); - LASSERT (offsetof (struct obdo, o_inline) == 104); - LASSERT (sizeof (((struct obdo *)0)->o_inline) == 60); + LASSERT((int)sizeof(struct obdo) == 168); + LASSERT(offsetof(struct obdo, o_id) == 0); + LASSERT((int)sizeof(((struct obdo *)0)->o_id) == 8); + LASSERT(offsetof(struct obdo, o_gr) == 8); + LASSERT((int)sizeof(((struct obdo *)0)->o_gr) == 8); + LASSERT(offsetof(struct obdo, o_atime) == 16); + LASSERT((int)sizeof(((struct obdo *)0)->o_atime) == 8); + LASSERT(offsetof(struct obdo, o_mtime) == 24); + LASSERT((int)sizeof(((struct obdo *)0)->o_mtime) == 8); + LASSERT(offsetof(struct obdo, o_ctime) == 32); + LASSERT((int)sizeof(((struct obdo *)0)->o_ctime) == 8); + LASSERT(offsetof(struct obdo, o_size) == 40); + LASSERT((int)sizeof(((struct obdo *)0)->o_size) == 8); + LASSERT(offsetof(struct obdo, o_blocks) == 48); + LASSERT((int)sizeof(((struct obdo *)0)->o_blocks) == 8); + LASSERT(offsetof(struct obdo, o_rdev) == 56); + LASSERT((int)sizeof(((struct obdo *)0)->o_rdev) == 8); + LASSERT(offsetof(struct obdo, o_blksize) == 64); + LASSERT((int)sizeof(((struct obdo *)0)->o_blksize) == 4); + LASSERT(offsetof(struct obdo, o_mode) == 68); + LASSERT((int)sizeof(((struct obdo *)0)->o_mode) == 4); + LASSERT(offsetof(struct obdo, o_uid) == 72); + LASSERT((int)sizeof(((struct obdo *)0)->o_uid) == 4); + LASSERT(offsetof(struct obdo, o_gid) == 76); + LASSERT((int)sizeof(((struct obdo *)0)->o_gid) == 4); + LASSERT(offsetof(struct obdo, o_flags) == 80); + LASSERT((int)sizeof(((struct obdo *)0)->o_flags) == 4); + LASSERT(offsetof(struct obdo, o_nlink) == 84); + LASSERT((int)sizeof(((struct obdo *)0)->o_nlink) == 4); + LASSERT(offsetof(struct obdo, o_generation) == 88); + LASSERT((int)sizeof(((struct obdo *)0)->o_generation) == 4); + LASSERT(offsetof(struct obdo, o_valid) == 92); + LASSERT((int)sizeof(((struct obdo *)0)->o_valid) == 4); + LASSERT(offsetof(struct obdo, o_obdflags) == 96); + LASSERT((int)sizeof(((struct obdo *)0)->o_obdflags) == 4); + LASSERT(offsetof(struct obdo, o_easize) == 100); + LASSERT((int)sizeof(((struct obdo *)0)->o_easize) == 4); + LASSERT(offsetof(struct obdo, o_inline) == 104); + LASSERT((int)sizeof(((struct obdo *)0)->o_inline) == 64); + LASSERT(OBD_MD_FLID == 1); + LASSERT(OBD_MD_FLATIME == 2); + LASSERT(OBD_MD_FLMTIME == 4); + LASSERT(OBD_MD_FLCTIME == 8); + LASSERT(OBD_MD_FLSIZE == 16); + LASSERT(OBD_MD_FLBLOCKS == 32); + LASSERT(OBD_MD_FLBLKSZ == 64); + LASSERT(OBD_MD_FLMODE == 128); + LASSERT(OBD_MD_FLTYPE == 256); + LASSERT(OBD_MD_FLUID == 512); + LASSERT(OBD_MD_FLGID == 1024); + LASSERT(OBD_MD_FLFLAGS == 2048); + LASSERT(OBD_MD_FLOBDFLG == 4096); + LASSERT(OBD_MD_FLNLINK == 8192); + LASSERT(OBD_MD_FLGENER == 16384); + LASSERT(OBD_MD_FLINLINE == 32768); + LASSERT(OBD_MD_FLRDEV == 65536); + LASSERT(OBD_MD_FLEASIZE == 131072); + LASSERT(OBD_MD_LINKNAME == 262144); + LASSERT(OBD_MD_FLHANDLE == 524288); + LASSERT(OBD_MD_FLCKSUM == 1048576); + LASSERT(OBD_MD_FLQOS == 2097152); + LASSERT(OBD_MD_FLOSCOPQ == 4194304); + LASSERT(OBD_MD_FLCOOKIE == 8388608); + LASSERT(OBD_MD_FLGROUP == 16777216); + LASSERT(OBD_FL_INLINEDATA == 1); + LASSERT(OBD_FL_OBDMDEXISTS == 2); + LASSERT(OBD_FL_DELORPHAN == 4); + LASSERT(OBD_FL_NORPC == 8); + LASSERT(OBD_FL_IDONLY == 16); + + /* Checks for struct lov_mds_md_v1 */ + LASSERT((int)sizeof(struct lov_mds_md_v1) == 32); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_magic) == 0); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic) == 4); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_pattern) == 4); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern) == 4); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_object_id) == 8); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 4); + LASSERT(offsetof(struct lov_mds_md_v1, lmm_objects) == 32); + LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects) == 0); + + /* Checks for struct lov_ost_data_v1 */ + LASSERT((int)sizeof(struct lov_ost_data_v1) == 24); + LASSERT(offsetof(struct lov_ost_data_v1, l_object_id) == 0); + LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8); + LASSERT(offsetof(struct lov_ost_data_v1, l_object_gr) == 8); + LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8); + LASSERT(offsetof(struct lov_ost_data_v1, l_ost_gen) == 16); + LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4); + LASSERT(offsetof(struct lov_ost_data_v1, l_ost_idx) == 20); + LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx) == 4); + LASSERT(LOV_MAGIC_V0 == 198183888); + LASSERT(LOV_MAGIC_V1 == 198249424); + LASSERT(LOV_PATTERN_RAID0 == 1); + LASSERT(LOV_PATTERN_RAID1 == 2); /* Checks for struct obd_statfs */ - LASSERT (sizeof (struct obd_statfs) == 144); - LASSERT (offsetof (struct obd_statfs, os_type) == 0); - LASSERT (sizeof (((struct obd_statfs *)0)->os_type) == 8); - LASSERT (offsetof (struct obd_statfs, os_blocks) == 8); - LASSERT (sizeof (((struct obd_statfs *)0)->os_blocks) == 8); - LASSERT (offsetof (struct obd_statfs, os_bfree) == 16); - LASSERT (sizeof (((struct obd_statfs *)0)->os_bfree) == 8); - LASSERT (offsetof (struct obd_statfs, os_bavail) == 24); - LASSERT (sizeof (((struct obd_statfs *)0)->os_bavail) == 8); - LASSERT (offsetof (struct obd_statfs, os_ffree) == 40); - LASSERT (sizeof (((struct obd_statfs *)0)->os_ffree) == 8); - LASSERT (offsetof (struct obd_statfs, os_fsid) == 48); - LASSERT (sizeof (((struct obd_statfs *)0)->os_fsid) == 40); - LASSERT (offsetof (struct obd_statfs, os_bsize) == 88); - LASSERT (sizeof (((struct obd_statfs *)0)->os_bsize) == 4); - LASSERT (offsetof (struct obd_statfs, os_namelen) == 92); - LASSERT (sizeof (((struct obd_statfs *)0)->os_namelen) == 4); + LASSERT((int)sizeof(struct obd_statfs) == 144); + LASSERT(offsetof(struct obd_statfs, os_type) == 0); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_type) == 8); + LASSERT(offsetof(struct obd_statfs, os_blocks) == 8); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_blocks) == 8); + LASSERT(offsetof(struct obd_statfs, os_bfree) == 16); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bfree) == 8); + LASSERT(offsetof(struct obd_statfs, os_bavail) == 24); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bavail) == 8); + LASSERT(offsetof(struct obd_statfs, os_ffree) == 40); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_ffree) == 8); + LASSERT(offsetof(struct obd_statfs, os_fsid) == 48); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_fsid) == 40); + LASSERT(offsetof(struct obd_statfs, os_bsize) == 88); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bsize) == 4); + LASSERT(offsetof(struct obd_statfs, os_namelen) == 92); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_namelen) == 4); + LASSERT(offsetof(struct obd_statfs, os_spare) == 104); + LASSERT((int)sizeof(((struct obd_statfs *)0)->os_spare) == 40); /* Checks for struct obd_ioobj */ - LASSERT (sizeof (struct obd_ioobj) == 24); - LASSERT (offsetof (struct obd_ioobj, ioo_id) == 0); - LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_id) == 8); - LASSERT (offsetof (struct obd_ioobj, ioo_gr) == 8); - LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_gr) == 8); - LASSERT (offsetof (struct obd_ioobj, ioo_type) == 16); - LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_type) == 4); - LASSERT (offsetof (struct obd_ioobj, ioo_bufcnt) == 20); - LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_bufcnt) == 4); + LASSERT((int)sizeof(struct obd_ioobj) == 24); + LASSERT(offsetof(struct obd_ioobj, ioo_id) == 0); + LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8); + LASSERT(offsetof(struct obd_ioobj, ioo_gr) == 8); + LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8); + LASSERT(offsetof(struct obd_ioobj, ioo_type) == 16); + LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4); + LASSERT(offsetof(struct obd_ioobj, ioo_bufcnt) == 20); + LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4); /* Checks for struct niobuf_remote */ - LASSERT (sizeof (struct niobuf_remote) == 16); - LASSERT (offsetof (struct niobuf_remote, offset) == 0); - LASSERT (sizeof (((struct niobuf_remote *)0)->offset) == 8); - LASSERT (offsetof (struct niobuf_remote, len) == 8); - LASSERT (sizeof (((struct niobuf_remote *)0)->len) == 4); - LASSERT (offsetof (struct niobuf_remote, flags) == 12); - LASSERT (sizeof (((struct niobuf_remote *)0)->flags) == 4); + LASSERT((int)sizeof(struct niobuf_remote) == 16); + LASSERT(offsetof(struct niobuf_remote, offset) == 0); + LASSERT((int)sizeof(((struct niobuf_remote *)0)->offset) == 8); + LASSERT(offsetof(struct niobuf_remote, len) == 8); + LASSERT((int)sizeof(((struct niobuf_remote *)0)->len) == 4); + LASSERT(offsetof(struct niobuf_remote, flags) == 12); + LASSERT((int)sizeof(((struct niobuf_remote *)0)->flags) == 4); + LASSERT(OBD_BRW_READ == 1); + LASSERT(OBD_BRW_WRITE == 2); + LASSERT(OBD_BRW_CREATE == 4); + LASSERT(OBD_BRW_SYNC == 8); + LASSERT(OBD_BRW_FROM_GRANT == 32); /* Checks for struct ost_body */ - LASSERT (sizeof (struct ost_body) == 164); - LASSERT (offsetof (struct ost_body, oa) == 0); - LASSERT (sizeof (((struct ost_body *)0)->oa) == 164); + LASSERT((int)sizeof(struct ost_body) == 168); + LASSERT(offsetof(struct ost_body, oa) == 0); + LASSERT((int)sizeof(((struct ost_body *)0)->oa) == 168); /* Checks for struct ll_fid */ - LASSERT (sizeof (struct ll_fid) == 16); - LASSERT (offsetof (struct ll_fid, id) == 0); - LASSERT (sizeof (((struct ll_fid *)0)->id) == 8); - LASSERT (offsetof (struct ll_fid, generation) == 8); - LASSERT (sizeof (((struct ll_fid *)0)->generation) == 4); - LASSERT (offsetof (struct ll_fid, f_type) == 12); - LASSERT (sizeof (((struct ll_fid *)0)->f_type) == 4); + LASSERT((int)sizeof(struct ll_fid) == 16); + LASSERT(offsetof(struct ll_fid, id) == 0); + LASSERT((int)sizeof(((struct ll_fid *)0)->id) == 8); + LASSERT(offsetof(struct ll_fid, generation) == 8); + LASSERT((int)sizeof(((struct ll_fid *)0)->generation) == 4); + LASSERT(offsetof(struct ll_fid, f_type) == 12); + LASSERT((int)sizeof(((struct ll_fid *)0)->f_type) == 4); /* Checks for struct mds_status_req */ - LASSERT (sizeof (struct mds_status_req) == 8); - LASSERT (offsetof (struct mds_status_req, flags) == 0); - LASSERT (sizeof (((struct mds_status_req *)0)->flags) == 4); - LASSERT (offsetof (struct mds_status_req, repbuf) == 4); - LASSERT (sizeof (((struct mds_status_req *)0)->repbuf) == 4); + LASSERT((int)sizeof(struct mds_status_req) == 8); + LASSERT(offsetof(struct mds_status_req, flags) == 0); + LASSERT((int)sizeof(((struct mds_status_req *)0)->flags) == 4); + LASSERT(offsetof(struct mds_status_req, repbuf) == 4); + LASSERT((int)sizeof(((struct mds_status_req *)0)->repbuf) == 4); /* Checks for struct mds_body */ - LASSERT (sizeof (struct mds_body) == 124); - LASSERT (offsetof (struct mds_body, fid1) == 0); - LASSERT (sizeof (((struct mds_body *)0)->fid1) == 16); - LASSERT (offsetof (struct mds_body, fid2) == 16); - LASSERT (sizeof (((struct mds_body *)0)->fid2) == 16); - LASSERT (offsetof (struct mds_body, handle) == 32); - LASSERT (sizeof (((struct mds_body *)0)->handle) == 8); - LASSERT (offsetof (struct mds_body, size) == 40); - LASSERT (sizeof (((struct mds_body *)0)->size) == 8); - LASSERT (offsetof (struct mds_body, blocks) == 48); - LASSERT (sizeof (((struct mds_body *)0)->blocks) == 8); - LASSERT (offsetof (struct mds_body, ino) == 56); - LASSERT (sizeof (((struct mds_body *)0)->ino) == 4); - LASSERT (offsetof (struct mds_body, valid) == 60); - LASSERT (sizeof (((struct mds_body *)0)->valid) == 4); - LASSERT (offsetof (struct mds_body, fsuid) == 64); - LASSERT (sizeof (((struct mds_body *)0)->fsuid) == 4); - LASSERT (offsetof (struct mds_body, fsgid) == 68); - LASSERT (sizeof (((struct mds_body *)0)->fsgid) == 4); - LASSERT (offsetof (struct mds_body, capability) == 72); - LASSERT (sizeof (((struct mds_body *)0)->capability) == 4); - LASSERT (offsetof (struct mds_body, mode) == 76); - LASSERT (sizeof (((struct mds_body *)0)->mode) == 4); - LASSERT (offsetof (struct mds_body, uid) == 80); - LASSERT (sizeof (((struct mds_body *)0)->uid) == 4); - LASSERT (offsetof (struct mds_body, gid) == 84); - LASSERT (sizeof (((struct mds_body *)0)->gid) == 4); - LASSERT (offsetof (struct mds_body, mtime) == 88); - LASSERT (sizeof (((struct mds_body *)0)->mtime) == 4); - LASSERT (offsetof (struct mds_body, ctime) == 92); - LASSERT (sizeof (((struct mds_body *)0)->ctime) == 4); - LASSERT (offsetof (struct mds_body, atime) == 96); - LASSERT (sizeof (((struct mds_body *)0)->atime) == 4); - LASSERT (offsetof (struct mds_body, flags) == 100); - LASSERT (sizeof (((struct mds_body *)0)->flags) == 4); - LASSERT (offsetof (struct mds_body, rdev) == 104); - LASSERT (sizeof (((struct mds_body *)0)->rdev) == 4); - LASSERT (offsetof (struct mds_body, nlink) == 108); - LASSERT (sizeof (((struct mds_body *)0)->nlink) == 4); - LASSERT (offsetof (struct mds_body, generation) == 112); - LASSERT (sizeof (((struct mds_body *)0)->generation) == 4); - LASSERT (offsetof (struct mds_body, suppgid) == 116); - LASSERT (sizeof (((struct mds_body *)0)->suppgid) == 4); + LASSERT((int)sizeof(struct mds_body) == 136); + LASSERT(offsetof(struct mds_body, fid1) == 0); + LASSERT((int)sizeof(((struct mds_body *)0)->fid1) == 16); + LASSERT(offsetof(struct mds_body, fid2) == 16); + LASSERT((int)sizeof(((struct mds_body *)0)->fid2) == 16); + LASSERT(offsetof(struct mds_body, handle) == 32); + LASSERT((int)sizeof(((struct mds_body *)0)->handle) == 8); + LASSERT(offsetof(struct mds_body, size) == 40); + LASSERT((int)sizeof(((struct mds_body *)0)->size) == 8); + LASSERT(offsetof(struct mds_body, blocks) == 48); + LASSERT((int)sizeof(((struct mds_body *)0)->blocks) == 8); + LASSERT(offsetof(struct mds_body, io_epoch) == 56); + LASSERT((int)sizeof(((struct mds_body *)0)->io_epoch) == 8); + LASSERT(offsetof(struct mds_body, ino) == 64); + LASSERT((int)sizeof(((struct mds_body *)0)->ino) == 4); + LASSERT(offsetof(struct mds_body, valid) == 68); + LASSERT((int)sizeof(((struct mds_body *)0)->valid) == 4); + LASSERT(offsetof(struct mds_body, fsuid) == 72); + LASSERT((int)sizeof(((struct mds_body *)0)->fsuid) == 4); + LASSERT(offsetof(struct mds_body, fsgid) == 76); + LASSERT((int)sizeof(((struct mds_body *)0)->fsgid) == 4); + LASSERT(offsetof(struct mds_body, capability) == 80); + LASSERT((int)sizeof(((struct mds_body *)0)->capability) == 4); + LASSERT(offsetof(struct mds_body, mode) == 84); + LASSERT((int)sizeof(((struct mds_body *)0)->mode) == 4); + LASSERT(offsetof(struct mds_body, uid) == 88); + LASSERT((int)sizeof(((struct mds_body *)0)->uid) == 4); + LASSERT(offsetof(struct mds_body, gid) == 92); + LASSERT((int)sizeof(((struct mds_body *)0)->gid) == 4); + LASSERT(offsetof(struct mds_body, mtime) == 96); + LASSERT((int)sizeof(((struct mds_body *)0)->mtime) == 4); + LASSERT(offsetof(struct mds_body, ctime) == 100); + LASSERT((int)sizeof(((struct mds_body *)0)->ctime) == 4); + LASSERT(offsetof(struct mds_body, atime) == 104); + LASSERT((int)sizeof(((struct mds_body *)0)->atime) == 4); + LASSERT(offsetof(struct mds_body, flags) == 108); + LASSERT((int)sizeof(((struct mds_body *)0)->flags) == 4); + LASSERT(offsetof(struct mds_body, rdev) == 112); + LASSERT((int)sizeof(((struct mds_body *)0)->rdev) == 4); + LASSERT(offsetof(struct mds_body, nlink) == 116); + LASSERT((int)sizeof(((struct mds_body *)0)->nlink) == 4); + LASSERT(offsetof(struct mds_body, generation) == 120); + LASSERT((int)sizeof(((struct mds_body *)0)->generation) == 4); + LASSERT(offsetof(struct mds_body, suppgid) == 124); + LASSERT((int)sizeof(((struct mds_body *)0)->suppgid) == 4); + LASSERT(offsetof(struct mds_body, eadatasize) == 128); + LASSERT((int)sizeof(((struct mds_body *)0)->eadatasize) == 4); + LASSERT(FMODE_READ == 1); + LASSERT(FMODE_WRITE == 2); + LASSERT(FMODE_EXEC == 4); + LASSERT(MDS_OPEN_CREAT == 64); + LASSERT(MDS_OPEN_EXCL == 128); + LASSERT(MDS_OPEN_TRUNC == 512); + LASSERT(MDS_OPEN_APPEND == 1024); + LASSERT(MDS_OPEN_SYNC == 4096); + LASSERT(MDS_OPEN_DIRECTORY == 65536); + LASSERT(MDS_OPEN_DELAY_CREATE == 16777216); + LASSERT(MDS_OPEN_HAS_EA == 1073741824); /* Checks for struct mds_rec_setattr */ - LASSERT (sizeof (struct mds_rec_setattr) == 92); - LASSERT (offsetof (struct mds_rec_setattr, sa_opcode) == 0); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_opcode) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_fsuid) == 4); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_fsuid) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_fsgid) == 8); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_fsgid) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_cap) == 12); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_cap) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_reserved) == 16); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_reserved) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_valid) == 20); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_valid) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_fid) == 24); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_fid) == 16); - LASSERT (offsetof (struct mds_rec_setattr, sa_mode) == 40); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_mode) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_uid) == 44); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_uid) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_gid) == 48); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_gid) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_attr_flags) == 52); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_attr_flags) == 4); - LASSERT (offsetof (struct mds_rec_setattr, sa_size) == 56); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_size) == 8); - LASSERT (offsetof (struct mds_rec_setattr, sa_atime) == 64); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_atime) == 8); - LASSERT (offsetof (struct mds_rec_setattr, sa_mtime) == 72); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_mtime) == 8); - LASSERT (offsetof (struct mds_rec_setattr, sa_ctime) == 80); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_ctime) == 8); - LASSERT (offsetof (struct mds_rec_setattr, sa_suppgid) == 88); - LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_suppgid) == 4); + LASSERT((int)sizeof(struct mds_rec_setattr) == 88); + LASSERT(offsetof(struct mds_rec_setattr, sa_opcode) == 0); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_fsuid) == 4); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsuid) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_fsgid) == 8); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsgid) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_cap) == 12); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_cap) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_suppgid) == 16); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_suppgid) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_valid) == 20); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_valid) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_fid) == 24); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fid) == 16); + LASSERT(offsetof(struct mds_rec_setattr, sa_mode) == 40); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_mode) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_uid) == 44); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_uid) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_gid) == 48); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_gid) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_attr_flags) == 52); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4); + LASSERT(offsetof(struct mds_rec_setattr, sa_size) == 56); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_size) == 8); + LASSERT(offsetof(struct mds_rec_setattr, sa_atime) == 64); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_atime) == 8); + LASSERT(offsetof(struct mds_rec_setattr, sa_mtime) == 72); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime) == 8); + LASSERT(offsetof(struct mds_rec_setattr, sa_ctime) == 80); + LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime) == 8); /* Checks for struct mds_rec_create */ - LASSERT (sizeof (struct mds_rec_create) == 84); - LASSERT (offsetof (struct mds_rec_create, cr_opcode) == 0); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_opcode) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_fsuid) == 4); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_fsuid) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_fsgid) == 8); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_fsgid) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_cap) == 12); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_cap) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_flags) == 16); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_flags) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_mode) == 20); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_mode) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_fid) == 24); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_fid) == 16); - LASSERT (offsetof (struct mds_rec_create, cr_replayfid) == 40); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_replayfid) == 16); - LASSERT (offsetof (struct mds_rec_create, cr_uid) == 56); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_uid) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_gid) == 60); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_gid) == 4); - LASSERT (offsetof (struct mds_rec_create, cr_time) == 64); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_time) == 8); - LASSERT (offsetof (struct mds_rec_create, cr_rdev) == 72); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_rdev) == 8); - LASSERT (offsetof (struct mds_rec_create, cr_suppgid) == 80); - LASSERT (sizeof (((struct mds_rec_create *)0)->cr_suppgid) == 4); + LASSERT((int)sizeof(struct mds_rec_create) == 80); + LASSERT(offsetof(struct mds_rec_create, cr_opcode) == 0); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_opcode) == 4); + LASSERT(offsetof(struct mds_rec_create, cr_fsuid) == 4); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fsuid) == 4); + LASSERT(offsetof(struct mds_rec_create, cr_fsgid) == 8); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fsgid) == 4); + LASSERT(offsetof(struct mds_rec_create, cr_cap) == 12); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_cap) == 4); + LASSERT(offsetof(struct mds_rec_create, cr_flags) == 16); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_flags) == 4); + LASSERT(offsetof(struct mds_rec_create, cr_mode) == 20); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_mode) == 4); + LASSERT(offsetof(struct mds_rec_create, cr_fid) == 24); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fid) == 16); + LASSERT(offsetof(struct mds_rec_create, cr_replayfid) == 40); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_replayfid) == 16); + LASSERT(offsetof(struct mds_rec_create, cr_time) == 56); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_time) == 8); + LASSERT(offsetof(struct mds_rec_create, cr_rdev) == 64); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_rdev) == 8); + LASSERT(offsetof(struct mds_rec_create, cr_suppgid) == 72); + LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_suppgid) == 4); /* Checks for struct mds_rec_link */ - LASSERT (sizeof (struct mds_rec_link) == 56); - LASSERT (offsetof (struct mds_rec_link, lk_opcode) == 0); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_opcode) == 4); - LASSERT (offsetof (struct mds_rec_link, lk_fsuid) == 4); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fsuid) == 4); - LASSERT (offsetof (struct mds_rec_link, lk_fsgid) == 8); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fsgid) == 4); - LASSERT (offsetof (struct mds_rec_link, lk_cap) == 12); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_cap) == 4); - LASSERT (offsetof (struct mds_rec_link, lk_suppgid1) == 16); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_suppgid1) == 4); - LASSERT (offsetof (struct mds_rec_link, lk_suppgid2) == 20); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_suppgid2) == 4); - LASSERT (offsetof (struct mds_rec_link, lk_fid1) == 24); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fid1) == 16); - LASSERT (offsetof (struct mds_rec_link, lk_fid2) == 40); - LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fid2) == 16); + LASSERT((int)sizeof(struct mds_rec_link) == 64); + LASSERT(offsetof(struct mds_rec_link, lk_opcode) == 0); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_opcode) == 4); + LASSERT(offsetof(struct mds_rec_link, lk_fsuid) == 4); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fsuid) == 4); + LASSERT(offsetof(struct mds_rec_link, lk_fsgid) == 8); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fsgid) == 4); + LASSERT(offsetof(struct mds_rec_link, lk_cap) == 12); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_cap) == 4); + LASSERT(offsetof(struct mds_rec_link, lk_suppgid1) == 16); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid1) == 4); + LASSERT(offsetof(struct mds_rec_link, lk_suppgid2) == 20); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid2) == 4); + LASSERT(offsetof(struct mds_rec_link, lk_fid1) == 24); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fid1) == 16); + LASSERT(offsetof(struct mds_rec_link, lk_fid2) == 40); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fid2) == 16); + LASSERT(offsetof(struct mds_rec_link, lk_time) == 56); + LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_time) == 8); /* Checks for struct mds_rec_unlink */ - LASSERT (sizeof (struct mds_rec_unlink) == 60); - LASSERT (offsetof (struct mds_rec_unlink, ul_opcode) == 0); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_opcode) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_fsuid) == 4); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fsuid) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_fsgid) == 8); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fsgid) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_cap) == 12); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_cap) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_reserved) == 16); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_reserved) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_mode) == 20); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_mode) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_suppgid) == 24); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_suppgid) == 4); - LASSERT (offsetof (struct mds_rec_unlink, ul_fid1) == 28); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fid1) == 16); - LASSERT (offsetof (struct mds_rec_unlink, ul_fid2) == 44); - LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fid2) == 16); + LASSERT((int)sizeof(struct mds_rec_unlink) == 64); + LASSERT(offsetof(struct mds_rec_unlink, ul_opcode) == 0); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode) == 4); + LASSERT(offsetof(struct mds_rec_unlink, ul_fsuid) == 4); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsuid) == 4); + LASSERT(offsetof(struct mds_rec_unlink, ul_fsgid) == 8); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsgid) == 4); + LASSERT(offsetof(struct mds_rec_unlink, ul_cap) == 12); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_cap) == 4); + LASSERT(offsetof(struct mds_rec_unlink, ul_suppgid) == 16); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_suppgid) == 4); + LASSERT(offsetof(struct mds_rec_unlink, ul_mode) == 20); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_mode) == 4); + LASSERT(offsetof(struct mds_rec_unlink, ul_fid1) == 24); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1) == 16); + LASSERT(offsetof(struct mds_rec_unlink, ul_fid2) == 40); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2) == 16); + LASSERT(offsetof(struct mds_rec_unlink, ul_time) == 56); + LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_time) == 8); /* Checks for struct mds_rec_rename */ - LASSERT (sizeof (struct mds_rec_rename) == 56); - LASSERT (offsetof (struct mds_rec_rename, rn_opcode) == 0); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_opcode) == 4); - LASSERT (offsetof (struct mds_rec_rename, rn_fsuid) == 4); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fsuid) == 4); - LASSERT (offsetof (struct mds_rec_rename, rn_fsgid) == 8); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fsgid) == 4); - LASSERT (offsetof (struct mds_rec_rename, rn_cap) == 12); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_cap) == 4); - LASSERT (offsetof (struct mds_rec_rename, rn_suppgid1) == 16); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_suppgid1) == 4); - LASSERT (offsetof (struct mds_rec_rename, rn_suppgid2) == 20); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_suppgid2) == 4); - LASSERT (offsetof (struct mds_rec_rename, rn_fid1) == 24); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fid1) == 16); - LASSERT (offsetof (struct mds_rec_rename, rn_fid2) == 40); - LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fid2) == 16); + LASSERT((int)sizeof(struct mds_rec_rename) == 64); + LASSERT(offsetof(struct mds_rec_rename, rn_opcode) == 0); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_opcode) == 4); + LASSERT(offsetof(struct mds_rec_rename, rn_fsuid) == 4); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fsuid) == 4); + LASSERT(offsetof(struct mds_rec_rename, rn_fsgid) == 8); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fsgid) == 4); + LASSERT(offsetof(struct mds_rec_rename, rn_cap) == 12); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_cap) == 4); + LASSERT(offsetof(struct mds_rec_rename, rn_suppgid1) == 16); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid1) == 4); + LASSERT(offsetof(struct mds_rec_rename, rn_suppgid2) == 20); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid2) == 4); + LASSERT(offsetof(struct mds_rec_rename, rn_fid1) == 24); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fid1) == 16); + LASSERT(offsetof(struct mds_rec_rename, rn_fid2) == 40); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fid2) == 16); + LASSERT(offsetof(struct mds_rec_rename, rn_time) == 56); + LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_time) == 8); /* Checks for struct lov_desc */ - LASSERT (sizeof (struct lov_desc) == 72); - LASSERT (offsetof (struct lov_desc, ld_tgt_count) == 0); - LASSERT (sizeof (((struct lov_desc *)0)->ld_tgt_count) == 4); - LASSERT (offsetof (struct lov_desc, ld_active_tgt_count) == 4); - LASSERT (sizeof (((struct lov_desc *)0)->ld_active_tgt_count) == 4); - LASSERT (offsetof (struct lov_desc, ld_default_stripe_count) == 8); - LASSERT (sizeof (((struct lov_desc *)0)->ld_default_stripe_count) == 4); - LASSERT (offsetof (struct lov_desc, ld_default_stripe_size) == 12); - LASSERT (sizeof (((struct lov_desc *)0)->ld_default_stripe_size) == 8); - LASSERT (offsetof (struct lov_desc, ld_default_stripe_offset) == 20); - LASSERT (sizeof (((struct lov_desc *)0)->ld_default_stripe_offset) == 8); - LASSERT (offsetof (struct lov_desc, ld_pattern) == 28); - LASSERT (sizeof (((struct lov_desc *)0)->ld_pattern) == 4); - LASSERT (offsetof (struct lov_desc, ld_uuid) == 32); - LASSERT (sizeof (((struct lov_desc *)0)->ld_uuid) == 37); + LASSERT((int)sizeof(struct lov_desc) == 72); + LASSERT(offsetof(struct lov_desc, ld_tgt_count) == 0); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_tgt_count) == 4); + LASSERT(offsetof(struct lov_desc, ld_active_tgt_count) == 4); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count) == 4); + LASSERT(offsetof(struct lov_desc, ld_default_stripe_count) == 8); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count) == 4); + LASSERT(offsetof(struct lov_desc, ld_pattern) == 12); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_pattern) == 4); + LASSERT(offsetof(struct lov_desc, ld_default_stripe_size) == 16); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size) == 8); + LASSERT(offsetof(struct lov_desc, ld_default_stripe_offset) == 24); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset) == 8); + LASSERT(offsetof(struct lov_desc, ld_uuid) == 32); + LASSERT((int)sizeof(((struct lov_desc *)0)->ld_uuid) == 40); /* Checks for struct ldlm_res_id */ - LASSERT (sizeof (struct ldlm_res_id) == 24); - LASSERT (offsetof (struct ldlm_res_id, name[3]) == 24); - LASSERT (sizeof (((struct ldlm_res_id *)0)->name[3]) == 8); - - /* Checks for struct ldlm_data */ - LASSERT (sizeof (struct ldlm_data) == 16); - LASSERT (offsetof (struct ldlm_data, l_extent.start) == 0); - LASSERT (sizeof (((struct ldlm_data *)0)->l_extent.start) == 8); - LASSERT (offsetof (struct ldlm_data, l_extent.end) == 8); - LASSERT (sizeof (((struct ldlm_data *)0)->l_extent.end) == 8); - LASSERT (sizeof (((struct ldlm_data *)0)->l_flock.pid) == 4); - LASSERT (offsetof (struct ldlm_data, l_flock.pid) == 16); + LASSERT((int)sizeof(struct ldlm_res_id) == 32); + LASSERT(offsetof(struct ldlm_res_id, name[4]) == 32); + LASSERT((int)sizeof(((struct ldlm_res_id *)0)->name[4]) == 8); + + /* Checks for struct ldlm_extent */ + LASSERT((int)sizeof(struct ldlm_extent) == 16); + LASSERT(offsetof(struct ldlm_extent, start) == 0); + LASSERT((int)sizeof(((struct ldlm_extent *)0)->start) == 8); + LASSERT(offsetof(struct ldlm_extent, end) == 8); + LASSERT((int)sizeof(((struct ldlm_extent *)0)->end) == 8); + + /* Checks for struct ldlm_flock */ + LASSERT((int)sizeof(struct ldlm_flock) == 32); + LASSERT(offsetof(struct ldlm_flock, start) == 0); + LASSERT((int)sizeof(((struct ldlm_flock *)0)->start) == 8); + LASSERT(offsetof(struct ldlm_flock, end) == 8); + LASSERT((int)sizeof(((struct ldlm_flock *)0)->end) == 8); + LASSERT(offsetof(struct ldlm_flock, blocking_export) == 16); + LASSERT((int)sizeof(((struct ldlm_flock *)0)->blocking_export) == 8); + LASSERT(offsetof(struct ldlm_flock, blocking_pid) == 24); + LASSERT((int)sizeof(((struct ldlm_flock *)0)->blocking_pid) == 4); + LASSERT(offsetof(struct ldlm_flock, pid) == 28); + LASSERT((int)sizeof(((struct ldlm_flock *)0)->pid) == 4); /* Checks for struct ldlm_intent */ - LASSERT (sizeof (struct ldlm_intent) == 8); - LASSERT (offsetof (struct ldlm_intent, opc) == 0); - LASSERT (sizeof (((struct ldlm_intent *)0)->opc) == 8); + LASSERT((int)sizeof(struct ldlm_intent) == 8); + LASSERT(offsetof(struct ldlm_intent, opc) == 0); + LASSERT((int)sizeof(((struct ldlm_intent *)0)->opc) == 8); /* Checks for struct ldlm_resource_desc */ - LASSERT (sizeof (struct ldlm_resource_desc) == 44); - LASSERT (offsetof (struct ldlm_resource_desc, lr_type) == 0); - LASSERT (sizeof (((struct ldlm_resource_desc *)0)->lr_type) == 4); - LASSERT (offsetof (struct ldlm_resource_desc, lr_name) == 4); - LASSERT (sizeof (((struct ldlm_resource_desc *)0)->lr_name) == 24); - LASSERT (offsetof (struct ldlm_resource_desc, lr_version[4]) == 44); - LASSERT (sizeof (((struct ldlm_resource_desc *)0)->lr_version[4]) == 4); + LASSERT((int)sizeof(struct ldlm_resource_desc) == 52); + LASSERT(offsetof(struct ldlm_resource_desc, lr_type) == 0); + LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4); + LASSERT(offsetof(struct ldlm_resource_desc, lr_name) == 4); + LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32); + LASSERT(offsetof(struct ldlm_resource_desc, lr_version[4]) == 52); + LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_version[4]) == 4); /* Checks for struct ldlm_lock_desc */ - LASSERT (sizeof (struct ldlm_lock_desc) == 84); - LASSERT (offsetof (struct ldlm_lock_desc, l_resource) == 0); - LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_resource) == 44); - LASSERT (offsetof (struct ldlm_lock_desc, l_req_mode) == 44); - LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_req_mode) == 4); - LASSERT (offsetof (struct ldlm_lock_desc, l_granted_mode) == 48); - LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_granted_mode) == 4); - LASSERT (offsetof (struct ldlm_lock_desc, l_extent) == 52); - LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_extent) == 16); - LASSERT (offsetof (struct ldlm_lock_desc, l_version[4]) == 84); - LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_version[4]) == 4); + LASSERT((int)sizeof(struct ldlm_lock_desc) == 108); + LASSERT(offsetof(struct ldlm_lock_desc, l_resource) == 0); + LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_resource) == 52); + LASSERT(offsetof(struct ldlm_lock_desc, l_req_mode) == 52); + LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode) == 4); + LASSERT(offsetof(struct ldlm_lock_desc, l_granted_mode) == 56); + LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode) == 4); + LASSERT(offsetof(struct ldlm_lock_desc, l_policy_data) == 60); + LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data) == 32); + LASSERT(offsetof(struct ldlm_lock_desc, l_version[4]) == 108); + LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_version[4]) == 4); /* Checks for struct ldlm_request */ - LASSERT (sizeof (struct ldlm_request) == 104); - LASSERT (offsetof (struct ldlm_request, lock_flags) == 0); - LASSERT (sizeof (((struct ldlm_request *)0)->lock_flags) == 4); - LASSERT (offsetof (struct ldlm_request, lock_desc) == 4); - LASSERT (sizeof (((struct ldlm_request *)0)->lock_desc) == 84); - LASSERT (offsetof (struct ldlm_request, lock_handle1) == 88); - LASSERT (sizeof (((struct ldlm_request *)0)->lock_handle1) == 8); - LASSERT (offsetof (struct ldlm_request, lock_handle2) == 96); - LASSERT (sizeof (((struct ldlm_request *)0)->lock_handle2) == 8); + LASSERT((int)sizeof(struct ldlm_request) == 128); + LASSERT(offsetof(struct ldlm_request, lock_flags) == 0); + LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_flags) == 4); + LASSERT(offsetof(struct ldlm_request, lock_desc) == 4); + LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 108); + LASSERT(offsetof(struct ldlm_request, lock_handle1) == 112); + LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_handle1) == 8); + LASSERT(offsetof(struct ldlm_request, lock_handle2) == 120); + LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_handle2) == 8); /* Checks for struct ldlm_reply */ - LASSERT (sizeof (struct ldlm_reply) == 72); - LASSERT (offsetof (struct ldlm_reply, lock_flags) == 0); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_flags) == 4); - LASSERT (offsetof (struct ldlm_reply, lock_mode) == 4); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_mode) == 4); - LASSERT (offsetof (struct ldlm_reply, lock_resource_name) == 8); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_resource_name) == 24); - LASSERT (offsetof (struct ldlm_reply, lock_handle) == 32); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_handle) == 8); - LASSERT (offsetof (struct ldlm_reply, lock_extent) == 40); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_extent) == 16); - LASSERT (offsetof (struct ldlm_reply, lock_policy_res1) == 56); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_policy_res1) == 8); - LASSERT (offsetof (struct ldlm_reply, lock_policy_res2) == 64); - LASSERT (sizeof (((struct ldlm_reply *)0)->lock_policy_res2) == 8); + LASSERT((int)sizeof(struct ldlm_reply) == 96); + LASSERT(offsetof(struct ldlm_reply, lock_flags) == 0); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_flags) == 4); + LASSERT(offsetof(struct ldlm_reply, lock_mode) == 4); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_mode) == 4); + LASSERT(offsetof(struct ldlm_reply, lock_resource_name) == 8); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_resource_name) == 32); + LASSERT(offsetof(struct ldlm_reply, lock_handle) == 40); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_handle) == 8); + LASSERT(offsetof(struct ldlm_reply, lock_policy_data) == 48); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_data) == 32); + LASSERT(offsetof(struct ldlm_reply, lock_policy_res1) == 80); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1) == 8); + LASSERT(offsetof(struct ldlm_reply, lock_policy_res2) == 88); + LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2) == 8); /* Checks for struct ptlbd_op */ - LASSERT (sizeof (struct ptlbd_op) == 12); - LASSERT (offsetof (struct ptlbd_op, op_cmd) == 0); - LASSERT (sizeof (((struct ptlbd_op *)0)->op_cmd) == 2); - LASSERT (offsetof (struct ptlbd_op, op_lun) == 2); - LASSERT (sizeof (((struct ptlbd_op *)0)->op_lun) == 2); - LASSERT (offsetof (struct ptlbd_op, op_niob_cnt) == 4); - LASSERT (sizeof (((struct ptlbd_op *)0)->op_niob_cnt) == 2); - LASSERT (offsetof (struct ptlbd_op, op__padding) == 6); - LASSERT (sizeof (((struct ptlbd_op *)0)->op__padding) == 2); - LASSERT (offsetof (struct ptlbd_op, op_block_cnt) == 8); - LASSERT (sizeof (((struct ptlbd_op *)0)->op_block_cnt) == 4); + LASSERT((int)sizeof(struct ptlbd_op) == 12); + LASSERT(offsetof(struct ptlbd_op, op_cmd) == 0); + LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_cmd) == 2); + LASSERT(offsetof(struct ptlbd_op, op_lun) == 2); + LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_lun) == 2); + LASSERT(offsetof(struct ptlbd_op, op_niob_cnt) == 4); + LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt) == 2); + LASSERT(offsetof(struct ptlbd_op, op__padding) == 6); + LASSERT((int)sizeof(((struct ptlbd_op *)0)->op__padding) == 2); + LASSERT(offsetof(struct ptlbd_op, op_block_cnt) == 8); + LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_block_cnt) == 4); /* Checks for struct ptlbd_niob */ - LASSERT (sizeof (struct ptlbd_niob) == 24); - LASSERT (offsetof (struct ptlbd_niob, n_xid) == 0); - LASSERT (sizeof (((struct ptlbd_niob *)0)->n_xid) == 8); - LASSERT (offsetof (struct ptlbd_niob, n_block_nr) == 8); - LASSERT (sizeof (((struct ptlbd_niob *)0)->n_block_nr) == 8); - LASSERT (offsetof (struct ptlbd_niob, n_offset) == 16); - LASSERT (sizeof (((struct ptlbd_niob *)0)->n_offset) == 4); - LASSERT (offsetof (struct ptlbd_niob, n_length) == 20); - LASSERT (sizeof (((struct ptlbd_niob *)0)->n_length) == 4); + LASSERT((int)sizeof(struct ptlbd_niob) == 24); + LASSERT(offsetof(struct ptlbd_niob, n_xid) == 0); + LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_xid) == 8); + LASSERT(offsetof(struct ptlbd_niob, n_block_nr) == 8); + LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_block_nr) == 8); + LASSERT(offsetof(struct ptlbd_niob, n_offset) == 16); + LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_offset) == 4); + LASSERT(offsetof(struct ptlbd_niob, n_length) == 20); + LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_length) == 4); /* Checks for struct ptlbd_rsp */ - LASSERT (sizeof (struct ptlbd_rsp) == 4); - LASSERT (offsetof (struct ptlbd_rsp, r_status) == 0); - LASSERT (sizeof (((struct ptlbd_rsp *)0)->r_status) == 2); - LASSERT (offsetof (struct ptlbd_rsp, r_error_cnt) == 2); - LASSERT (sizeof (((struct ptlbd_rsp *)0)->r_error_cnt) == 2); -#endif + LASSERT((int)sizeof(struct ptlbd_rsp) == 4); + LASSERT(offsetof(struct ptlbd_rsp, r_status) == 0); + LASSERT((int)sizeof(((struct ptlbd_rsp *)0)->r_status) == 2); + LASSERT(offsetof(struct ptlbd_rsp, r_error_cnt) == 2); + LASSERT((int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt) == 2); + + /* Checks for struct llog_logid */ + LASSERT((int)sizeof(struct llog_logid) == 20); + LASSERT(offsetof(struct llog_logid, lgl_oid) == 0); + LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8); + LASSERT(offsetof(struct llog_logid, lgl_ogr) == 8); + LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8); + LASSERT(offsetof(struct llog_logid, lgl_ogen) == 16); + LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4); + LASSERT(OST_SZ_REC == 274730752); + LASSERT(OST_RAID1_REC == 274731008); + LASSERT(MDS_UNLINK_REC == 274801668); + LASSERT(OBD_CFG_REC == 274857984); + LASSERT(PTL_CFG_REC == 274923520); + LASSERT(LLOG_GEN_REC == 274989056); + LASSERT(LLOG_HDR_MAGIC == 275010873); + LASSERT(LLOG_LOGID_MAGIC == 275010874); + + /* Checks for struct llog_rec_hdr */ + LASSERT((int)sizeof(struct llog_rec_hdr) == 16); + LASSERT(offsetof(struct llog_rec_hdr, lrh_len) == 0); + LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_len) == 4); + LASSERT(offsetof(struct llog_rec_hdr, lrh_index) == 4); + LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_index) == 4); + LASSERT(offsetof(struct llog_rec_hdr, lrh_type) == 8); + LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4); + + /* Checks for struct llog_rec_tail */ + LASSERT((int)sizeof(struct llog_rec_tail) == 8); + LASSERT(offsetof(struct llog_rec_tail, lrt_len) == 0); + LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_len) == 4); + LASSERT(offsetof(struct llog_rec_tail, lrt_index) == 4); + LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4); + + /* Checks for struct llog_logid_rec */ + LASSERT((int)sizeof(struct llog_logid_rec) == 48); + LASSERT(offsetof(struct llog_logid_rec, lid_hdr) == 0); + LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16); + LASSERT(offsetof(struct llog_logid_rec, lid_id) == 16); + LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20); + LASSERT(offsetof(struct llog_logid_rec, lid_tail) == 40); + LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8); + + /* Checks for struct llog_create_rec */ + LASSERT((int)sizeof(struct llog_create_rec) == 56); + LASSERT(offsetof(struct llog_create_rec, lcr_hdr) == 0); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_hdr) == 16); + LASSERT(offsetof(struct llog_create_rec, lcr_fid) == 16); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_fid) == 16); + LASSERT(offsetof(struct llog_create_rec, lcr_oid) == 32); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8); + LASSERT(offsetof(struct llog_create_rec, lcr_ogen) == 40); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_ogen) == 4); + + /* Checks for struct llog_orphan_rec */ + LASSERT((int)sizeof(struct llog_orphan_rec) == 40); + LASSERT(offsetof(struct llog_orphan_rec, lor_hdr) == 0); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr) == 16); + LASSERT(offsetof(struct llog_orphan_rec, lor_oid) == 16); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_oid) == 8); + LASSERT(offsetof(struct llog_orphan_rec, lor_ogen) == 24); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen) == 4); + LASSERT(offsetof(struct llog_orphan_rec, lor_tail) == 32); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_tail) == 8); + + /* Checks for struct llog_unlink_rec */ + LASSERT((int)sizeof(struct llog_unlink_rec) == 40); + LASSERT(offsetof(struct llog_unlink_rec, lur_hdr) == 0); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16); + LASSERT(offsetof(struct llog_unlink_rec, lur_oid) == 16); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8); + LASSERT(offsetof(struct llog_unlink_rec, lur_ogen) == 24); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen) == 4); + LASSERT(offsetof(struct llog_unlink_rec, lur_tail) == 32); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8); + + /* Checks for struct llog_size_change_rec */ + LASSERT((int)sizeof(struct llog_size_change_rec) == 48); + LASSERT(offsetof(struct llog_size_change_rec, lsc_hdr) == 0); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16); + LASSERT(offsetof(struct llog_size_change_rec, lsc_fid) == 16); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 16); + LASSERT(offsetof(struct llog_size_change_rec, lsc_io_epoch) == 32); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch) == 4); + LASSERT(offsetof(struct llog_size_change_rec, lsc_tail) == 40); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8); + + /* Checks for struct llog_gen */ + LASSERT((int)sizeof(struct llog_gen) == 16); + LASSERT(offsetof(struct llog_gen, mnt_cnt) == 0); + LASSERT((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8); + LASSERT(offsetof(struct llog_gen, conn_cnt) == 8); + LASSERT((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8); + + /* Checks for struct llog_gen_rec */ + LASSERT((int)sizeof(struct llog_gen_rec) == 40); + LASSERT(offsetof(struct llog_gen_rec, lgr_hdr) == 0); + LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16); + LASSERT(offsetof(struct llog_gen_rec, lgr_gen) == 16); + LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16); + LASSERT(offsetof(struct llog_gen_rec, lgr_tail) == 32); + LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8); + + /* Checks for struct llog_log_hdr */ + LASSERT((int)sizeof(struct llog_log_hdr) == 4096); + LASSERT(offsetof(struct llog_log_hdr, llh_hdr) == 0); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_hdr) == 16); + LASSERT(offsetof(struct llog_log_hdr, llh_timestamp) == 16); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp) == 8); + LASSERT(offsetof(struct llog_log_hdr, llh_count) == 24); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_count) == 4); + LASSERT(offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset) == 4); + LASSERT(offsetof(struct llog_log_hdr, llh_size) == 32); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_size) == 4); + LASSERT(offsetof(struct llog_log_hdr, llh_flags) == 36); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_flags) == 4); + LASSERT(offsetof(struct llog_log_hdr, llh_cat_idx) == 40); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx) == 4); + LASSERT(offsetof(struct llog_log_hdr, llh_tgtuuid) == 44); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40); + LASSERT(offsetof(struct llog_log_hdr, llh_reserved) == 84); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4); + LASSERT(offsetof(struct llog_log_hdr, llh_bitmap) == 88); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 4000); + LASSERT(offsetof(struct llog_log_hdr, llh_tail) == 4088); + LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8); + + /* Checks for struct llog_cookie */ + LASSERT((int)sizeof(struct llog_cookie) == 32); + LASSERT(offsetof(struct llog_cookie, lgc_lgl) == 0); + LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_lgl) == 20); + LASSERT(offsetof(struct llog_cookie, lgc_subsys) == 20); + LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_subsys) == 4); + LASSERT(offsetof(struct llog_cookie, lgc_index) == 24); + LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_index) == 4); + + /* Checks for struct llogd_body */ + LASSERT((int)sizeof(struct llogd_body) == 48); + LASSERT(offsetof(struct llogd_body, lgd_logid) == 0); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_logid) == 20); + LASSERT(offsetof(struct llogd_body, lgd_ctxt_idx) == 20); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx) == 4); + LASSERT(offsetof(struct llogd_body, lgd_llh_flags) == 24); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_llh_flags) == 4); + LASSERT(offsetof(struct llogd_body, lgd_index) == 28); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_index) == 4); + LASSERT(offsetof(struct llogd_body, lgd_saved_index) == 32); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_saved_index) == 4); + LASSERT(offsetof(struct llogd_body, lgd_len) == 36); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_len) == 4); + LASSERT(offsetof(struct llogd_body, lgd_cur_offset) == 40); + LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8); + LASSERT(LLOG_ORIGIN_HANDLE_CREATE == 501); + LASSERT(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502); + LASSERT(LLOG_ORIGIN_HANDLE_READ_HEADER == 503); + LASSERT(LLOG_ORIGIN_HANDLE_WRITE_REC == 504); + LASSERT(LLOG_ORIGIN_HANDLE_CLOSE == 505); + LASSERT(LLOG_ORIGIN_CONNECT == 506); + LASSERT(LLOG_CATINFO == 507); + + /* Checks for struct llogd_conn_body */ + LASSERT((int)sizeof(struct llogd_conn_body) == 40); + LASSERT(offsetof(struct llogd_conn_body, lgdc_gen) == 0); + LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen) == 16); + LASSERT(offsetof(struct llogd_conn_body, lgdc_logid) == 16); + LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid) == 20); + LASSERT(offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36); + LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx) == 4); +} +#else +void lustre_assert_wire_constants(void) +{ + return; } +#endif + diff --git a/lustre/scripts/lustre.spec.in b/lustre/scripts/lustre.spec.in index 6c29251..08a4345 100644 --- a/lustre/scripts/lustre.spec.in +++ b/lustre/scripts/lustre.spec.in @@ -112,8 +112,19 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre %attr(-, root, root) /usr/sbin/wiretest %attr(-, root, root) /usr/sbin/lactive %attr(-, root, root) /usr/sbin/llanalyze -%attr(-, root, root) /usr/bin/lfs %attr(-, root, root) /usr/sbin/gmnalnid +%attr(-, root, root) /usr/sbin/llstat.pl +%attr(-, root, root) /usr/sbin/llobdstat.pl +%attr(-, root, root) /usr/sbin/load_ldap.sh +%attr(-, root, root) /usr/sbin/acceptor +%attr(-, root, root) /usr/sbin/ptlctl +%attr(-, root, root) /usr/sbin/debugctl +%attr(-, root, root) /usr/sbin/lload +%attr(-, root, root) /usr/sbin/obdbarrier +%attr(-, root, root) /usr/sbin/obdio +%attr(-, root, root) /usr/sbin/routerstat +%attr(-, root, root) /usr/sbin/wirecheck +%attr(-, root, root) /usr/bin/lfs %attr(-, root, root) /usr/bin/lfind %attr(-, root, root) /usr/bin/lstripe %attr(-, root, root) /usr/bin/mcreate @@ -121,9 +132,6 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre %attr(-, root, root) /usr/bin/mkdirmany %attr(-, root, root) /usr/bin/iopentest1 %attr(-, root, root) /usr/bin/iopentest2 -%attr(-, root, root) /usr/sbin/llstat.pl -%attr(-, root, root) /usr/sbin/llobdstat.pl -%attr(-, root, root) /usr/sbin/load_ldap.sh %attr(-, root, root) /usr/lib/lustre/python/* %attr(-, root, root) /usr/lib/lustre/examples/llmount.sh %attr(-, root, root) /usr/lib/lustre/examples/llmountcleanup.sh @@ -135,19 +143,11 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre %attr(-, root, root) /usr/lib/lustre/examples/llechocleanup.sh %attr(-, root, root) /etc/init.d/lustre -%attr(-, root, root) /usr/sbin/acceptor -%attr(-, root, root) /usr/sbin/ptlctl -%attr(-, root, root) /usr/sbin/debugctl %attr(-, root, root) /lib/libportals.a %attr(-, root, root) /lib/libptlctl.a %attr(-, root, root) /lib/libtcpnal.a %attr(-, root, root) /lib/liblustreapi.a %attr(-, root, root) /usr/include/lustre/*.h -%attr(-, root, root) /usr/sbin/lload -%attr(-, root, root) /usr/sbin/obdbarrier -%attr(-, root, root) /usr/sbin/obdio -%attr(-, root, root) /usr/sbin/routerstat -%attr(-, root, root) /usr/sbin/wirecheck %ifarch alpha %attr(-, root, root) /usr/sbin/mcpload diff --git a/lustre/tests/openfile.c b/lustre/tests/openfile.c index a6e44c6..81236b0 100644 --- a/lustre/tests/openfile.c +++ b/lustre/tests/openfile.c @@ -137,19 +137,21 @@ int main(int argc, char** argv) fd = open(fname, flags); if (fd != -1) { - fprintf(stderr, "Succeed in opening file \"%s\"(flags=%s", - fname, cloned_flags); + printf("Succeed in opening file \"%s\"(flags=%s", + fname, cloned_flags); if (mode_set) - fprintf(stderr, ", mode=%o", mode); - fprintf(stderr, ")\n"); + printf(", mode=%o", mode); + printf(")\n"); close(fd); - } else { - fprintf(stderr, "Error in opening file \"%s\"(flags=%s", - fname, cloned_flags); - if (mode_set) - fprintf(stderr, ", mode=%o", mode); - fprintf(stderr, ") %d: %s\n", errno, strerror(errno)); + return 0; } + + fprintf(stderr, "Error in opening file \"%s\"(flags=%s", + fname, cloned_flags); + if (mode_set) + fprintf(stderr, ", mode=%o", mode); + fprintf(stderr, ") %d: %s\n", errno, strerror(errno)); + return errno; } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 5337a42..7c91dd5 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -14,7 +14,7 @@ ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-""} [ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT" SRCDIR=`dirname $0` -PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH +export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH TMP=${TMP:-/tmp} @@ -1081,7 +1081,7 @@ test_33a() { $RUNAS $OPENFILE -f O_RDWR:O_CREAT -m 0444 $DIR/d33/f33 || error $RUNAS $OPENFILE -f O_RDWR:O_CREAT -m 0444 $DIR/d33/f33 && error || true } -run_test 33a "test open file(mode=0444) with O_RDWR (should return error) ====" +run_test 33a "test open file(mode=0444) with O_RDWR (should return error)" TEST_34_SIZE=${TEST_34_SIZE:-2000000000000} test_34a() { @@ -1305,7 +1305,7 @@ test_42c() { error "$BEFOREWRITES < $AFTERWRITES on truncate" rm $file } -run_test 42c "test partial truncate of file with cached dirty data ====" +run_test 42c "test partial truncate of file with cached dirty data" test_42d() { trunc_test 42d 0 @@ -1313,7 +1313,7 @@ test_42d() { error "beforewrites $BEFOREWRITES != afterwrites $AFTERWRITES on truncate" rm $file } -run_test 42d "test complete truncate of file with cached dirty data ====" +run_test 42d "test complete truncate of file with cached dirty data" test_43() { mkdir $DIR/d43 @@ -1322,7 +1322,7 @@ test_43() { $DIR/d43/f && error || true exec 100<&- } -run_test 43 "execution of file opened for write should return -ETXTBSY==" +run_test 43 "execution of file opened for write should return -ETXTBSY" test_43a() { mkdir -p $DIR/d43 @@ -1335,7 +1335,7 @@ test_43a() { kill -USR1 $MULTIPID || return 2 wait $MULTIPID || return 3 } -run_test 43a "open(RDWR) of file being executed should return -ETXTBSY==" +run_test 43a "open(RDWR) of file being executed should return -ETXTBSY" test_43b() { mkdir -p $DIR/d43 @@ -1348,16 +1348,16 @@ test_43b() { kill -USR1 $MULTIPID || return 2 wait $MULTIPID || return 3 } -run_test 43b "truncate of file being executed should return -ETXTBSY====" +run_test 43b "truncate of file being executed should return -ETXTBSY" test_43c() { local testdir="$DIR/d43c" mkdir -p $testdir cp $SHELL $testdir/ - ( cd $(dirname $SHELL) && md5sum $(basename $SHELL) ) | \ + ( cd $(dirname $SHELL) && md5sum $(basename $SHELL) ) | \ ( cd $testdir && md5sum -c) } -run_test 43c "md5sum of copy into lustre================================" +run_test 43c "md5sum of copy into lustre========================" test_44() { [ "$STRIPECOUNT" -lt "2" ] && echo "skipping 2-stripe test" && return @@ -1466,7 +1466,7 @@ test_48() { mkdir $DIR/d48 || error "recreate diectory failed" ls || error "can't list after recreate directory" } -run_test 48 "Access renamed current working directory =========" +run_test 48 "Access renamed current working directory ==========" test_50() { # bug 1485 @@ -1615,7 +1615,62 @@ test_56() { error "lfs find --obd wrong: should not show file on other obd" echo "lfs find --obd passed." } -run_test 56 "check lfs find=====================================" +run_test 56 "check lfs find ====================================" + +test_57a() { + # note test will not do anything if MDS is not local + for DEV in `cat /proc/fs/lustre/mds/*/mntdev`; do + dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV" + DEVISIZE=`awk '/Inode size:/ { print $3 }' $TMP/t57a.dump` + [ "$DEVISIZE" -gt 128 ] || error "inode size $DEVISIZE" + rm $TMP/t57a.dump + done +} +run_test 57a "verify MDS filesystem created with large inodes ==" + +test_57b() { + FILECOUNT=100 + FILE1=$DIR/d57b/f1 + FILEN=$DIR/d57b/f$FILECOUNT + rm -rf $DIR/d57b || error "removing $DIR/d57b" + mkdir -p $DIR/d57b || error "creating $DIR/d57b" + echo "mcreating $FILECOUNT files" + createmany -m $DIR/d57b/f 1 $FILECOUNT || \ + error "creating files in $DIR/d57b" + + # verify that files do not have EAs yet + $LFIND $FILE1 2>&1 | grep -q "no stripe" || error "$FILE1 has an EA" + $LFIND $FILEN 2>&1 | grep -q "no stripe" || error "$FILEN has an EA" + + MDSFREE="`cat /proc/fs/lustre/mds/*/kbytesfree`" + MDCFREE="`cat /proc/fs/lustre/mdc/*/kbytesfree`" + echo "opening files to create objects/EAs" + for FILE in `seq -f $DIR/d57b/f%g 1 $FILECOUNT`; do + $OPENFILE -f O_RDWR $FILE > /dev/null || error "opening $FILE" + done + + # verify that files have EAs now + $LFIND $FILE1 | grep -q "obdidx" || error "$FILE1 missing EA" + $LFIND $FILEN | grep -q "obdidx" || error "$FILEN missing EA" + + MDSFREE2="`cat /proc/fs/lustre/mds/*/kbytesfree`" + MDCFREE2="`cat /proc/fs/lustre/mdc/*/kbytesfree`" + if [ "$MDCFREE" != "$MDCFREE2" ]; then + if [ "$MDSFREE" != "$MDSFREE2" ]; then + error "MDC before $MDCFREE != after $MDCFREE2" + else + echo "MDC before $MDCFREE != after $MDCFREE2" + echo "unable to confirm if MDS has large inodes" + fi + fi + rm -rf $DIR/d57b +} +run_test 57b "default LOV EAs are stored inside large inodes ===" + +test_58() { + wiretest +} +run_test 58 "verify cross-platform wire constants ==============" test_59() { echo "touch 130 files" diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index 05da911..f64ec44 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -3,8 +3,8 @@ set -e ONLY=${ONLY:-"$*"} -# bug number for skipped test: 1557 2366 -ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"8 10 "} +# bug number for skipped test: 1557 +ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"8"} # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! [ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT" @@ -218,7 +218,7 @@ test_9() { } run_test 9 "append of file with sub-page size on multiple mounts" -test_10() { +test_10a() { MTPT=1 OFFSET=0 > $DIR2/f10 @@ -231,7 +231,22 @@ test_10() { [ "`cat $DIR1/f10`" = "abcdefghijkl" ] || \ error "`od -a $DIR1/f10` != abcdefghijkl" } -run_test 10 "write of file with sub-page size on multiple mounts " +run_test 10a "write of file with sub-page size on multiple mounts " + +test_10b() { + set -vx + yes "R" | dd of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1" + + truncate $DIR1/f10b 4096 || error "truncate 4096" + + dd if=$DIR2/f10b of=$TMP/f10b-lustre bs=4k count=1 || error "dd $DIR2" + + # create a test file locally to compare + yes "R" | dd of=$TMP/f10b bs=3k count=1 || error "dd random" + truncate $TMP/f10b 4096 || error "truncate 4096" + cmp $TMP/f10b $TMP/f10b-lustre || error "file miscompare" +} +run_test 10b "write of file with sub-page size on multiple mounts " test_11() { mkdir $DIR1/d11 diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 7125bdd..a41f7a7 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -68,7 +68,7 @@ command_t cmdlist[] = { {"getstripe", lfs_getstripe, 0, "To list the striping pattern for given filename.\n" "usage:getstripe "}, - {"check", lfs_check, 0, + {"check", lfs_check, 0, "Display the status of MDS or OSTs (as specified in the command) " "or all the servers (MDS and OSTs).\n" "usage: check "}, @@ -213,7 +213,7 @@ static int lfs_osts(int argc, char **argv) struct mntent *mnt = NULL; struct obd_uuid *obduuid = NULL; int rc=0; - + if (argc != 1) return CMD_HELP; @@ -235,7 +235,7 @@ static int lfs_osts(int argc, char **argv) } endmntent(fp); } - + return rc; } diff --git a/lustre/utils/lmc b/lustre/utils/lmc index 8da28a1..f4deff5 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -27,7 +27,15 @@ lmc - lustre configuration data manager import sys, os, getopt, string, exceptions, re import xml.dom.minidom -from xml.dom.ext import PrettyPrint + +def printDoc(doc, stream=sys.stdout): + try: + from xml.dom.ext import PrettyPrint + PrettyPrint(doc, stream) + except ImportError: + stream.write(doc.toxml()) + stream.write("\n") + PYMOD_DIR = "/usr/lib/lustre/python" @@ -1160,9 +1168,9 @@ def main(): panic("lmc", e) if outFile == '-': - PrettyPrint(doc) + printDoc(doc) else: - PrettyPrint(doc, open(outFile,"w")) + printDoc(doc, open(outFile,"w")) if __name__ == "__main__": main() diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 18810ae..fb90a0f 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -2,6 +2,8 @@ * vim:expandtab:shiftwidth=8:tabstop=8: */ #include +#include +#include #include #include #include @@ -673,14 +675,74 @@ check_llogd_conn_body(void) CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx); } +void +system_string (char *cmdline, char *str, int len) +{ + int fds[2]; + int rc; + pid_t pid; + + rc = pipe(fds); + if (rc != 0) + abort(); + + pid = fork(); + if (pid == 0) { + /* child */ + int fd = fileno(stdout); + + rc = dup2(fds[1], fd); + if (rc != fd) + abort(); + + exit(system(cmdline)); + /* notreached */ + } else if ((int)pid < 0) { + abort(); + } else { + FILE *f = fdopen(fds[0], "r"); + + if (f == NULL) + abort(); + + close(fds[1]); + + if (fgets(str, len, f) == NULL) + abort(); + + if (waitpid(pid, &rc, 0) != pid) + abort(); + + if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0) + abort(); + + if (strnlen(str, len) == len) + str[len - 1] = 0; + + if (str[strlen(str) - 1] == '\n') + str[strlen(str) - 1] = 0; + + fclose(f); + } +} + int main(int argc, char **argv) { - printf("void lustre_assert_wire_constants(void)\n" - "{\n"); + char unameinfo[80]; + char gccinfo[80]; - COMMENT("Wire protocol assertions generated by 'wirecheck'"); - BLANK_LINE(); + system_string("uname -a", unameinfo, sizeof(unameinfo)); + system_string("gcc -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo)); + + printf ("void lustre_assert_wire_constants(void)\n" + "{\n" + " /* Wire protocol assertions generated by 'wirecheck'\n" + " * running on %s\n" + " * with %s */\n" + "\n", unameinfo, gccinfo); + + BLANK_LINE (); COMMENT("Constants..."); CHECK_DEFINE(PTLRPC_MSG_MAGIC); @@ -818,6 +880,13 @@ main(int argc, char **argv) check_llog_logid(); check_llog_rec_hdr(); check_llog_rec_tail(); + check_llog_logid_rec(); + check_llog_create_rec(); + check_llog_orphan_rec(); + check_llog_unlink_rec(); + check_llog_size_change_rec(); + check_llog_gen(); + check_llog_gen_rec(); check_llog_log_hdr(); check_llog_cookie(); check_llogd_body(); diff --git a/lustre/utils/wirehdr.c b/lustre/utils/wirehdr.c index 4b1b65f..c245ff3 100644 --- a/lustre/utils/wirehdr.c +++ b/lustre/utils/wirehdr.c @@ -14,5 +14,9 @@ int main() { lustre_assert_wire_constants(); + if (ret == 0) + printf("wire constants OK\n"); + return ret; } + diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 3535aaa..c370456 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -14,11 +14,18 @@ int main() { lustre_assert_wire_constants(); + if (ret == 0) + printf("wire constants OK\n"); + return ret; } + void lustre_assert_wire_constants(void) { - /* Wire protocol assertions generated by 'wirecheck' */ + /* 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 + * with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) */ + /* Constants... */ LASSERT(PTLRPC_MSG_MAGIC == 0x0BD00BD0); @@ -653,6 +660,75 @@ void lustre_assert_wire_constants(void) LASSERT(offsetof(struct llog_rec_tail, lrt_index) == 4); LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4); + /* Checks for struct llog_logid_rec */ + LASSERT((int)sizeof(struct llog_logid_rec) == 48); + LASSERT(offsetof(struct llog_logid_rec, lid_hdr) == 0); + LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16); + LASSERT(offsetof(struct llog_logid_rec, lid_id) == 16); + LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20); + LASSERT(offsetof(struct llog_logid_rec, lid_tail) == 40); + LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8); + + /* Checks for struct llog_create_rec */ + LASSERT((int)sizeof(struct llog_create_rec) == 56); + LASSERT(offsetof(struct llog_create_rec, lcr_hdr) == 0); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_hdr) == 16); + LASSERT(offsetof(struct llog_create_rec, lcr_fid) == 16); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_fid) == 16); + LASSERT(offsetof(struct llog_create_rec, lcr_oid) == 32); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8); + LASSERT(offsetof(struct llog_create_rec, lcr_ogen) == 40); + LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_ogen) == 4); + + /* Checks for struct llog_orphan_rec */ + LASSERT((int)sizeof(struct llog_orphan_rec) == 40); + LASSERT(offsetof(struct llog_orphan_rec, lor_hdr) == 0); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr) == 16); + LASSERT(offsetof(struct llog_orphan_rec, lor_oid) == 16); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_oid) == 8); + LASSERT(offsetof(struct llog_orphan_rec, lor_ogen) == 24); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen) == 4); + LASSERT(offsetof(struct llog_orphan_rec, lor_tail) == 32); + LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_tail) == 8); + + /* Checks for struct llog_unlink_rec */ + LASSERT((int)sizeof(struct llog_unlink_rec) == 40); + LASSERT(offsetof(struct llog_unlink_rec, lur_hdr) == 0); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16); + LASSERT(offsetof(struct llog_unlink_rec, lur_oid) == 16); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8); + LASSERT(offsetof(struct llog_unlink_rec, lur_ogen) == 24); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen) == 4); + LASSERT(offsetof(struct llog_unlink_rec, lur_tail) == 32); + LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8); + + /* Checks for struct llog_size_change_rec */ + LASSERT((int)sizeof(struct llog_size_change_rec) == 48); + LASSERT(offsetof(struct llog_size_change_rec, lsc_hdr) == 0); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16); + LASSERT(offsetof(struct llog_size_change_rec, lsc_fid) == 16); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 16); + LASSERT(offsetof(struct llog_size_change_rec, lsc_io_epoch) == 32); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch) == 4); + LASSERT(offsetof(struct llog_size_change_rec, lsc_tail) == 40); + LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8); + + /* Checks for struct llog_gen */ + LASSERT((int)sizeof(struct llog_gen) == 16); + LASSERT(offsetof(struct llog_gen, mnt_cnt) == 0); + LASSERT((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8); + LASSERT(offsetof(struct llog_gen, conn_cnt) == 8); + LASSERT((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8); + + /* Checks for struct llog_gen_rec */ + LASSERT((int)sizeof(struct llog_gen_rec) == 40); + LASSERT(offsetof(struct llog_gen_rec, lgr_hdr) == 0); + LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16); + LASSERT(offsetof(struct llog_gen_rec, lgr_gen) == 16); + LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16); + LASSERT(offsetof(struct llog_gen_rec, lgr_tail) == 32); + LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8); + /* Checks for struct llog_log_hdr */ LASSERT((int)sizeof(struct llog_log_hdr) == 4096); LASSERT(offsetof(struct llog_log_hdr, llh_hdr) == 0); -- 1.8.3.1