Commit 89180ca7 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman
Browse files

staging: lustre: fid,fld: expand the GOTO macro

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/

)

// <smpl>
@@
identifier lbl;
identifier rc;
constant c;
@@

- GOTO(lbl,\(rc\|c\));
+ goto lbl;

@@
identifier lbl;
expression rc;
@@

- GOTO(lbl,rc);
+ rc;
+ goto lbl;
// </smpl>

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34e1f2bb
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ static int seq_client_rpc(struct lu_client_seq *seq,
	if (seq->lcs_type == LUSTRE_SEQ_METADATA)
		mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
	if (rc)
		GOTO(out_req, rc);
		goto out_req;

	out = req_capsule_server_get(&req->rq_pill, &RMF_SEQ_RANGE);
	*output = *out;
@@ -121,13 +121,15 @@ static int seq_client_rpc(struct lu_client_seq *seq,
	if (!range_is_sane(output)) {
		CERROR("%s: Invalid range received from server: "
		       DRANGE"\n", seq->lcs_name, PRANGE(output));
		GOTO(out_req, rc = -EINVAL);
		rc = -EINVAL;
		goto out_req;
	}

	if (range_is_exhausted(output)) {
		CERROR("%s: Range received from server is exhausted: "
		       DRANGE"]\n", seq->lcs_name, PRANGE(output));
		GOTO(out_req, rc = -EINVAL);
		rc = -EINVAL;
		goto out_req;
	}

	CDEBUG_LIMIT(debug_mask, "%s: Allocated %s-sequence "DRANGE"]\n",
@@ -430,7 +432,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
	if (rc) {
		CERROR("%s: Can't init sequence manager proc, rc %d\n",
		       seq->lcs_name, rc);
		GOTO(out_cleanup, rc);
		goto out_cleanup;
	}

	return 0;
@@ -508,8 +510,10 @@ int client_fid_init(struct obd_device *obd,
		return -ENOMEM;

	OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
	if (prefix == NULL)
		GOTO(out_free_seq, rc = -ENOMEM);
	if (prefix == NULL) {
		rc = -ENOMEM;
		goto out_free_seq;
	}

	snprintf(prefix, MAX_OBD_NAME + 5, "cli-%s", obd->obd_name);

@@ -517,7 +521,7 @@ int client_fid_init(struct obd_device *obd,
	rc = seq_client_init(cli->cl_seq, exp, type, prefix, NULL);
	OBD_FREE(prefix, MAX_OBD_NAME + 5);
	if (rc)
		GOTO(out_free_seq, rc);
		goto out_free_seq;

	return rc;
out_free_seq:
+8 −6
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
	if (rc) {
		CERROR("%s: Can't init FLD proc, rc %d\n",
		       fld->lcf_name, rc);
		GOTO(out_cleanup, rc);
		goto out_cleanup;
	}

	return 0;
@@ -363,12 +363,12 @@ int fld_client_init(struct lu_client_fld *fld,
	if (IS_ERR(fld->lcf_cache)) {
		rc = PTR_ERR(fld->lcf_cache);
		fld->lcf_cache = NULL;
		GOTO(out, rc);
		goto out;
	}

	rc = fld_client_proc_init(fld);
	if (rc)
		GOTO(out, rc);
		goto out;
out:
	if (rc)
		fld_client_fini(fld);
@@ -441,11 +441,13 @@ int fld_client_rpc(struct obd_export *exp,
	if (fld_op != FLD_LOOKUP)
		mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
	if (rc)
		GOTO(out_req, rc);
		goto out_req;

	prange = req_capsule_server_get(&req->rq_pill, &RMF_FLD_MDFLD);
	if (prange == NULL)
		GOTO(out_req, rc = -EFAULT);
	if (prange == NULL) {
		rc = -EFAULT;
		goto out_req;
	}
	*range = *prange;
out_req:
	ptlrpc_req_finished(req);