aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-09-16 21:24:34 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-09-16 21:24:34 +0000
commit23f90714666c77a62ef468233fd2a0df55f8f4de (patch)
tree4351d9f4359d5b0bc0bb6b5fd174205325640fcf /sys/fs
parent16d6b3b3da62aa5baaf3c66c8d4e6f8c8f70aeb7 (diff)
downloadsrc-23f90714666c77a62ef468233fd2a0df55f8f4de.tar.gz
src-23f90714666c77a62ef468233fd2a0df55f8f4de.zip
Style.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
Notes
Notes: svn path=/head/; revision=365809
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c32
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c11
2 files changed, 24 insertions, 19 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 726f6819b126..b0e3c2506709 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -1579,7 +1579,7 @@ tmpfs_chflags(struct vnode *vp, u_long flags, struct ucred *cred,
/* Disallow this operation if the file system is mounted read-only. */
if (vp->v_mount->mnt_flag & MNT_RDONLY)
- return EROFS;
+ return (EROFS);
/*
* Callers may only modify the file flags on objects they
@@ -1702,11 +1702,11 @@ tmpfs_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred,
/* 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 ownership of a file, must possess VADMIN for that
@@ -1765,11 +1765,11 @@ tmpfs_chsize(struct vnode *vp, u_quad_t size, struct ucred *cred,
error = 0;
switch (vp->v_type) {
case VDIR:
- return EISDIR;
+ return (EISDIR);
case VREG:
if (vp->v_mount->mnt_flag & MNT_RDONLY)
- return EROFS;
+ return (EROFS);
break;
case VBLK:
@@ -1777,23 +1777,27 @@ tmpfs_chsize(struct vnode *vp, u_quad_t size, struct ucred *cred,
case VCHR:
/* FALLTHROUGH */
case VFIFO:
- /* Allow modifications of special files even if in the file
+ /*
+ * Allow modifications of special files even if in the file
* system is mounted read-only (we are not modifying the
- * files themselves, but the objects they represent). */
- return 0;
+ * files themselves, but the objects they represent).
+ */
+ return (0);
default:
/* Anything else is unsupported. */
- return EOPNOTSUPP;
+ return (EOPNOTSUPP);
}
/* Immutable or append-only files cannot be modified, either. */
if (node->tn_flags & (IMMUTABLE | APPEND))
- return EPERM;
+ return (EPERM);
error = tmpfs_truncate(vp, size);
- /* tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents
- * for us, as will update tn_status; no need to do that here. */
+ /*
+ * tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents
+ * for us, as will update tn_status; no need to do that here.
+ */
ASSERT_VOP_ELOCKED(vp, "chsize2");
@@ -1818,11 +1822,11 @@ tmpfs_chtimes(struct vnode *vp, struct vattr *vap,
/* 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);
error = vn_utimes_perm(vp, vap, cred, l);
if (error != 0)
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 150af5f93953..6a836d2b5fc9 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -426,7 +426,7 @@ tmpfs_access(struct vop_access_args *v)
out:
MPASS(VOP_ISLOCKED(vp));
- return error;
+ return (error);
}
int
@@ -560,9 +560,11 @@ tmpfs_setattr(struct vop_setattr_args *v)
vap->va_birthtime.tv_nsec != VNOVAL)))
error = tmpfs_chtimes(vp, vap, cred, td);
- /* Update the node times. We give preference to the error codes
+ /*
+ * Update the node times. We give preference to the error codes
* generated by this function rather than the ones that may arise
- * from tmpfs_update. */
+ * from tmpfs_update.
+ */
tmpfs_update(vp);
MPASS(VOP_ISLOCKED(vp));
@@ -746,8 +748,7 @@ tmpfs_remove(struct vop_remove_args *v)
error = 0;
out:
-
- return error;
+ return (error);
}
static int