All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Anna.Schumaker@Netapp.com>
To: <linux-nfs@vger.kernel.org>
Subject: [PATCH v2 04/10] NFS: Return errors directly in _nfs4_opendata_reclaim_to_nfs4_state()
Date: Tue, 17 Jan 2017 15:31:59 -0500	[thread overview]
Message-ID: <20170117203205.29033-5-Anna.Schumaker@Netapp.com> (raw)
In-Reply-To: <20170117203205.29033-1-Anna.Schumaker@Netapp.com>

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

There is no need for a goto just to return an error code without any
cleanup.  Returning the error directly helps to clean up the code.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 fs/nfs/nfs4proc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 950e9cd15e5d..83d31c93065e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1638,17 +1638,15 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
 	int ret;
 
 	if (!data->rpc_done) {
-		if (data->rpc_status) {
-			ret = data->rpc_status;
-			goto err;
-		}
+		if (data->rpc_status)
+			return ERR_PTR(data->rpc_status);
 		/* cached opens have already been processed */
 		goto update;
 	}
 
 	ret = nfs_refresh_inode(inode, &data->f_attr);
 	if (ret)
-		goto err;
+		return ERR_PTR(ret);
 
 	if (data->o_res.delegation_type != 0)
 		nfs4_opendata_check_deleg(data, state);
@@ -1658,9 +1656,6 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
 	atomic_inc(&state->count);
 
 	return state;
-err:
-	return ERR_PTR(ret);
-
 }
 
 static struct nfs4_state *
-- 
2.11.0


  parent reply	other threads:[~2017-01-17 20:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 20:31 [PATCH v2 00/10] Various cleanups to nfs4proc.c Anna.Schumaker
2017-01-17 20:31 ` [PATCH v2 01/10] NFS: Fix inconsistent indentation in nfs4proc.c Anna.Schumaker
2017-01-17 20:31 ` [PATCH v2 02/10] NFS: Clean up _nfs4_is_integrity_protected() Anna.Schumaker
2017-01-17 20:31 ` [PATCH v2 03/10] NFS: Remove nfs4_wait_for_completion_rpc_task() Anna.Schumaker
2017-01-17 20:31 ` Anna.Schumaker [this message]
2017-01-17 20:32 ` [PATCH v2 05/10] NFS: Remove an extra if in _nfs4_recover_proc_open() Anna.Schumaker
2017-01-17 20:32 ` [PATCH v2 06/10] NFS: Remove nfs4_recover_expired_lease() Anna.Schumaker
2017-01-17 20:32 ` [PATCH v2 07/10] NFS: Remove unnecessary goto in nfs4_lookup_root_sec() Anna.Schumaker
2017-01-17 20:32 ` [PATCH v2 08/10] NFS: No need to set and return status in nfs41_lock_expired() Anna.Schumaker
2017-01-17 20:32 ` [PATCH v2 09/10] NFS: Clean up nfs41_same_server_scope() Anna.Schumaker
2017-01-17 20:32 ` [PATCH v2 10/10] NFS: Return the comparison result directly in nfs41_match_stateid() Anna.Schumaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170117203205.29033-5-Anna.Schumaker@Netapp.com \
    --to=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.