Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 2021 12:46:36 GMT
From:      Ka Ho Ng <khng@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2b567cd65f0d - stable/12 - tmpfs: Fix styles
Message-ID:  <202108271246.17RCkamW060020@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by khng:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b567cd65f0d8babef86f2cb89c81e3b1bc314aa

commit 2b567cd65f0d8babef86f2cb89c81e3b1bc314aa
Author:     Ka Ho Ng <khng@FreeBSD.org>
AuthorDate: 2021-08-24 13:09:21 +0000
Commit:     Ka Ho Ng <khng@FreeBSD.org>
CommitDate: 2021-08-27 12:05:30 +0000

    tmpfs: Fix styles
    
    A lot of return statements were in the wrong style before this commit.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit c12118f6cec0ca5f720be6c06d6c59d551461e5a)
---
 sys/fs/tmpfs/tmpfs_subr.c   |  6 +++---
 sys/fs/tmpfs/tmpfs_vfsops.c |  4 ++--
 sys/fs/tmpfs/tmpfs_vnops.c  | 26 +++++++++++++-------------
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index bea1189d2e82..ec9d7bc78a92 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -515,7 +515,7 @@ tmpfs_alloc_dirent(struct tmpfs_mount *tmp, struct tmpfs_node *node,
 
 	*de = nde;
 
-	return 0;
+	return (0);
 }
 
 /*
@@ -1648,11 +1648,11 @@ tmpfs_chmod(struct vnode *vp, mode_t mode, struct ucred *cred, struct thread *p)
 
 	/* Disallow this operation if the file system is mounted read-only. */
 	if (vp->v_mount->mnt_flag & MNT_RDONLY)
-		return EROFS;
+		return (EROFS);
 
 	/* Immutable or append-only files cannot be modified, either. */
 	if (node->tn_flags & (IMMUTABLE | APPEND))
-		return EPERM;
+		return (EPERM);
 
 	/*
 	 * To modify the permissions on a file, must possess VADMIN
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index 219ec9ee69f2..6f7091d8b52f 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -463,7 +463,7 @@ tmpfs_mount(struct mount *mp)
 	vfs_getnewfsid(mp);
 	vfs_mountedfrom(mp, "tmpfs");
 
-	return 0;
+	return (0);
 }
 
 /* ARGSUSED2 */
@@ -628,7 +628,7 @@ tmpfs_statfs(struct mount *mp, struct statfs *sbp)
 		sbp->f_ffree = sbp->f_files - used;
 	/* sbp->f_owner = tmp->tn_uid; */
 
-	return 0;
+	return (0);
 }
 
 static int
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 7df835113397..8b9afd1f887a 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -272,9 +272,9 @@ tmpfs_mknod(struct vop_mknod_args *v)
 
 	if (vap->va_type != VBLK && vap->va_type != VCHR &&
 	    vap->va_type != VFIFO)
-		return EINVAL;
+		return (EINVAL);
 
-	return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL);
+	return (tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL));
 }
 
 static int
@@ -412,7 +412,7 @@ tmpfs_getattr(struct vop_getattr_args *v)
 		vap->va_bytes = node->tn_size;
 	vap->va_filerev = 0;
 
-	return 0;
+	return (0);
 }
 
 int
@@ -469,7 +469,7 @@ tmpfs_setattr(struct vop_setattr_args *v)
 
 	MPASS(VOP_ISLOCKED(vp));
 
-	return error;
+	return (error);
 }
 
 static int
@@ -551,7 +551,7 @@ tmpfs_fsync(struct vop_fsync_args *v)
 	tmpfs_check_mtime(vp);
 	tmpfs_update(vp);
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -653,7 +653,7 @@ tmpfs_link(struct vop_link_args *v)
 	error = 0;
 
 out:
-	return error;
+	return (0);
 }
 
 /*
@@ -1094,7 +1094,7 @@ tmpfs_mkdir(struct vop_mkdir_args *v)
 
 	MPASS(vap->va_type == VDIR);
 
-	return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL);
+	return (tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL));
 }
 
 static int
@@ -1187,7 +1187,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v)
 	error = 0;
 
 out:
-	return error;
+	return (error);
 }
 
 static int
@@ -1205,7 +1205,7 @@ tmpfs_symlink(struct vop_symlink_args *v)
 	vap->va_type = VLNK;
 #endif
 
-	return tmpfs_alloc_file(dvp, vpp, vap, cnp, target);
+	return (tmpfs_alloc_file(dvp, vpp, vap, cnp, target));
 }
 
 static int
@@ -1228,7 +1228,7 @@ tmpfs_readdir(struct vop_readdir_args *va)
 
 	/* This operation only makes sense on directory nodes. */
 	if (vp->v_type != VDIR)
-		return ENOTDIR;
+		return (ENOTDIR);
 
 	maxcookies = 0;
 	node = VP_TO_TMPFS_DIR(vp);
@@ -1265,7 +1265,7 @@ tmpfs_readdir(struct vop_readdir_args *va)
 		*eofflag =
 		    (error == 0 && uio->uio_offset == TMPFS_DIRCOOKIE_EOF);
 
-	return error;
+	return (error);
 }
 
 static int
@@ -1380,7 +1380,7 @@ tmpfs_print(struct vop_print_args *v)
 
 	printf("\n");
 
-	return 0;
+	return (0);
 }
 
 int
@@ -1430,7 +1430,7 @@ tmpfs_pathconf(struct vop_pathconf_args *v)
 		error = vop_stdpathconf(v);
 	}
 
-	return error;
+	return (error);
 }
 
 static int



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