Whamcloud - gitweb
LU-9184 ldlm: selective IBITS lock trying 62/25262/11
authorMikhal Pershin <mike.pershin@intel.com>
Sun, 5 Feb 2017 08:58:28 +0000 (11:58 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:29:38 +0000 (03:29 +0000)
There is code to get lock without blocking, e.g. 'try'
to get it. It enqueues lock with all wanted bits and
get it only when all bits are not conflicting.
The new code allows to get as much 'tried' bits as
possible. It also doesn't require extra locking attempt
for that.
Patch intoduces new inodebits field try_bits which contains
optinal bits to get if possible without blocking. Those
bits are checked along with the required bits and only
non-blocked are added to the new IBITS lock.

Signed-off-by: Mikhal Pershin <mike.pershin@intel.com>
Change-Id: I78d181243556e65d3bd702d332307d0723d5b665
Reviewed-on: https://review.whamcloud.com/25262
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
15 files changed:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_inodebits.c
lustre/ldlm/ldlm_lock.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_open.c
lustre/mdt/mdt_reint.c
lustre/osp/osp_md_object.c
lustre/ptlrpc/wirehdr.c
lustre/ptlrpc/wiretest.c
lustre/target/tgt_handler.c
lustre/utils/wirecheck.c
lustre/utils/wirehdr.c
lustre/utils/wiretest.c

index 078adcc..c8bcb7b 100644 (file)
@@ -2282,6 +2282,7 @@ struct ldlm_extent {
 
 struct ldlm_inodebits {
         __u64 bits;
+       __u64 try_bits; /* optional bits to try */
 };
 
 struct ldlm_flock_wire {
index 7782c1a..66e90c2 100644 (file)
@@ -1123,8 +1123,7 @@ struct ldlm_enqueue_info {
        void            *ei_cb_gl;      /** lock glimpse callback */
        void            *ei_cbdata;     /** Data to be passed into callbacks. */
        void            *ei_namespace;  /** lock namespace **/
-       unsigned int    ei_enq_slave:1, /** whether enqueue slave stripes */
-                       ei_nonblock:1;  /** non block enqueue */
+       unsigned int    ei_enq_slave:1; /** whether enqueue slave stripes */
 };
 
 #define ei_res_id      ei_cb_gl
index 90e34a6..2f698d5 100644 (file)
@@ -79,12 +79,18 @@ ldlm_inodebits_compat_queue(struct list_head *queue, struct ldlm_lock *req,
        struct list_head *tmp;
        struct ldlm_lock *lock;
        __u64 req_bits = req->l_policy_data.l_inodebits.bits;
+       __u64 *try_bits = &req->l_policy_data.l_inodebits.try_bits;
        int compat = 1;
+
        ENTRY;
 
-       /* There is no sense in lock with no bits set, I think.
-        * Also, such a lock would be compatible with any other bit lock */
-       LASSERT(req_bits != 0);
+       /* There is no sense in lock with no bits set. Also such a lock
+        * would be compatible with any other bit lock.
+        * Meanwhile that can be true if there were just try_bits and all
+        * are failed, so just exit gracefully and let the caller to care.
+        */
+       if ((req_bits | *try_bits) == 0)
+               RETURN(0);
 
        list_for_each(tmp, queue) {
                struct list_head *mode_tail;
@@ -99,11 +105,10 @@ ldlm_inodebits_compat_queue(struct list_head *queue, struct ldlm_lock *req,
 
                /* last lock in mode group */
                LASSERT(lock->l_sl_mode.prev != NULL);
-               mode_tail = &list_entry(lock->l_sl_mode.prev,
-                                       struct ldlm_lock,
+               mode_tail = &list_entry(lock->l_sl_mode.prev, struct ldlm_lock,
                                        l_sl_mode)->l_res_link;
 
-               /* if reqest lock is not COS_INCOMPAT and COS is disabled,
+               /* if request lock is not COS_INCOMPAT and COS is disabled,
                 * they are compatible, IOW this request is from a local
                 * transaction on a DNE system. */
                if (lock->l_req_mode == LCK_COS && !ldlm_is_cos_incompat(req) &&
@@ -125,8 +130,13 @@ ldlm_inodebits_compat_queue(struct list_head *queue, struct ldlm_lock *req,
 
                        /* Advance loop cursor to last lock in policy group. */
                        tmp = &list_entry(lock->l_sl_policy.prev,
-                                             struct ldlm_lock,
-                                             l_sl_policy)->l_res_link;
+                                         struct ldlm_lock,
+                                         l_sl_policy)->l_res_link;
+
+                       /* drop try_bits used by other locks */
+                       *try_bits &= ~(lock->l_policy_data.l_inodebits.bits);
+                       if ((req_bits | *try_bits) == 0)
+                               RETURN(0);
 
                        /* Locks with overlapping bits conflict. */
                        if (lock->l_policy_data.l_inodebits.bits & req_bits) {
@@ -146,22 +156,21 @@ ldlm_inodebits_compat_queue(struct list_head *queue, struct ldlm_lock *req,
 
                                /* Add locks of the policy group to @work_list
                                 * as blocking locks for @req */
-                                if (lock->l_blocking_ast)
-                                        ldlm_add_ast_work_item(lock, req,
-                                                               work_list);
-                                head = &lock->l_sl_policy;
+                               if (lock->l_blocking_ast)
+                                       ldlm_add_ast_work_item(lock, req,
+                                                              work_list);
+                               head = &lock->l_sl_policy;
                                list_for_each_entry(lock, head, l_sl_policy)
-                                        if (lock->l_blocking_ast)
-                                                ldlm_add_ast_work_item(lock, req,
-                                                                       work_list);
-                        }
-                not_conflicting:
-                        if (tmp == mode_tail)
-                                break;
-
-                        tmp = tmp->next;
-                       lock = list_entry(tmp, struct ldlm_lock,
-                                              l_res_link);
+                                       if (lock->l_blocking_ast)
+                                               ldlm_add_ast_work_item(lock,
+                                                               req, work_list);
+                       }
+not_conflicting:
+                       if (tmp == mode_tail)
+                               break;
+
+                       tmp = tmp->next;
+                       lock = list_entry(tmp, struct ldlm_lock, l_res_link);
                } /* Loop over policy groups within one mode group. */
        } /* Loop over mode groups within @queue. */
 
@@ -184,6 +193,7 @@ int ldlm_process_inodebits_lock(struct ldlm_lock *lock, __u64 *flags,
        struct ldlm_resource *res = lock->l_resource;
        struct list_head rpc_list;
        int rc;
+
        ENTRY;
 
        LASSERT(lock->l_granted_mode != lock->l_req_mode);
@@ -191,22 +201,26 @@ int ldlm_process_inodebits_lock(struct ldlm_lock *lock, __u64 *flags,
        INIT_LIST_HEAD(&rpc_list);
        check_res_locked(res);
 
-       /* (*flags & LDLM_FL_BLOCK_NOWAIT) is for layout lock right now. */
-       if (intention == LDLM_PROCESS_RESCAN ||
-           (*flags & LDLM_FL_BLOCK_NOWAIT)) {
+       if (intention == LDLM_PROCESS_RESCAN) {
                *err = ELDLM_LOCK_ABORTED;
-               if (*flags & LDLM_FL_BLOCK_NOWAIT)
-                       *err = ELDLM_LOCK_WOULDBLOCK;
 
-                rc = ldlm_inodebits_compat_queue(&res->lr_granted, lock, NULL);
-                if (!rc)
-                        RETURN(LDLM_ITER_STOP);
-                rc = ldlm_inodebits_compat_queue(&res->lr_waiting, lock, NULL);
-                if (!rc)
-                        RETURN(LDLM_ITER_STOP);
+               LASSERT(lock->l_policy_data.l_inodebits.bits != 0);
 
-                ldlm_resource_unlink_lock(lock);
-                ldlm_grant_lock(lock, work_list);
+               rc = ldlm_inodebits_compat_queue(&res->lr_granted, lock, NULL);
+               if (!rc)
+                       RETURN(LDLM_ITER_STOP);
+               rc = ldlm_inodebits_compat_queue(&res->lr_waiting, lock, NULL);
+               if (!rc)
+                       RETURN(LDLM_ITER_STOP);
+
+               /* grant also try_bits if any */
+               if (lock->l_policy_data.l_inodebits.try_bits != 0) {
+                       lock->l_policy_data.l_inodebits.bits |=
+                               lock->l_policy_data.l_inodebits.try_bits;
+                       *flags |= LDLM_FL_LOCK_CHANGED;
+               }
+               ldlm_resource_unlink_lock(lock);
+               ldlm_grant_lock(lock, work_list);
 
                *err = ELDLM_OK;
                RETURN(LDLM_ITER_CONTINUE);
@@ -214,16 +228,30 @@ int ldlm_process_inodebits_lock(struct ldlm_lock *lock, __u64 *flags,
 
        LASSERT((intention == LDLM_PROCESS_ENQUEUE && work_list == NULL) ||
                (intention == LDLM_PROCESS_RECOVERY && work_list != NULL));
- restart:
-        rc = ldlm_inodebits_compat_queue(&res->lr_granted, lock, &rpc_list);
-        rc += ldlm_inodebits_compat_queue(&res->lr_waiting, lock, &rpc_list);
-
-        if (rc != 2) {
-               rc = ldlm_handle_conflict_lock(lock, flags, &rpc_list, 0);
-               if (rc == -ERESTART)
-                       GOTO(restart, rc);
+restart:
+       rc = ldlm_inodebits_compat_queue(&res->lr_granted, lock, &rpc_list);
+       rc += ldlm_inodebits_compat_queue(&res->lr_waiting, lock, &rpc_list);
+
+       if (rc != 2) {
+               /* if there were only bits to try and all are conflicting */
+               if ((lock->l_policy_data.l_inodebits.bits |
+                    lock->l_policy_data.l_inodebits.try_bits) == 0) {
+                       rc = ELDLM_LOCK_WOULDBLOCK;
+               } else {
+                       rc = ldlm_handle_conflict_lock(lock, flags,
+                                                      &rpc_list, 0);
+                       if (rc == -ERESTART)
+                               GOTO(restart, rc);
+               }
                *err = rc;
        } else {
+               /* grant also all remaining try_bits */
+               if (lock->l_policy_data.l_inodebits.try_bits != 0) {
+                       lock->l_policy_data.l_inodebits.bits |=
+                               lock->l_policy_data.l_inodebits.try_bits;
+                       *flags |= LDLM_FL_LOCK_CHANGED;
+               }
+               LASSERT(lock->l_policy_data.l_inodebits.bits);
                ldlm_resource_unlink_lock(lock);
                ldlm_grant_lock(lock, work_list);
                rc = 0;
@@ -240,6 +268,7 @@ void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
                                     union ldlm_policy_data *lpolicy)
 {
        lpolicy->l_inodebits.bits = wpolicy->l_inodebits.bits;
+       lpolicy->l_inodebits.try_bits = wpolicy->l_inodebits.try_bits;
 }
 
 void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
@@ -247,4 +276,5 @@ void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
 {
        memset(wpolicy, 0, sizeof(*wpolicy));
        wpolicy->l_inodebits.bits = lpolicy->l_inodebits.bits;
+       wpolicy->l_inodebits.try_bits = lpolicy->l_inodebits.try_bits;
 }
index 7708e27..8b32309 100644 (file)
@@ -2827,7 +2827,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
        case LDLM_IBITS:
                libcfs_debug_vmsg2(msgdata, fmt, args,
                        " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
-                       "res: "DLDLMRES" bits %#llx rrc: %d type: %s "
+                       "res: "DLDLMRES" bits %#llx/%#llx rrc: %d type: %s "
                        "flags: %#llx nid: %s remote: %#llx expref: %d "
                        "pid: %u timeout: %lu lvb_type: %d\n",
                        ldlm_lock_to_ns_name(lock),
@@ -2838,6 +2838,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
                        ldlm_lockname[lock->l_req_mode],
                        PLDLMRES(resource),
                        lock->l_policy_data.l_inodebits.bits,
+                       lock->l_policy_data.l_inodebits.try_bits,
                        atomic_read(&resource->lr_refcount),
                        ldlm_typename[resource->lr_type],
                        lock->l_flags, nid, lock->l_remote_handle.cookie,
index 6035012..439ec41 100644 (file)
@@ -1481,18 +1481,19 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                                  __u64 child_bits,
                                  struct ldlm_reply *ldlm_rep)
 {
-        struct ptlrpc_request  *req       = mdt_info_req(info);
-        struct mdt_body        *reqbody   = NULL;
-        struct mdt_object      *parent    = info->mti_object;
-        struct mdt_object      *child;
-        struct lu_fid          *child_fid = &info->mti_tmp_fid1;
-        struct lu_name         *lname     = NULL;
-        struct mdt_lock_handle *lhp       = NULL;
-        struct ldlm_lock       *lock;
-       bool                    is_resent;
-       bool                    try_layout;
-       int                     ma_need = 0;
-       int                     rc;
+       struct ptlrpc_request  *req = mdt_info_req(info);
+       struct mdt_body        *reqbody = NULL;
+       struct mdt_object      *parent = info->mti_object;
+       struct mdt_object      *child;
+       struct lu_fid          *child_fid = &info->mti_tmp_fid1;
+       struct lu_name         *lname = NULL;
+       struct mdt_lock_handle *lhp = NULL;
+       struct ldlm_lock       *lock;
+       __u64 try_bits = 0;
+       bool is_resent;
+       int ma_need = 0;
+       int rc;
+
        ENTRY;
 
        is_resent = lustre_handle_is_used(&lhc->mlh_reg_lh);
@@ -1654,19 +1655,18 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
        if (rc < 0) {
                GOTO(out_child, rc);
        } else if (rc > 0) {
-                mdt_lock_handle_init(lhc);
+               mdt_lock_handle_init(lhc);
                mdt_lock_reg_init(lhc, LCK_PR);
-               try_layout = false;
 
                if (!(child_bits & MDS_INODELOCK_UPDATE) &&
                      mdt_object_exists(child) && !mdt_object_remote(child)) {
-                        struct md_attr *ma = &info->mti_attr;
+                       struct md_attr *ma = &info->mti_attr;
 
-                        ma->ma_valid = 0;
-                        ma->ma_need = MA_INODE;
+                       ma->ma_valid = 0;
+                       ma->ma_need = MA_INODE;
                        rc = mdt_attr_get_complex(info, child, ma);
-                        if (unlikely(rc != 0))
-                                GOTO(out_child, rc);
+                       if (unlikely(rc != 0))
+                               GOTO(out_child, rc);
 
                        /* If the file has not been changed for some time, we
                         * return not only a LOOKUP lock, but also an UPDATE
@@ -1688,23 +1688,16 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                    S_ISREG(lu_object_attr(&child->mot_obj)) &&
                    !mdt_object_remote(child) && ldlm_rep != NULL) {
                        /* try to grant layout lock for regular file. */
-                       try_layout = true;
+                       try_bits = MDS_INODELOCK_LAYOUT;
                }
 
-               rc = 0;
-               if (try_layout) {
-                       child_bits |= MDS_INODELOCK_LAYOUT;
+               if (try_bits != 0) {
                        /* try layout lock, it may fail to be granted due to
                         * contention at LOOKUP or UPDATE */
-                       if (!mdt_object_lock_try(info, child, lhc,
-                                                child_bits)) {
-                               child_bits &= ~MDS_INODELOCK_LAYOUT;
-                               LASSERT(child_bits != 0);
-                               rc = mdt_object_lock(info, child, lhc,
-                                                    child_bits);
-                       } else {
+                       rc = mdt_object_lock_try(info, child, lhc, &child_bits,
+                                                try_bits, false);
+                       if (child_bits & MDS_INODELOCK_LAYOUT)
                                ma_need |= MA_LOV;
-                       }
                } else {
                        /* Do not enqueue the UPDATE lock from MDT(cross-MDT),
                         * client will enqueue the lock to the remote MDT */
@@ -2606,10 +2599,10 @@ int mdt_check_resent_lock(struct mdt_thread_info *info,
        return 1;
 }
 
-int mdt_remote_object_lock(struct mdt_thread_info *mti, struct mdt_object *o,
-                          const struct lu_fid *fid, struct lustre_handle *lh,
-                          enum ldlm_mode mode, __u64 ibits, bool nonblock,
-                          bool cache)
+int mdt_remote_object_lock_try(struct mdt_thread_info *mti,
+                              struct mdt_object *o, const struct lu_fid *fid,
+                              struct lustre_handle *lh, enum ldlm_mode mode,
+                              __u64 *ibits, __u64 trybits, bool cache)
 {
        struct ldlm_enqueue_info *einfo = &mti->mti_einfo;
        union ldlm_policy_data *policy = &mti->mti_policy;
@@ -2628,8 +2621,7 @@ int mdt_remote_object_lock(struct mdt_thread_info *mti, struct mdt_object *o,
        einfo->ei_cb_cp = ldlm_completion_ast;
        einfo->ei_enq_slave = 0;
        einfo->ei_res_id = res_id;
-       if (nonblock)
-               einfo->ei_nonblock = 1;
+
        if (cache) {
                /*
                 * if we cache lock, couple lock with mdt_object, so that object
@@ -2639,8 +2631,10 @@ int mdt_remote_object_lock(struct mdt_thread_info *mti, struct mdt_object *o,
                einfo->ei_cbdata = o;
        }
 
+
        memset(policy, 0, sizeof(*policy));
-       policy->l_inodebits.bits = ibits;
+       policy->l_inodebits.bits = *ibits;
+       policy->l_inodebits.try_bits = trybits;
 
        rc = mo_object_lock(mti->mti_env, mdt_object_child(o), lh, einfo,
                            policy);
@@ -2648,13 +2642,30 @@ int mdt_remote_object_lock(struct mdt_thread_info *mti, struct mdt_object *o,
                mdt_object_put(mti->mti_env, o);
                einfo->ei_cbdata = NULL;
        }
+
+       /* Return successfully acquired bits to a caller */
+       if (rc == 0) {
+               struct ldlm_lock *lock = ldlm_handle2lock(lh);
+
+               LASSERT(lock);
+               *ibits = lock->l_policy_data.l_inodebits.bits;
+               LDLM_LOCK_PUT(lock);
+       }
        RETURN(rc);
 }
 
+int mdt_remote_object_lock(struct mdt_thread_info *mti, struct mdt_object *o,
+                          const struct lu_fid *fid, struct lustre_handle *lh,
+                          enum ldlm_mode mode, __u64 ibits, bool cache)
+{
+       return mdt_remote_object_lock_try(mti, o, fid, lh, mode, &ibits, 0,
+                                         cache);
+}
+
 static int mdt_object_local_lock(struct mdt_thread_info *info,
                                 struct mdt_object *o,
-                                struct mdt_lock_handle *lh, __u64 ibits,
-                                bool nonblock, bool cos_incompat)
+                                struct mdt_lock_handle *lh, __u64 *ibits,
+                                __u64 trybits, bool cos_incompat)
 {
        struct ldlm_namespace *ns = info->mti_mdt->mdt_namespace;
        union ldlm_policy_data *policy = &info->mti_policy;
@@ -2677,8 +2688,9 @@ static int mdt_object_local_lock(struct mdt_thread_info *info,
        }
 
        /* Only enqueue LOOKUP lock for remote object */
-       if (mdt_object_remote(o))
-               LASSERT(ibits == MDS_INODELOCK_LOOKUP);
+       if (mdt_object_remote(o)) {
+               LASSERT(*ibits == MDS_INODELOCK_LOOKUP);
+       }
 
        if (lh->mlh_type == MDT_PDO_LOCK) {
                 /* check for exists after object is locked */
@@ -2689,30 +2701,28 @@ static int mdt_object_local_lock(struct mdt_thread_info *info,
                         /* Non-dir object shouldn't have PDO lock */
                        if (!S_ISDIR(lu_object_attr(&o->mot_obj)))
                                RETURN(-ENOTDIR);
-                }
-        }
+               }
+       }
 
-        memset(policy, 0, sizeof(*policy));
-        fid_build_reg_res_name(mdt_object_fid(o), res_id);
 
+       fid_build_reg_res_name(mdt_object_fid(o), res_id);
        dlmflags |= LDLM_FL_ATOMIC_CB;
-       if (nonblock)
-               dlmflags |= LDLM_FL_BLOCK_NOWAIT;
 
-        /*
-         * Take PDO lock on whole directory and build correct @res_id for lock
-         * on part of directory.
-         */
-        if (lh->mlh_pdo_hash != 0) {
-                LASSERT(lh->mlh_type == MDT_PDO_LOCK);
-                mdt_lock_pdo_mode(info, o, lh);
-                if (lh->mlh_pdo_mode != LCK_NL) {
-                        /*
-                         * Do not use LDLM_FL_LOCAL_ONLY for parallel lock, it
-                         * is never going to be sent to client and we do not
-                         * want it slowed down due to possible cancels.
-                         */
-                        policy->l_inodebits.bits = MDS_INODELOCK_UPDATE;
+       /*
+        * Take PDO lock on whole directory and build correct @res_id for lock
+        * on part of directory.
+        */
+       if (lh->mlh_pdo_hash != 0) {
+               LASSERT(lh->mlh_type == MDT_PDO_LOCK);
+               mdt_lock_pdo_mode(info, o, lh);
+               if (lh->mlh_pdo_mode != LCK_NL) {
+                       /*
+                        * Do not use LDLM_FL_LOCAL_ONLY for parallel lock, it
+                        * is never going to be sent to client and we do not
+                        * want it slowed down due to possible cancels.
+                        */
+                       policy->l_inodebits.bits = MDS_INODELOCK_UPDATE;
+                       policy->l_inodebits.try_bits = 0;
                        rc = mdt_fid_lock(ns, &lh->mlh_pdo_lh, lh->mlh_pdo_mode,
                                          policy, res_id, dlmflags,
                                          info->mti_exp == NULL ? NULL :
@@ -2728,7 +2738,8 @@ static int mdt_object_local_lock(struct mdt_thread_info *info,
                 res_id->name[LUSTRE_RES_ID_HSH_OFF] = lh->mlh_pdo_hash;
         }
 
-        policy->l_inodebits.bits = ibits;
+       policy->l_inodebits.bits = *ibits;
+       policy->l_inodebits.try_bits = trybits;
 
         /*
          * Use LDLM_FL_LOCAL_ONLY for this lock. We do not know yet if it is
@@ -2747,39 +2758,49 @@ out_unlock:
                   (lh->mlh_reg_mode == LCK_PW || lh->mlh_reg_mode == LCK_EX))
                OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_PDO_LOCK, 15);
 
+       /* Return successfully acquired bits to a caller */
+       if (rc == 0) {
+               struct ldlm_lock *lock = ldlm_handle2lock(&lh->mlh_reg_lh);
+
+               LASSERT(lock);
+               *ibits = lock->l_policy_data.l_inodebits.bits;
+               LDLM_LOCK_PUT(lock);
+       }
        RETURN(rc);
 }
 
 static int
 mdt_object_lock_internal(struct mdt_thread_info *info, struct mdt_object *o,
-                        struct mdt_lock_handle *lh, __u64 ibits, bool nonblock,
-                        bool cos_incompat)
+                        struct mdt_lock_handle *lh, __u64 *ibits,
+                        __u64 trybits, bool cos_incompat)
 {
        struct mdt_lock_handle *local_lh = NULL;
        int rc;
        ENTRY;
 
        if (!mdt_object_remote(o)) {
-               rc = mdt_object_local_lock(info, o, lh, ibits, nonblock,
+               rc = mdt_object_local_lock(info, o, lh, ibits, trybits,
                                           cos_incompat);
                RETURN(rc);
        }
 
        /* XXX do not support PERM/LAYOUT/XATTR lock for remote object yet */
-       ibits &= ~(MDS_INODELOCK_PERM | MDS_INODELOCK_LAYOUT |
-                  MDS_INODELOCK_XATTR);
+       *ibits &= ~(MDS_INODELOCK_PERM | MDS_INODELOCK_LAYOUT |
+                   MDS_INODELOCK_XATTR);
 
        /* Only enqueue LOOKUP lock for remote object */
-       if (ibits & MDS_INODELOCK_LOOKUP) {
-               rc = mdt_object_local_lock(info, o, lh, MDS_INODELOCK_LOOKUP,
-                                          nonblock, cos_incompat);
+       if (*ibits & MDS_INODELOCK_LOOKUP) {
+               __u64 local = MDS_INODELOCK_LOOKUP;
+
+               rc = mdt_object_local_lock(info, o, lh, &local, 0,
+                                          cos_incompat);
                if (rc != ELDLM_OK)
                        RETURN(rc);
 
                local_lh = lh;
        }
 
-       if (ibits & MDS_INODELOCK_UPDATE) {
+       if ((*ibits | trybits) & MDS_INODELOCK_UPDATE) {
                /* Sigh, PDO needs to enqueue 2 locks right now, but
                 * enqueue RPC can only request 1 lock, to avoid extra
                 * RPC, so it will instead enqueue EX lock for remote
@@ -2793,11 +2814,11 @@ mdt_object_lock_internal(struct mdt_thread_info *info, struct mdt_object *o,
                        lh->mlh_rreg_mode = LCK_EX;
                        lh->mlh_type = MDT_REG_LOCK;
                }
-               rc = mdt_remote_object_lock(info, o, mdt_object_fid(o),
-                                           &lh->mlh_rreg_lh,
-                                           lh->mlh_rreg_mode,
-                                           MDS_INODELOCK_UPDATE, nonblock,
-                                           false);
+
+               rc = mdt_remote_object_lock_try(info, o, mdt_object_fid(o),
+                                               &lh->mlh_rreg_lh,
+                                               lh->mlh_rreg_mode,
+                                               ibits, trybits, false);
                if (rc != ELDLM_OK) {
                        if (local_lh != NULL)
                                mdt_object_unlock(info, o, local_lh, rc);
@@ -2811,7 +2832,7 @@ mdt_object_lock_internal(struct mdt_thread_info *info, struct mdt_object *o,
 int mdt_object_lock(struct mdt_thread_info *info, struct mdt_object *o,
                    struct mdt_lock_handle *lh, __u64 ibits)
 {
-       return mdt_object_lock_internal(info, o, lh, ibits, false, false);
+       return mdt_object_lock_internal(info, o, lh, &ibits, 0, false);
 }
 
 int mdt_reint_object_lock(struct mdt_thread_info *info, struct mdt_object *o,
@@ -2819,36 +2840,16 @@ int mdt_reint_object_lock(struct mdt_thread_info *info, struct mdt_object *o,
                          bool cos_incompat)
 {
        LASSERT(lh->mlh_reg_mode == LCK_PW || lh->mlh_reg_mode == LCK_EX);
-       return mdt_object_lock_internal(info, o, lh, ibits, false,
+       return mdt_object_lock_internal(info, o, lh, &ibits, 0,
                                        cos_incompat);
 }
 
 int mdt_object_lock_try(struct mdt_thread_info *info, struct mdt_object *o,
-                       struct mdt_lock_handle *lh, __u64 ibits)
+                       struct mdt_lock_handle *lh, __u64 *ibits,
+                       __u64 trybits, bool cos_incompat)
 {
-       struct mdt_lock_handle tmp = *lh;
-       int rc;
-
-       rc = mdt_object_lock_internal(info, o, &tmp, ibits, true, false);
-       if (rc == 0)
-               *lh = tmp;
-
-       return rc == 0;
-}
-
-int mdt_reint_object_lock_try(struct mdt_thread_info *info,
-                             struct mdt_object *o, struct mdt_lock_handle *lh,
-                             __u64 ibits, bool cos_incompat)
-{
-       struct mdt_lock_handle tmp = *lh;
-       int rc;
-
-       LASSERT(lh->mlh_reg_mode == LCK_PW || lh->mlh_reg_mode == LCK_EX);
-       rc = mdt_object_lock_internal(info, o, &tmp, ibits, true, cos_incompat);
-       if (rc == 0)
-               *lh = tmp;
-
-       return rc == 0;
+       return mdt_object_lock_internal(info, o, lh, ibits, trybits,
+                                       cos_incompat);
 }
 
 /**
index 30b5ae1..86a87b2 100644 (file)
@@ -634,11 +634,8 @@ int mdt_reint_object_lock(struct mdt_thread_info *info, struct mdt_object *o,
                          bool cos_incompat);
 
 int mdt_object_lock_try(struct mdt_thread_info *info, struct mdt_object *mo,
-                       struct mdt_lock_handle *lh, __u64 ibits);
-
-int mdt_reint_object_lock_try(struct mdt_thread_info *info,
-                             struct mdt_object *o, struct mdt_lock_handle *lh,
-                             __u64 ibits, bool cos_incompat);
+                       struct mdt_lock_handle *lh, __u64 *ibits,
+                       __u64 trybits, bool cos_incompat);
 
 void mdt_object_unlock(struct mdt_thread_info *info, struct mdt_object *mo,
                       struct mdt_lock_handle *lh, int decref);
@@ -663,8 +660,7 @@ void mdt_client_compatibility(struct mdt_thread_info *info);
 int mdt_remote_object_lock(struct mdt_thread_info *mti,
                           struct mdt_object *o, const struct lu_fid *fid,
                           struct lustre_handle *lh,
-                          enum ldlm_mode mode, __u64 ibits, bool nonblock,
-                          bool cache);
+                          enum ldlm_mode mode, __u64 ibits, bool cache);
 
 enum mdt_name_flags {
        MNF_FIX_ANON = 1,
index 9469b97..1fc0938 100644 (file)
@@ -863,12 +863,9 @@ static int mdt_object_open_lock(struct mdt_thread_info *info,
                 * lock for each open.
                 * However this is a double-edged sword because changing
                 * permission will revoke huge # of LOOKUP locks. */
-               *ibits |= MDS_INODELOCK_LAYOUT | MDS_INODELOCK_LOOKUP;
-               if (!mdt_object_lock_try(info, obj, lhc, *ibits)) {
-                       *ibits &= ~(MDS_INODELOCK_LAYOUT|MDS_INODELOCK_LOOKUP);
-                       if (*ibits != 0)
-                               rc = mdt_object_lock(info, obj, lhc, *ibits);
-               }
+               rc = mdt_object_lock_try(info, obj, lhc, ibits,
+                                        MDS_INODELOCK_LAYOUT |
+                                        MDS_INODELOCK_LOOKUP, false);
        } else if (*ibits != 0) {
                rc = mdt_object_lock(info, obj, lhc, *ibits);
        }
@@ -1215,7 +1212,7 @@ static int mdt_lock_root_xattr(struct mdt_thread_info *info,
 
        rc = mdt_remote_object_lock(info, md_root, mdt_object_fid(md_root),
                                    &lhroot, LCK_PR, MDS_INODELOCK_XATTR,
-                                   false, true);
+                                   true);
        if (rc < 0)
                return rc;
 
index 5184c0d..a252b5f 100644 (file)
@@ -1007,7 +1007,7 @@ relock:
                rc = mdt_remote_object_lock(info, mp, mdt_object_fid(mc),
                                            &child_lh->mlh_rreg_lh,
                                            child_lh->mlh_rreg_mode,
-                                           MDS_INODELOCK_LOOKUP, false, false);
+                                           MDS_INODELOCK_LOOKUP, false);
                if (rc != ELDLM_OK)
                        GOTO(put_child, rc);
 
@@ -1261,7 +1261,7 @@ static int mdt_rename_lock(struct mdt_thread_info *info,
                rc = mdt_remote_object_lock(info, obj,
                                            &LUSTRE_BFL_FID, lh,
                                            LCK_EX,
-                                           MDS_INODELOCK_UPDATE, false, false);
+                                           MDS_INODELOCK_UPDATE, false);
                mdt_object_put(info->mti_env, obj);
        } else {
                struct ldlm_namespace *ns = info->mti_mdt->mdt_namespace;
@@ -1391,6 +1391,7 @@ again:
                struct mdt_lock_list *mll;
                struct lu_name name;
                struct lu_fid  fid;
+               __u64 ibits;
 
                linkea_entry_unpack(ldata.ld_lee, &ldata.ld_reclen,
                                    &name, &fid);
@@ -1435,9 +1436,10 @@ again:
                 * cannot be gotten because of conflicting locks, then drop all
                 * current locks, send an AST to the client, and start again. */
                mdt_lock_pdo_init(&mll->mll_lh, LCK_PW, &name);
-               rc = mdt_reint_object_lock_try(info, mdt_pobj, &mll->mll_lh,
-                                               MDS_INODELOCK_UPDATE, true);
-               if (rc == 0) {
+               ibits = 0;
+               rc = mdt_object_lock_try(info, mdt_pobj, &mll->mll_lh, &ibits,
+                                        MDS_INODELOCK_UPDATE, true);
+               if (!(ibits & MDS_INODELOCK_UPDATE)) {
                        mdt_unlock_list(info, lock_list, rc);
 
                        CDEBUG(D_INFO, "%s: busy lock on "DFID" %s retry %d\n",
@@ -1640,7 +1642,7 @@ out_lease:
                rc = mdt_remote_object_lock(info, msrcdir, mdt_object_fid(mold),
                                            &lh_childp->mlh_rreg_lh,
                                            lh_childp->mlh_rreg_mode,
-                                           MDS_INODELOCK_LOOKUP, false, false);
+                                           MDS_INODELOCK_LOOKUP, false);
                if (rc != ELDLM_OK)
                        GOTO(out_unlock_list, rc);
 
@@ -1708,7 +1710,7 @@ out_lease:
                                            mdt_object_fid(mnew),
                                            &lh_tgtp->mlh_rreg_lh,
                                            lh_tgtp->mlh_rreg_mode,
-                                           MDS_INODELOCK_UPDATE, false, false);
+                                           MDS_INODELOCK_UPDATE, false);
                if (rc != 0) {
                        lh_tgtp = NULL;
                        GOTO(out_put_new, rc);
@@ -2020,7 +2022,7 @@ relock:
                                                    &lh_oldp->mlh_rreg_lh,
                                                    lh_oldp->mlh_rreg_mode,
                                                    MDS_INODELOCK_LOOKUP,
-                                                   false, false);
+                                                   false);
                        if (rc != ELDLM_OK)
                                GOTO(out_put_new, rc);
 
@@ -2069,7 +2071,7 @@ relock:
                                                    &lh_oldp->mlh_rreg_lh,
                                                    lh_oldp->mlh_rreg_mode,
                                                    MDS_INODELOCK_LOOKUP,
-                                                   false, false);
+                                                   false);
                        if (rc != ELDLM_OK)
                                GOTO(out_put_old, rc);
 
index fb77b3b..90ee189 100644 (file)
@@ -872,8 +872,6 @@ static int osp_md_object_lock(const struct lu_env *env,
        res_id = einfo->ei_res_id;
        LASSERT(res_id != NULL);
 
-       if (einfo->ei_nonblock)
-               flags |= LDLM_FL_BLOCK_NOWAIT;
        if (einfo->ei_mode & (LCK_EX | LCK_PW))
                flags |= LDLM_FL_COS_INCOMPAT;
 
index 3a9daf8..9a50231 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
index dcb8838..0a1fe03 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2016, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 #include <lustre_net.h>
 #include <lustre/lustre_lfsck_user.h>
 #include <lustre_disk.h>
+
 void lustre_assert_wire_constants(void)
 {
-        /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwiretest)
-         * running on Linux centss05 2.6.32.431.29.2.el6_lustre #1 SMP Tue Sep 23 16:06:38 CDT 2014 x
-         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
-
+       /* Wire protocol assertions generated by 'wirecheck'
+        * (make -C lustre/utils newwiretest)
+        */
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
@@ -656,6 +655,78 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n",
                 (long long)(int)sizeof(union lu_page));
 
+       /* Checks for struct lu_ladvise */
+       LASSERTF((int)sizeof(struct lu_ladvise) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct lu_ladvise));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_advice) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_advice));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_advice) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_advice));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value1) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value1));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value1) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value1));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value2) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value2));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value2));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_start) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_start));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_start) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_start));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_end) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_end));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_end) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_end));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value3) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value3));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value3));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value4) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value4));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value4) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value4));
+       LASSERTF(LU_LADVISE_WILLREAD == 1, "found %lld\n",
+                (long long)LU_LADVISE_WILLREAD);
+       LASSERTF(LU_LADVISE_DONTNEED == 2, "found %lld\n",
+                (long long)LU_LADVISE_DONTNEED);
+
+       /* Checks for struct ladvise_hdr */
+       LASSERTF((int)sizeof(struct ladvise_hdr) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct ladvise_hdr));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_magic) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_magic));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_magic) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_magic));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_count));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_count));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_flags) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_flags));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_flags) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_flags));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value1) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_value1));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value1) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value1));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value2) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_value2));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value2));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value3) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_value3));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value3) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value3));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_advise) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_advise));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_advise) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_advise));
+       LASSERTF(LF_ASYNC == 1, "found %lld\n",
+                (long long)LF_ASYNC);
+       LASSERTF(LADVISE_MAGIC == 450829536, "found %lld\n",
+                (long long)LADVISE_MAGIC);
+
        /* Checks for struct lustre_handle */
        LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
                 (long long)(int)sizeof(struct lustre_handle));
@@ -3164,12 +3235,16 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
 
        /* Checks for struct ldlm_inodebits */
-       LASSERTF((int)sizeof(struct ldlm_inodebits) == 8, "found %lld\n",
+       LASSERTF((int)sizeof(struct ldlm_inodebits) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct ldlm_inodebits));
        LASSERTF((int)offsetof(struct ldlm_inodebits, bits) == 0, "found %lld\n",
                 (long long)(int)offsetof(struct ldlm_inodebits, bits));
        LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->bits) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct ldlm_inodebits *)0)->bits));
+       LASSERTF((int)offsetof(struct ldlm_inodebits, try_bits) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct ldlm_inodebits, try_bits));
+       LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->try_bits) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct ldlm_inodebits *)0)->try_bits));
 
        /* Checks for struct ldlm_flock_wire */
        LASSERTF((int)sizeof(struct ldlm_flock_wire) == 32, "found %lld\n",
@@ -5225,76 +5300,5 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct llog_update_record, lur_update_rec));
        LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_update_rec) == 32, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_update_record *)0)->lur_update_rec));
-
-       /* Checks for struct lu_ladvise */
-       LASSERTF((int)sizeof(struct lu_ladvise) == 32, "found %lld\n",
-                (long long)(int)sizeof(struct lu_ladvise));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_advice) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_advice));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_advice) == 2, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_advice));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value1) == 2, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value1));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value1) == 2, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value1));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value2) == 4, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value2));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value2) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value2));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_start) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_start));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_start) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_start));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_end) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_end));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_end) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_end));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value3) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value3));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value3) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value3));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value4) == 28, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value4));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value4) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value4));
-       LASSERTF(LU_LADVISE_WILLREAD == 1, "found %lld\n",
-                (long long)LU_LADVISE_WILLREAD);
-       LASSERTF(LU_LADVISE_DONTNEED == 2, "found %lld\n",
-                (long long)LU_LADVISE_DONTNEED);
-
-       /* Checks for struct ladvise_hdr */
-       LASSERTF(LADVISE_MAGIC == 0x1ADF1CE0, "found 0x%.8x\n",
-                LADVISE_MAGIC);
-       LASSERTF((int)sizeof(struct ladvise_hdr) == 32, "found %lld\n",
-                (long long)(int)sizeof(struct ladvise_hdr));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_magic) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_magic));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_magic) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_magic));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_count) == 4, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_count));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_count) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_count));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_flags) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_flags));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_flags) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_flags));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value1) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_value1));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value1) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value1));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value2) == 20, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_value2));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value2) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value2));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value3) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_value3));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value3) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value3));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_advise) == 32, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_advise));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_advise) == 0, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_advise));
-       LASSERTF(LF_ASYNC == 0x00000001UL, "found 0x%.8xUL\n",
-               (unsigned)LF_ASYNC);
 }
+
index 5ceaaf1..9cd2b1c 100644 (file)
@@ -343,10 +343,13 @@ static int tgt_request_preprocess(struct tgt_session_info *tsi,
 
                dlm_req = req_capsule_client_get(pill, &RMF_DLM_REQ);
                if (dlm_req != NULL) {
+                       union ldlm_wire_policy_data *policy =
+                                       &dlm_req->lock_desc.l_policy_data;
+
                        if (unlikely(dlm_req->lock_desc.l_resource.lr_type ==
                                     LDLM_IBITS &&
-                                    dlm_req->lock_desc.l_policy_data.\
-                                    l_inodebits.bits == 0)) {
+                                    (policy->l_inodebits.bits |
+                                     policy->l_inodebits.try_bits) == 0)) {
                                /*
                                 * Lock without inodebits makes no sense and
                                 * will oops later in ldlm. If client miss to
index bc5d89e..91afaee 100644 (file)
@@ -1374,6 +1374,7 @@ check_ldlm_inodebits(void)
        BLANK_LINE();
        CHECK_STRUCT(ldlm_inodebits);
        CHECK_MEMBER(ldlm_inodebits, bits);
+       CHECK_MEMBER(ldlm_inodebits, try_bits);
 }
 
 static void
@@ -2450,74 +2451,18 @@ static void check_llog_update_record(void)
        CHECK_MEMBER(llog_update_record, lur_update_rec);
 }
 
-static 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)
 {
-       char unameinfo[80];
-       char gccinfo[80];
-
-       system_string("uname -a", unameinfo, sizeof(unameinfo));
-       system_string(CC " -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo));
+       BLANK_LINE();
 
        printf ("void lustre_assert_wire_constants(void)\n"
                "{\n"
-               "        /* Wire protocol assertions generated by 'wirecheck'\n"
-               "         * (make -C lustre/utils newwiretest)\n"
-               "         * running on %s\n"
-               "         * with %s */\n"
-               "\n", unameinfo, gccinfo);
+               "       /* Wire protocol assertions generated by 'wirecheck'\n"
+               "        * (make -C lustre/utils newwiretest)\n"
+               "        */\n");
 
-       BLANK_LINE ();
+       BLANK_LINE();
 
        COMMENT("Constants...");
        CHECK_VALUE(PTL_RPC_MSG_REQUEST);
index 30156cf..50d79c5 100644 (file)
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
+#include <errno.h>
+#include <limits.h>
 #include <stdio.h>
+#include <string.h>
+
 #include <lustre/lustre_idl.h>
 #include <lustre/lustre_lfsck_user.h>
 #include <linux/lustre_disk.h>
 
-#undef LASSERT
-#undef LASSERTF
 #define LASSERT(cond) if (!(cond)) { printf("failed " #cond "\n"); ret = 1; }
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
+/*
+ * Compile-time LASSERT, which verifies correctness at compile-time rather
+ * than runtime. If "cond" is true, then there are two different cases
+ * ("(non-zero)" and "0"). If "cond" is false, then there are two identical cases
+ * ("0" and "0"), which is an error that causes the compiler to complain.
+ */
+#define CLASSERT(cond) do {switch (1) {case (cond): case 0: break; } } while (0)
 
 int ret;
 
index 46d28ed..e13c636 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2016, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -44,8 +44,8 @@
 /*
  * Compile-time LASSERT, which verifies correctness at compile-time rather
  * than runtime. If "cond" is true, then there are two different cases
- * ("(non-zero)" and "0"). If "cond" is false, then there are two identical cases
- * ("0" and "0"), which is an error that causes the compiler to complain.
+ * ("(non-zero)" and "0"). If "cond" is false, then there are two identical
+ * cases ("0" and "0"), which is an error that causes the compiler to complain.
  */
 #define CLASSERT(cond) do {switch (1) {case (cond): case 0: break; } } while (0)
 
@@ -62,13 +62,12 @@ int main()
 
         return ret;
 }
+
 void lustre_assert_wire_constants(void)
 {
-        /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwiretest)
-         * running on Linux centss05 2.6.32.431.29.2.el6_lustre #1 SMP Tue Sep 23 16:06:38 CDT 2014 x
-         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
-
+       /* Wire protocol assertions generated by 'wirecheck'
+        * (make -C lustre/utils newwiretest)
+        */
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
@@ -675,6 +674,78 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n",
                 (long long)(int)sizeof(union lu_page));
 
+       /* Checks for struct lu_ladvise */
+       LASSERTF((int)sizeof(struct lu_ladvise) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct lu_ladvise));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_advice) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_advice));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_advice) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_advice));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value1) == 2, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value1));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value1) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value1));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value2) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value2));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value2));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_start) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_start));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_start) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_start));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_end) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_end));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_end) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_end));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value3) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value3));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value3) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value3));
+       LASSERTF((int)offsetof(struct lu_ladvise, lla_value4) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct lu_ladvise, lla_value4));
+       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value4) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value4));
+       LASSERTF(LU_LADVISE_WILLREAD == 1, "found %lld\n",
+                (long long)LU_LADVISE_WILLREAD);
+       LASSERTF(LU_LADVISE_DONTNEED == 2, "found %lld\n",
+                (long long)LU_LADVISE_DONTNEED);
+
+       /* Checks for struct ladvise_hdr */
+       LASSERTF((int)sizeof(struct ladvise_hdr) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct ladvise_hdr));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_magic) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_magic));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_magic) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_magic));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_count));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_count));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_flags) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_flags));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_flags) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_flags));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value1) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_value1));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value1) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value1));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value2) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_value2));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value2));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value3) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_value3));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value3) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value3));
+       LASSERTF((int)offsetof(struct ladvise_hdr, lah_advise) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct ladvise_hdr, lah_advise));
+       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_advise) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_advise));
+       LASSERTF(LF_ASYNC == 1, "found %lld\n",
+                (long long)LF_ASYNC);
+       LASSERTF(LADVISE_MAGIC == 450829536, "found %lld\n",
+                (long long)LADVISE_MAGIC);
+
        /* Checks for struct lustre_handle */
        LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
                 (long long)(int)sizeof(struct lustre_handle));
@@ -3182,12 +3253,16 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
 
        /* Checks for struct ldlm_inodebits */
-       LASSERTF((int)sizeof(struct ldlm_inodebits) == 8, "found %lld\n",
+       LASSERTF((int)sizeof(struct ldlm_inodebits) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct ldlm_inodebits));
        LASSERTF((int)offsetof(struct ldlm_inodebits, bits) == 0, "found %lld\n",
                 (long long)(int)offsetof(struct ldlm_inodebits, bits));
        LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->bits) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct ldlm_inodebits *)0)->bits));
+       LASSERTF((int)offsetof(struct ldlm_inodebits, try_bits) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct ldlm_inodebits, try_bits));
+       LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->try_bits) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct ldlm_inodebits *)0)->try_bits));
 
        /* Checks for struct ldlm_flock_wire */
        LASSERTF((int)sizeof(struct ldlm_flock_wire) == 32, "found %lld\n",
@@ -5241,76 +5316,5 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct llog_update_record, lur_update_rec));
        LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_update_rec) == 32, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_update_record *)0)->lur_update_rec));
-
-       /* Checks for struct lu_ladvise */
-       LASSERTF((int)sizeof(struct lu_ladvise) == 32, "found %lld\n",
-                (long long)(int)sizeof(struct lu_ladvise));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_advice) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_advice));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_advice) == 2, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_advice));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value1) == 2, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value1));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value1) == 2, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value1));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value2) == 4, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value2));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value2) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value2));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_start) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_start));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_start) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_start));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_end) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_end));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_end) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_end));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value3) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value3));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value3) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value3));
-       LASSERTF((int)offsetof(struct lu_ladvise, lla_value4) == 28, "found %lld\n",
-                (long long)(int)offsetof(struct lu_ladvise, lla_value4));
-       LASSERTF((int)sizeof(((struct lu_ladvise *)0)->lla_value4) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lu_ladvise *)0)->lla_value4));
-       LASSERTF(LU_LADVISE_WILLREAD == 1, "found %lld\n",
-                (long long)LU_LADVISE_WILLREAD);
-       LASSERTF(LU_LADVISE_DONTNEED == 2, "found %lld\n",
-                (long long)LU_LADVISE_DONTNEED);
-
-       /* Checks for struct ladvise_hdr */
-       LASSERTF(LADVISE_MAGIC == 0x1ADF1CE0, "found 0x%.8x\n",
-                LADVISE_MAGIC);
-       LASSERTF((int)sizeof(struct ladvise_hdr) == 32, "found %lld\n",
-                (long long)(int)sizeof(struct ladvise_hdr));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_magic) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_magic));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_magic) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_magic));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_count) == 4, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_count));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_count) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_count));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_flags) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_flags));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_flags) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_flags));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value1) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_value1));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value1) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value1));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value2) == 20, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_value2));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value2) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value2));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_value3) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_value3));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_value3) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_value3));
-       LASSERTF((int)offsetof(struct ladvise_hdr, lah_advise) == 32, "found %lld\n",
-                (long long)(int)offsetof(struct ladvise_hdr, lah_advise));
-       LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_advise) == 0, "found %lld\n",
-                (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_advise));
-       LASSERTF(LF_ASYNC == 0x00000001UL, "found 0x%.8xUL\n",
-               (unsigned)LF_ASYNC);
 }
+