Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern kern/vfs_vnops.c: Sprinkle KNF.



details:   https://anonhg.NetBSD.org/src/rev/20bfc7300989
branches:  trunk
changeset: 368341:20bfc7300989
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 06 01:13:17 2022 +0000

description:
kern/vfs_vnops.c: Sprinkle KNF.

No functional change intended.

diffstat:

 sys/kern/vfs_vnops.c |  72 ++++++++++++++++++++++++++--------------------------
 1 files changed, 36 insertions(+), 36 deletions(-)

diffs (289 lines):

diff -r 0fa20c247299 -r 20bfc7300989 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Wed Jul 06 01:13:06 2022 +0000
+++ b/sys/kern/vfs_vnops.c      Wed Jul 06 01:13:17 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnops.c,v 1.230 2022/07/06 01:13:06 riastradh Exp $        */
+/*     $NetBSD: vfs_vnops.c,v 1.231 2022/07/06 01:13:17 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.230 2022/07/06 01:13:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.231 2022/07/06 01:13:17 riastradh Exp $");
 
 #include "veriexec.h"
 
@@ -106,21 +106,21 @@
 #define COMPAT_ZERODEV(dev)    (0)
 #endif
 
-int (*vn_union_readdir_hook) (struct vnode **, struct file *, struct lwp *);
+int (*vn_union_readdir_hook)(struct vnode **, struct file *, struct lwp *);
 
 #include <sys/verified_exec.h>
 
 static int vn_read(file_t *fp, off_t *offset, struct uio *uio,
-           kauth_cred_t cred, int flags);
+    kauth_cred_t cred, int flags);
 static int vn_write(file_t *fp, off_t *offset, struct uio *uio,
-           kauth_cred_t cred, int flags);
+    kauth_cred_t cred, int flags);
 static int vn_closefile(file_t *fp);
 static int vn_poll(file_t *fp, int events);
 static int vn_fcntl(file_t *fp, u_int com, void *data);
 static int vn_statfile(file_t *fp, struct stat *sb);
 static int vn_ioctl(file_t *fp, u_long com, void *data);
 static int vn_mmap(struct file *, off_t *, size_t, int, int *, int *,
-                  struct uvm_object **, int *);
+    struct uvm_object **, int *);
 static int vn_seek(struct file *, off_t, int, off_t *, int);
 
 const struct fileops vnops = {
@@ -368,8 +368,8 @@
         * we can't allow writing.
         */
        if (vp->v_iflag & VI_TEXT)
-               return (ETXTBSY);
-       return (0);
+               return ETXTBSY;
+       return 0;
 }
 
 int
@@ -440,7 +440,7 @@
 
        if ((vp->v_iflag & (VI_TEXT|VI_EXECMAP)) == (VI_TEXT|VI_EXECMAP)) {
                /* Safe unlocked, as long as caller holds a reference. */
-               return (0);
+               return 0;
        }
 
        rw_enter(vp->v_uobj.vmobjlock, RW_WRITER);
@@ -449,7 +449,7 @@
                KASSERT((vp->v_iflag & VI_TEXT) == 0);
                mutex_exit(vp->v_interlock);
                rw_exit(vp->v_uobj.vmobjlock);
-               return (ETXTBSY);
+               return ETXTBSY;
        }
        if ((vp->v_iflag & VI_EXECMAP) == 0) {
                cpu_count(CPU_COUNT_EXECPAGES, vp->v_uobj.uo_npages);
@@ -457,7 +457,7 @@
        vp->v_iflag |= (VI_TEXT | VI_EXECMAP);
        mutex_exit(vp->v_interlock);
        rw_exit(vp->v_uobj.vmobjlock);
-       return (0);
+       return 0;
 }
 
 /*
@@ -479,7 +479,7 @@
        }
        error = VOP_CLOSE(vp, flags, cred);
        vput(vp);
-       return (error);
+       return error;
 }
 
 static int
@@ -559,7 +559,7 @@
        if ((ioflg & IO_NODELOCKED) == 0) {
                VOP_UNLOCK(vp);
        }
-       return (error);
+       return error;
 }
 
 int
@@ -576,7 +576,7 @@
 
 unionread:
        if (vp->v_type != VDIR)
-               return (EINVAL);
+               return EINVAL;
        aiov.iov_base = bf;
        aiov.iov_len = count;
        auio.uio_iov = &aiov;
@@ -598,14 +598,14 @@
        mutex_exit(&fp->f_lock);
        VOP_UNLOCK(vp);
        if (error)
-               return (error);
+               return error
 
        if (count == auio.uio_resid && vn_union_readdir_hook) {
                struct vnode *ovp = vp;
 
                error = (*vn_union_readdir_hook)(&vp, fp, l);
                if (error)
-                       return (error);
+                       return error;
                if (vp != ovp)
                        goto unionread;
        }
@@ -654,7 +654,7 @@
        if (flags & FOF_UPDATE_OFFSET)
                *offset += count - uio->uio_resid;
        VOP_UNLOCK(vp);
-       return (error);
+       return error;
 }
 
 /*
@@ -709,7 +709,7 @@
 
  out:
        VOP_UNLOCK(vp);
-       return (error);
+       return error;
 }
 
 /*
@@ -737,7 +737,7 @@
        memset(&va, 0, sizeof(va));
        error = VOP_GETATTR(vp, &va, kauth_cred_get());
        if (error)
-               return (error);
+               return error;
        /*
         * Copy from vattr table
         */
@@ -768,7 +768,7 @@
                mode |= S_IFIFO;
                break;
        default:
-               return (EBADF);
+               return EBADF;
        }
        sb->st_mode = mode;
        sb->st_nlink = va.va_nlink;
@@ -784,7 +784,7 @@
        sb->st_flags = va.va_flags;
        sb->st_gen = 0;
        sb->st_blocks = va.va_bytes / S_BLKSIZE;
-       return (0);
+       return 0;
 }
 
 /*
@@ -797,7 +797,7 @@
        int error;
 
        error = VOP_FCNTL(vp, com, data, fp->f_flag, kauth_cred_get());
-       return (error);
+       return error;
 }
 
 /*
@@ -821,8 +821,8 @@
                                *(int *)data = vattr.va_size - fp->f_offset;
                        VOP_UNLOCK(vp);
                        if (error)
-                               return (error);
-                       return (0);
+                               return error;
+                       return 0;
                }
                if ((com == FIONWRITE) || (com == FIONSPACE)) {
                        /*
@@ -831,13 +831,13 @@
                         * open space in them.
                         */
                        *(int *)data = 0;
-                       return (0);
+                       return 0;
                }
                if (com == FIOGETBMAP) {
                        daddr_t *block;
 
                        if (*(daddr_t *)data < 0)
-                               return (EINVAL);
+                               return EINVAL;
                        block = (daddr_t *)data;
                        vn_lock(vp, LK_SHARED | LK_RETRY);
                        error = VOP_BMAP(vp, *block, NULL, block, NULL);
@@ -848,7 +848,7 @@
                        daddr_t ibn, obn;
 
                        if (*(int32_t *)data < 0)
-                               return (EINVAL);
+                               return EINVAL;
                        ibn = (daddr_t)*(int32_t *)data;
                        vn_lock(vp, LK_SHARED | LK_RETRY);
                        error = VOP_BMAP(vp, ibn, NULL, &obn, NULL);
@@ -857,7 +857,7 @@
                        return error;
                }
                if (com == FIONBIO || com == FIOASYNC)  /* XXX */
-                       return (0);                     /* XXX */
+                       return 0;                       /* XXX */
                /* FALLTHROUGH */
        case VFIFO:
        case VCHR:
@@ -873,10 +873,10 @@
                        if (ovp != NULL)
                                vrele(ovp);
                }
-               return (error);
+               return error;
 
        default:
-               return (EPASSTHROUGH);
+               return EPASSTHROUGH;
        }
 }
 
@@ -887,7 +887,7 @@
 vn_poll(file_t *fp, int events)
 {
 
-       return (VOP_POLL(fp->f_vnode, events));
+       return VOP_POLL(fp->f_vnode, events);
 }
 
 /*
@@ -897,12 +897,12 @@
 vn_kqfilter(file_t *fp, struct knote *kn)
 {
 
-       return (VOP_KQFILTER(fp->f_vnode, kn));
+       return VOP_KQFILTER(fp->f_vnode, kn);
 }
 
 static int
 vn_mmap(struct file *fp, off_t *offp, size_t size, int prot, int *flagsp,
-       int *advicep, struct uvm_object **uobjp, int *maxprotp)
+    int *advicep, struct uvm_object **uobjp, int *maxprotp)
 {
        struct uvm_object *uobj;
        struct vnode *vp;
@@ -1277,7 +1277,7 @@
        if (error == 0)
                *buflen = *buflen - auio.uio_resid;
 
-       return (error);
+       return error;
 }
 
 /*
@@ -1311,7 +1311,7 @@
                VOP_UNLOCK(vp);
        }
 
-       return (error);
+       return error;
 }
 
 int
@@ -1333,7 +1333,7 @@
                VOP_UNLOCK(vp);
        }
 
-       return (error);
+       return error;
 }
 
 int



Home | Main Index | Thread Index | Old Index