@@ -157,7 +157,7 @@ void ldlm_extent_add_lock(struct ldlm_resource *res,
LASSERT(RB_EMPTY_NODE(&lock->l_rb));
idx = lock_mode_to_index(lock->l_granted_mode);
- LASSERT(lock->l_granted_mode == 1 << idx);
+ LASSERT(lock->l_granted_mode == BIT(idx));
LASSERT(lock->l_granted_mode == res->lr_itree[idx].lit_mode);
tree = &res->lr_itree[idx];
@@ -202,7 +202,7 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock)
return;
idx = lock_mode_to_index(lock->l_granted_mode);
- LASSERT(lock->l_granted_mode == 1 << idx);
+ LASSERT(lock->l_granted_mode == BIT(idx));
tree = &res->lr_itree[idx];
tree->lit_size--;
@@ -1023,7 +1023,7 @@ static struct ldlm_resource *ldlm_resource_new(enum ldlm_type ldlm_type)
/* Initialize interval trees for each lock mode. */
for (idx = 0; idx < LCK_MODE_NUM; idx++) {
res->lr_itree[idx].lit_size = 0;
- res->lr_itree[idx].lit_mode = 1 << idx;
+ res->lr_itree[idx].lit_mode = BIT(idx);
res->lr_itree[idx].lit_root = RB_ROOT_CACHED;
}
}
@@ -4410,7 +4410,7 @@ int ll_have_md_lock(struct inode *inode, u64 *bits,
flags = LDLM_FL_BLOCK_GRANTED | LDLM_FL_CBPENDING | LDLM_FL_TEST_LOCK;
for (i = 0; i < MDS_INODELOCK_NUMBITS && *bits != 0; i++) {
- policy.l_inodebits.bits = *bits & (1 << i);
+ policy.l_inodebits.bits = *bits & BIT(i);
if (policy.l_inodebits.bits == 0)
continue;
@@ -83,7 +83,7 @@
struct lovsub_object;
enum lov_device_flags {
- LOV_DEV_INITIALIZED = 1 << 0
+ LOV_DEV_INITIALIZED = BIT(0),
};
/*
@@ -398,9 +398,9 @@ static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
return 0;
for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
- if (((1 << i) & obd->u.cli.cl_supp_cksum_types) == 0)
+ if ((BIT(i) & obd->u.cli.cl_supp_cksum_types) == 0)
continue;
- if (obd->u.cli.cl_cksum_type == (1 << i))
+ if (obd->u.cli.cl_cksum_type == BIT(i))
seq_printf(m, "[%s] ", cksum_name[i]);
else
seq_printf(m, "%s ", cksum_name[i]);
@@ -817,17 +817,17 @@ enum rmf_flags {
/**
* The field is a string, must be NUL-terminated.
*/
- RMF_F_STRING = BIT(0),
+ RMF_F_STRING = BIT(0),
/**
* The field's buffer size need not match the declared @rmf_size.
*/
- RMF_F_NO_SIZE_CHECK = BIT(1),
+ RMF_F_NO_SIZE_CHECK = BIT(1),
/**
* The field's buffer size must be a whole multiple of the declared
* @rmf_size and the @rmf_swabber function must work on the declared
* @rmf_size worth of bytes.
*/
- RMF_F_STRUCT_ARRAY = BIT(2)
+ RMF_F_STRUCT_ARRAY = BIT(2),
};
struct req_capsule;