Whamcloud - gitweb
LU-6245 libcfs: replace IS_PO2 with is_power_of_2 in server code
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index f0d7db7..7b90b58 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -109,7 +105,8 @@ enum cdt_states { CDT_STOPPED = 0,
  * cdt_request_lock
  */
 struct coordinator {
-       struct ptlrpc_thread     cdt_thread;         /**< coordinator thread */
+       wait_queue_head_t        cdt_waitq;          /**< cdt wait queue */
+       unsigned int             cdt_flags;          /**< cdt event flags */
        struct lu_env            cdt_env;            /**< coordinator lustre
                                                      * env */
        struct lu_context        cdt_session;        /** session for lu_ucred */
@@ -982,15 +979,17 @@ static inline bool mdt_slc_is_enabled(struct mdt_device *mdt)
 extern mdl_mode_t mdt_mdl_lock_modes[];
 extern enum ldlm_mode mdt_dlm_lock_modes[];
 
+/* LCK_MINMODE which is zero returns false for is_power_of_2 */
+
 static inline mdl_mode_t mdt_dlm_mode2mdl_mode(enum ldlm_mode mode)
 {
-       LASSERT(IS_PO2(mode));
+       LASSERT(mode == LCK_MINMODE || is_power_of_2(mode));
        return mdt_mdl_lock_modes[mode];
 }
 
 static inline enum ldlm_mode mdt_mdl_mode2dlm_mode(mdl_mode_t mode)
 {
-       LASSERT(IS_PO2(mode));
+       LASSERT(mode == MDL_MINMODE || is_power_of_2(mode));
        return mdt_dlm_lock_modes[mode];
 }