mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 11:44:01 +08:00
staging: lustre: remove unnecessary braces
This patch fixes checkpatch warnings: "WARNING: braces {} are not necessary for single statement blocks" and "WARNING: braces {} are not necessary for any arm of this statement". Signed-off-by: Thibaut Robert <thibaut.robert@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3f514c35c0
commit
b0aa688692
@ -363,17 +363,16 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
|
||||
*/
|
||||
cli->cl_chunkbits = PAGE_SHIFT;
|
||||
|
||||
if (!strcmp(name, LUSTRE_MDC_NAME)) {
|
||||
if (!strcmp(name, LUSTRE_MDC_NAME))
|
||||
cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_DEFAULT;
|
||||
} else if (totalram_pages >> (20 - PAGE_SHIFT) <= 128 /* MB */) {
|
||||
else if (totalram_pages >> (20 - PAGE_SHIFT) <= 128 /* MB */)
|
||||
cli->cl_max_rpcs_in_flight = 2;
|
||||
} else if (totalram_pages >> (20 - PAGE_SHIFT) <= 256 /* MB */) {
|
||||
else if (totalram_pages >> (20 - PAGE_SHIFT) <= 256 /* MB */)
|
||||
cli->cl_max_rpcs_in_flight = 3;
|
||||
} else if (totalram_pages >> (20 - PAGE_SHIFT) <= 512 /* MB */) {
|
||||
else if (totalram_pages >> (20 - PAGE_SHIFT) <= 512 /* MB */)
|
||||
cli->cl_max_rpcs_in_flight = 4;
|
||||
} else {
|
||||
else
|
||||
cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_DEFAULT;
|
||||
}
|
||||
|
||||
spin_lock_init(&cli->cl_mod_rpcs_lock);
|
||||
spin_lock_init(&cli->cl_mod_rpcs_hist.oh_lock);
|
||||
|
@ -2413,9 +2413,8 @@ static int lmv_read_page(struct obd_export *exp, struct md_op_data *op_data,
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (unlikely(lsm)) {
|
||||
if (unlikely(lsm))
|
||||
return lmv_read_striped_page(exp, op_data, cb_op, offset, ppage);
|
||||
}
|
||||
|
||||
tgt = lmv_find_target(lmv, &op_data->op_fid1);
|
||||
if (IS_ERR(tgt))
|
||||
@ -3107,9 +3106,8 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (oqctl->qc_cmd != Q_GETOQUOTA) {
|
||||
if (oqctl->qc_cmd != Q_GETOQUOTA)
|
||||
return obd_quotactl(tgt->ltd_exp, oqctl);
|
||||
}
|
||||
|
||||
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
|
||||
int err;
|
||||
|
@ -911,13 +911,13 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
|
||||
OBD_FAIL_TIMEOUT(OBD_FAIL_MDC_ENQUEUE_PAUSE, obd_timeout);
|
||||
}
|
||||
|
||||
if (it->it_op & IT_CREAT) {
|
||||
if (it->it_op & IT_CREAT)
|
||||
/* XXX this belongs in ll_create_it */
|
||||
} else if (it->it_op == IT_OPEN) {
|
||||
;
|
||||
else if (it->it_op == IT_OPEN)
|
||||
LASSERT(!it_disposition(it, DISP_OPEN_CREATE));
|
||||
} else {
|
||||
else
|
||||
LASSERT(it->it_op & (IT_GETATTR | IT_LOOKUP | IT_LAYOUT));
|
||||
}
|
||||
|
||||
/* If we already have a matching lock, then cancel the new
|
||||
* one. We have to set the data here instead of in
|
||||
|
@ -918,9 +918,8 @@ static unsigned long lu_htable_order(struct lu_device *top)
|
||||
cache_size = cache_size / 100 * lu_cache_percent *
|
||||
(PAGE_SIZE / 1024);
|
||||
|
||||
for (bits = 1; (1 << bits) < cache_size; ++bits) {
|
||||
for (bits = 1; (1 << bits) < cache_size; ++bits)
|
||||
;
|
||||
}
|
||||
return clamp_t(typeof(bits), bits, LU_SITE_BITS_MIN, bits_max);
|
||||
}
|
||||
|
||||
|
@ -1646,9 +1646,8 @@ static int echo_client_connect(const struct lu_env *env,
|
||||
struct lustre_handle conn = { 0 };
|
||||
|
||||
rc = class_connect(&conn, src, cluuid);
|
||||
if (rc == 0) {
|
||||
if (rc == 0)
|
||||
*exp = class_conn2export(&conn);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -1406,9 +1406,8 @@ static void osc_release_write_grant(struct client_obd *cli,
|
||||
struct brw_page *pga)
|
||||
{
|
||||
assert_spin_locked(&cli->cl_loi_list_lock);
|
||||
if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
|
||||
if (!(pga->flag & OBD_BRW_FROM_GRANT))
|
||||
return;
|
||||
}
|
||||
|
||||
pga->flag &= ~OBD_BRW_FROM_GRANT;
|
||||
atomic_long_dec(&obd_dirty_pages);
|
||||
|
@ -1182,17 +1182,15 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
|
||||
}
|
||||
|
||||
/* Sanity checks for a reconnected import. */
|
||||
if (!(imp->imp_replayable) != !(msg_flags & MSG_CONNECT_REPLAYABLE)) {
|
||||
if (!(imp->imp_replayable) != !(msg_flags & MSG_CONNECT_REPLAYABLE))
|
||||
CERROR("imp_replayable flag does not match server after reconnect. We should LBUG right here.\n");
|
||||
}
|
||||
|
||||
if (lustre_msg_get_last_committed(request->rq_repmsg) > 0 &&
|
||||
lustre_msg_get_last_committed(request->rq_repmsg) <
|
||||
aa->pcaa_peer_committed) {
|
||||
aa->pcaa_peer_committed)
|
||||
CERROR("%s went back in time (transno %lld was previously committed, server now claims %lld)! See https://bugzilla.lustre.org/show_bug.cgi?id=9646\n",
|
||||
obd2cli_tgt(imp->imp_obd), aa->pcaa_peer_committed,
|
||||
lustre_msg_get_last_committed(request->rq_repmsg));
|
||||
}
|
||||
|
||||
finish:
|
||||
ptlrpc_prepare_replay(imp);
|
||||
@ -1437,20 +1435,17 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
if (imp->imp_state == LUSTRE_IMP_REPLAY_LOCKS) {
|
||||
if (imp->imp_state == LUSTRE_IMP_REPLAY_LOCKS)
|
||||
if (atomic_read(&imp->imp_replay_inflight) == 0) {
|
||||
IMPORT_SET_STATE(imp, LUSTRE_IMP_REPLAY_WAIT);
|
||||
rc = signal_completed_replay(imp);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (imp->imp_state == LUSTRE_IMP_REPLAY_WAIT) {
|
||||
if (atomic_read(&imp->imp_replay_inflight) == 0) {
|
||||
if (imp->imp_state == LUSTRE_IMP_REPLAY_WAIT)
|
||||
if (atomic_read(&imp->imp_replay_inflight) == 0)
|
||||
IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER);
|
||||
}
|
||||
}
|
||||
|
||||
if (imp->imp_state == LUSTRE_IMP_RECOVER) {
|
||||
CDEBUG(D_HA, "reconnected to %s@%s\n",
|
||||
|
Loading…
Reference in New Issue
Block a user