Whamcloud - gitweb
LU-6142 lustre: use BIT() macro where appropriate
[fs/lustre-release.git] / lustre / mdd / mdd_object.c
index d32da73..df5bea0 100644 (file)
@@ -1069,11 +1069,11 @@ static int mdd_attr_set_changelog(const struct lu_env *env,
        struct mdd_device *mdd = mdo2mdd(obj);
        int bits, type = 0;
 
-       bits =  (valid & LA_SIZE)  ? 1 << CL_TRUNC : 0;
-       bits |= (valid & ~(LA_CTIME|LA_MTIME|LA_ATIME)) ? 1 << CL_SETATTR : 0;
-       bits |= (valid & LA_MTIME) ? 1 << CL_MTIME : 0;
-       bits |= (valid & LA_CTIME) ? 1 << CL_CTIME : 0;
-       bits |= (valid & LA_ATIME) ? 1 << CL_ATIME : 0;
+       bits =  (valid & LA_SIZE)  ? BIT(CL_TRUNC) : 0;
+       bits |= (valid & ~(LA_CTIME|LA_MTIME|LA_ATIME)) ? BIT(CL_SETATTR) : 0;
+       bits |= (valid & LA_MTIME) ? BIT(CL_MTIME) : 0;
+       bits |= (valid & LA_CTIME) ? BIT(CL_CTIME) : 0;
+       bits |= (valid & LA_ATIME) ? BIT(CL_ATIME) : 0;
        bits = bits & mdd->mdd_cl.mc_mask;
        /* This is an implementation limit rather than a protocol limit */
        BUILD_BUG_ON(CL_LAST > sizeof(int) * 8);
@@ -3138,7 +3138,7 @@ static int mdd_open(const struct lu_env *env, struct md_object *obj,
 
        rc = mdd_open_sanity_check(env, mdd_obj, attr, open_flags,
                                   spec->no_create);
-       if ((rc == -EACCES) && (mdd->mdd_cl.mc_mask & (1 << CL_DN_OPEN)))
+       if ((rc == -EACCES) && (mdd->mdd_cl.mc_mask & BIT(CL_DN_OPEN)))
                type = CL_DN_OPEN;
        else if (rc != 0)
                GOTO(out, rc);
@@ -3376,10 +3376,10 @@ out:
         * this is not a big deal if we have a CL_CLOSE entry with no matching
         * CL_OPEN. Plus Changelogs mask may not change often.
         */
-       if (((!(mdd->mdd_cl.mc_mask & (1 << CL_OPEN)) &&
+       if (((!(mdd->mdd_cl.mc_mask & BIT(CL_OPEN)) &&
              (open_flags & (MDS_FMODE_WRITE | MDS_OPEN_APPEND |
                             MDS_OPEN_TRUNC))) ||
-            ((mdd->mdd_cl.mc_mask & (1 << CL_OPEN)) && last_close_by_uid)) &&
+            ((mdd->mdd_cl.mc_mask & BIT(CL_OPEN)) && last_close_by_uid)) &&
            !(ma->ma_valid & MA_FLAGS && ma->ma_attr_flags & MDS_RECOV_OPEN)) {
                if (handle == NULL) {
                        handle = mdd_trans_create(env, mdo2mdd(obj));