Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 2014 01:08:43 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r269170 - stable/10/sys/fs/tmpfs
Message-ID:  <201407280108.s6S18hTp010824@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Jul 28 01:08:43 2014
New Revision: 269170
URL: http://svnweb.freebsd.org/changeset/base/269170

Log:
  MFC r268611:
  Replace goto's with the return.

Modified:
  stable/10/sys/fs/tmpfs/tmpfs_subr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- stable/10/sys/fs/tmpfs/tmpfs_subr.c	Mon Jul 28 01:06:36 2014	(r269169)
+++ stable/10/sys/fs/tmpfs/tmpfs_subr.c	Mon Jul 28 01:08:43 2014	(r269170)
@@ -677,8 +677,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru
 		 * imposed by the system. */
 		MPASS(dnode->tn_links <= LINK_MAX);
 		if (dnode->tn_links == LINK_MAX) {
-			error = EMLINK;
-			goto out;
+			return (EMLINK);
 		}
 
 		parent = dnode;
@@ -690,14 +689,14 @@ tmpfs_alloc_file(struct vnode *dvp, stru
 	error = tmpfs_alloc_node(tmp, vap->va_type, cnp->cn_cred->cr_uid,
 	    dnode->tn_gid, vap->va_mode, parent, target, vap->va_rdev, &node);
 	if (error != 0)
-		goto out;
+		return (error);
 
 	/* Allocate a directory entry that points to the new file. */
 	error = tmpfs_alloc_dirent(tmp, node, cnp->cn_nameptr, cnp->cn_namelen,
 	    &de);
 	if (error != 0) {
 		tmpfs_free_node(tmp, node);
-		goto out;
+		return (error);
 	}
 
 	/* Allocate a vnode for the new file. */
@@ -705,7 +704,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru
 	if (error != 0) {
 		tmpfs_free_dirent(tmp, de);
 		tmpfs_free_node(tmp, node);
-		goto out;
+		return (error);
 	}
 
 	/* Now that all required items are allocated, we can proceed to
@@ -714,10 +713,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru
 	if (cnp->cn_flags & ISWHITEOUT)
 		tmpfs_dir_whiteout_remove(dvp, cnp);
 	tmpfs_dir_attach(dvp, de);
-
-out:
-
-	return error;
+	return (0);
 }
 
 static struct tmpfs_dirent *



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407280108.s6S18hTp010824>