Possibly the most interesting is the for-loop with no body.
Rearranging and initializing end_dirent on each iteration of
the outer while, makes the intent clearer.
Reviewed-by: "Eremin, Dmitry" <dmitry.eremin@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (!(conn->ksnc_rx_to.type & ITER_BVEC) &&
conn->ksnc_proto != &ksocknal_protocol_v2x)
return rc;
-
+
/* accumulate checksum */
conn->ksnc_msg.ksm_csum = 0;
iov_iter_for_each_range(&conn->ksnc_rx_to, rc, lustre_csum, conn);
goto failed;
}
- if (!zalloc_cpumask_var(&mask, GFP_NOFS)){
+ if (!zalloc_cpumask_var(&mask, GFP_NOFS)) {
CERROR("Failed to allocate scratch cpumask\n");
goto failed;
}
void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj);
-#define OBT(dev) (dev)->obd_type
-#define OBP(dev, op) (dev)->obd_type->typ_dt_ops->op
-#define MDP(dev, op) (dev)->obd_type->typ_md_ops->op
-#define CTXTP(ctxt, op) (ctxt)->loc_logops->lop_##op
+#define OBT(dev) ((dev)->obd_type)
+#define OBP(dev, op) ((dev)->obd_type->typ_dt_ops->op)
+#define MDP(dev, op) ((dev)->obd_type->typ_md_ops->op)
+#define CTXTP(ctxt, op) ((ctxt)->loc_logops->lop_##op)
/*
* Ensure obd_setup: used for cleanup which must be called
#define POISON_PTR(ptr) ((void)0)
#else
#define POISON(ptr, c, s) memset(ptr, c, s)
-#define POISON_PTR(ptr) (ptr) = (void *)0xdeadbeef
+#define POISON_PTR(ptr) ((ptr) = (void *)0xdeadbeef)
#endif
#ifdef POISON_BULK
return 0;
/* ensure exclusion against parallel lookup of the same name */
- if (d_in_lookup((struct dentry*)dentry))
+ if (d_in_lookup((struct dentry *)dentry))
return 0;
if (d_lustre_invalid(dentry))
*/
while (cnt < 10 && !may_umount(sbi->ll_mnt.mnt)) {
schedule_timeout_uninterruptible(HZ);
- cnt ++;
+ cnt++;
}
schedule();
while (cnt < obd_timeout && !lov_check_set(lov, ost_idx)) {
schedule_timeout_uninterruptible(HZ);
- cnt ++;
+ cnt++;
}
if (tgt->ltd_active)
return 1;
__u64 hash_end = le64_to_cpu(dp->ldp_hash_end);
__u32 flags = le32_to_cpu(dp->ldp_flags);
struct lu_dirpage *first = dp;
- struct lu_dirent *end_dirent = NULL;
- struct lu_dirent *ent;
while (--lu_pgs > 0) {
- ent = lu_dirent_start(dp);
- for (end_dirent = ent; ent;
- end_dirent = ent, ent = lu_dirent_next(ent));
+ struct lu_dirent *end_dirent = NULL;
+ struct lu_dirent *ent;
+
+ for (ent = lu_dirent_start(dp); ent;
+ ent = lu_dirent_next(ent))
+ end_dirent = ent;
/* Advance dp to next lu_dirpage. */
dp = (struct lu_dirpage *)((char *)dp + LU_PAGE_SIZE);
EXPORT_SYMBOL(RQF_OST_GET_INFO_FIEMAP);
/* Convenience macro */
-#define FMT_FIELD(fmt, i, j) (fmt)->rf_fields[(i)].d[(j)]
+#define FMT_FIELD(fmt, i, j) ((fmt)->rf_fields[(i)].d[(j)])
/**
* Initializes the capsule abstraction by computing and setting the \a rf_idx
obd_timeout * HZ);
CDEBUG(D_HA, "%s: recovery finished\n",
obd2cli_tgt(imp->imp_obd));
- rc = rc? 0 : -ETIMEDOUT;
+ rc = rc ? 0 : -ETIMEDOUT;
}
out:
(rc = wait_event_idle_timeout(svcpt->scp_waitq,
svcpt->scp_nrqbds_posted == 0,
HZ)) == 0)
- cnt ++;
+ cnt++;
if (rc == 0) {
CWARN("Service %s waiting for request buffers\n",
svcpt->scp_service->srv_name);