dst->e_end = le64_to_cpu(src->e_end);
}
-/* Find minimum stripe maxbytes value. For inactive or
- * reconnecting targets use LUSTRE_EXT3_STRIPE_MAXBYTES. */
+/*
+ * Find minimum stripe maxbytes value. For inactive or
+ * reconnecting targets use LUSTRE_EXT3_STRIPE_MAXBYTES.
+ */
static loff_t lov_tgt_maxbytes(struct lov_tgt_desc *tgt)
{
struct obd_import *imp;
return maxbytes;
imp = tgt->ltd_obd->u.cli.cl_import;
- if (imp == NULL)
+ if (!imp)
return maxbytes;
spin_lock(&imp->imp_lock);
lsme_size = offsetof(typeof(*lsme), lsme_oinfo[stripe_count]);
OBD_ALLOC_LARGE(lsme, lsme_size);
- if (lsme == NULL)
+ if (!lsme)
RETURN(ERR_PTR(-ENOMEM));
lsme->lsme_magic = magic;
lsme->lsme_stripe_count = le16_to_cpu(lmm->lmm_stripe_count);
lsme->lsme_layout_gen = le16_to_cpu(lmm->lmm_layout_gen);
- if (pool_name != NULL) {
+ if (pool_name) {
size_t pool_name_len;
pool_name_len = strlcpy(lsme->lsme_pool_name, pool_name,
struct lov_tgt_desc *ltd;
OBD_SLAB_ALLOC_PTR_GFP(loi, lov_oinfo_slab, GFP_NOFS);
- if (loi == NULL)
+ if (!loi)
GOTO(out_lsme, rc = -ENOMEM);
lsme->lsme_oinfo[i] = loi;
}
ltd = lov->lov_tgts[loi->loi_ost_idx];
- if (ltd == NULL) {
+ if (!ltd) {
CERROR("%s: OST index %d missing\n",
(char*)lov->desc.ld_uuid.uuid, loi->loi_ost_idx);
lov_dump_lmm_v1(D_WARNING, lmm);
lov_bytes = min_stripe_maxbytes * stripe_count;
out_dom:
- if (maxbytes != NULL) {
+ if (maxbytes) {
if (lov_bytes < min_stripe_maxbytes) /* handle overflow */
*maxbytes = MAX_LFS_FILESIZE;
else
for (i = 0; i < stripe_count; i++) {
struct lov_oinfo *loi = lsme->lsme_oinfo[i];
- if (loi != NULL)
+ if (loi)
OBD_SLAB_FREE_PTR(lsme->lsme_oinfo[i], lov_oinfo_slab);
}
OBD_FREE_LARGE(lsme, lsme_size);
lsm_size = offsetof(typeof(*lsm), lsm_entries[1]);
OBD_ALLOC(lsm, lsm_size);
- if (lsm == NULL)
+ if (!lsm)
GOTO(out_lsme, rc = -ENOMEM);
atomic_set(&lsm->lsm_refc, 1);
lsm_size = offsetof(typeof(*lsm), lsm_entries[entry_count]);
OBD_ALLOC(lsm, lsm_size);
- if (lsm == NULL)
+ if (!lsm)
return ERR_PTR(-ENOMEM);
atomic_set(&lsm->lsm_refc, 1);
if (i == entry_count - 1) {
lsm->lsm_maxbytes = (loff_t)lsme->lsme_extent.e_start +
maxbytes;
- /* the last component hasn't been defined, or
- * lsm_maxbytes overflowed. */
+ /*
+ * the last component hasn't been defined, or
+ * lsm_maxbytes overflowed.
+ */
if (!lsme_is_dom(lsme) &&
(lsme->lsme_extent.e_end != LUSTRE_EOF ||
lsm->lsm_maxbytes <
out_lsm:
for (i = 0; i < entry_count; i++)
- if (lsm->lsm_entries[i] != NULL)
+ if (lsm->lsm_entries[i])
lsme_free(lsm->lsm_entries[i]);
OBD_FREE(lsm, lsm_size);