aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2014-07-14 09:02:40 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2014-07-14 09:02:40 +0000
commit7a41bc2f41d08744615460f6248c3f42b8adb8ca (patch)
tree0d8d3f0d704f2fe7b557c6885a2987f66816a287
parentd2ca06cdd2295c65d0ac0867ce3b041345085652 (diff)
downloadsrc-7a41bc2f41d08744615460f6248c3f42b8adb8ca.tar.gz
src-7a41bc2f41d08744615460f6248c3f42b8adb8ca.zip
In tmpfs_alloc_file(), code after the 'out' label does only 'return
error;'. Replace goto's with the return. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=268611
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 3b694fe6b96f..b7def68ea0bd 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -677,8 +677,7 @@ tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap,
* 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, struct vnode **vpp, struct vattr *vap,
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, struct vnode **vpp, struct vattr *vap,
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, struct vnode **vpp, struct vattr *vap,
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 *