Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ufs convert to ANSI KNF



details:   https://anonhg.NetBSD.org/src/rev/93cb34a4e920
branches:  trunk
changeset: 504288:93cb34a4e920
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Feb 26 18:09:20 2001 +0000

description:
convert to ANSI KNF

diffstat:

 sys/ufs/ufs/ufs_vnops.c |  639 ++++++++++++++++++++++++-----------------------
 1 files changed, 326 insertions(+), 313 deletions(-)

diffs (truncated from 1081 to 300 lines):

diff -r 52f031db28c0 -r 93cb34a4e920 sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c   Mon Feb 26 17:25:28 2001 +0000
+++ b/sys/ufs/ufs/ufs_vnops.c   Mon Feb 26 18:09:20 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_vnops.c,v 1.75 2000/11/27 08:40:02 chs Exp $       */
+/*     $NetBSD: ufs_vnops.c,v 1.76 2001/02/26 18:09:20 lukem Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993, 1995
@@ -70,48 +70,52 @@
 #include <ufs/ext2fs/ext2fs_extern.h>
 #include <ufs/lfs/lfs_extern.h>
 
-static int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *));
-static int ufs_chown
-       __P((struct vnode *, uid_t, gid_t, struct ucred *, struct proc *));
+static int ufs_chmod(struct vnode *, int, struct ucred *, struct proc *);
+static int ufs_chown(struct vnode *, uid_t, gid_t, struct ucred *,
+                   struct proc *);
 
 union _qcvt {
        int64_t qcvt;
-       int32_t val[2];
+       int32_t val[2];
 };
-#define SETHIGH(q, h) { \
-       union _qcvt tmp; \
-       tmp.qcvt = (q); \
-       tmp.val[_QUAD_HIGHWORD] = (h); \
-       (q) = tmp.qcvt; \
-}
-#define SETLOW(q, l) { \
-       union _qcvt tmp; \
-       tmp.qcvt = (q); \
-       tmp.val[_QUAD_LOWWORD] = (l); \
-       (q) = tmp.qcvt; \
-}
+
+#define SETHIGH(q, h)                                                  \
+do {                                                                   \
+       union _qcvt tmp;                                                \
+       tmp.qcvt = (q);                                                 \
+       tmp.val[_QUAD_HIGHWORD] = (h);                                  \
+       (q) = tmp.qcvt;                                                 \
+} while (0)
+
+#define SETLOW(q, l)                                                   \
+do {                                                                   \
+       union _qcvt tmp;                                                \
+       tmp.qcvt = (q);                                                 \
+       tmp.val[_QUAD_LOWWORD] = (l);                                   \
+       (q) = tmp.qcvt;                                                 \
+} while (0)
 
 /*
  * A virgin directory (no blushing please).
  */
 static struct dirtemplate mastertemplate = {
-       0, 12, DT_DIR, 1, ".",
-       0, DIRBLKSIZ - 12, DT_DIR, 2, ".."
+       0,      12,             DT_DIR, 1,      ".",
+       0,      DIRBLKSIZ - 12, DT_DIR, 2,      ".."
 };
 
 /*
  * Create a regular file
  */
 int
-ufs_create(v)
-       void *v;
+ufs_create(void *v)
 {
        struct vop_create_args /* {
-               struct vnode *a_dvp;
-               struct vnode **a_vpp;
-               struct componentname *a_cnp;
-               struct vattr *a_vap;
+               struct vnode            *a_dvp;
+               struct vnode            **a_vpp;
+               struct componentname    *a_cnp;
+               struct vattr            *a_vap;
        } */ *ap = v;
+
        return
            ufs_makeinode(MAKEIMODE(ap->a_vap->va_type, ap->a_vap->va_mode),
                          ap->a_dvp, ap->a_vpp, ap->a_cnp);
@@ -122,20 +126,21 @@
  */
 /* ARGSUSED */
 int
-ufs_mknod(v)
-       void *v;
+ufs_mknod(void *v)
 {
        struct vop_mknod_args /* {
-               struct vnode *a_dvp;
-               struct vnode **a_vpp;
-               struct componentname *a_cnp;
-               struct vattr *a_vap;
+               struct vnode            *a_dvp;
+               struct vnode            **a_vpp;
+               struct componentname    *a_cnp;
+               struct vattr            *a_vap;
        } */ *ap = v;
-       struct vattr *vap = ap->a_vap;
-       struct vnode **vpp = ap->a_vpp;
-       struct inode *ip;
-       int error;
+       struct vattr    *vap;
+       struct vnode    **vpp;
+       struct inode    *ip;
+       int             error;
 
+       vap = ap->a_vap;
+       vpp = ap->a_vpp;
        if ((error =
            ufs_makeinode(MAKEIMODE(vap->va_type, vap->va_mode),
            ap->a_dvp, vpp, ap->a_cnp)) != 0)
@@ -169,14 +174,13 @@
  */
 /* ARGSUSED */
 int
-ufs_open(v)
-       void *v;
+ufs_open(void *v)
 {
        struct vop_open_args /* {
-               struct vnode *a_vp;
-               int  a_mode;
-               struct ucred *a_cred;
-               struct proc *a_p;
+               struct vnode    *a_vp;
+               int             a_mode;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
        } */ *ap = v;
 
        /*
@@ -195,19 +199,20 @@
  */
 /* ARGSUSED */
 int
-ufs_close(v)
-       void *v;
+ufs_close(void *v)
 {
        struct vop_close_args /* {
-               struct vnode *a_vp;
-               int  a_fflag;
-               struct ucred *a_cred;
-               struct proc *a_p;
+               struct vnode    *a_vp;
+               int             a_fflag;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
        } */ *ap = v;
-       struct vnode *vp = ap->a_vp;
-       struct inode *ip = VTOI(vp);
-       struct timespec ts;
+       struct vnode    *vp;
+       struct inode    *ip;
+       struct timespec ts;
 
+       vp = ap->a_vp;
+       ip = VTOI(vp);
        simple_lock(&vp->v_interlock);
        if (vp->v_usecount > 1) {
                TIMEVAL_TO_TIMESPEC(&time, &ts);
@@ -218,22 +223,24 @@
 }
 
 int
-ufs_access(v)
-       void *v;
+ufs_access(void *v)
 {
        struct vop_access_args /* {
-               struct vnode *a_vp;
-               int  a_mode;
-               struct ucred *a_cred;
-               struct proc *a_p;
+               struct vnode    *a_vp;
+               int             a_mode;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
        } */ *ap = v;
-       struct vnode *vp = ap->a_vp;
-       struct inode *ip = VTOI(vp);
-       mode_t mode = ap->a_mode;
+       struct vnode    *vp;
+       struct inode    *ip; 
+       mode_t          mode;
 #ifdef QUOTA
-       int error = 0;
+       int             error;
 #endif
 
+       vp = ap->a_vp;
+       ip = VTOI(vp);
+       mode = ap->a_mode;
        /*
         * Disallow write attempts on read-only file systems;
         * unless the file is a socket, fifo, or a block or
@@ -272,20 +279,22 @@
 
 /* ARGSUSED */
 int
-ufs_getattr(v)
-       void *v;
+ufs_getattr(void *v)
 {
        struct vop_getattr_args /* {
-               struct vnode *a_vp;
-               struct vattr *a_vap;
-               struct ucred *a_cred;
-               struct proc *a_p;
+               struct vnode    *a_vp;
+               struct vattr    *a_vap;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
        } */ *ap = v;
-       struct vnode *vp = ap->a_vp;
-       struct inode *ip = VTOI(vp);
-       struct vattr *vap = ap->a_vap;
-       struct timespec ts;
+       struct vnode    *vp;
+       struct inode    *ip;
+       struct vattr    *vap;
+       struct timespec ts;
 
+       vp = ap->a_vp;
+       ip = VTOI(vp);
+       vap = ap->a_vap;
        TIMEVAL_TO_TIMESPEC(&time, &ts);
        ITIMES(ip, &ts, &ts, &ts);
        /*
@@ -325,21 +334,26 @@
  * Set attribute vnode op. called from several syscalls
  */
 int
-ufs_setattr(v)
-       void *v;
+ufs_setattr(void *v)
 {
        struct vop_setattr_args /* {
-               struct vnode *a_vp;
-               struct vattr *a_vap;
-               struct ucred *a_cred;
-               struct proc *a_p;
+               struct vnode    *a_vp;
+               struct vattr    *a_vap;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
        } */ *ap = v;
-       struct vattr *vap = ap->a_vap;
-       struct vnode *vp = ap->a_vp;
-       struct inode *ip = VTOI(vp);
-       struct ucred *cred = ap->a_cred;
-       struct proc *p = ap->a_p;
-       int error;
+       struct vattr    *vap;
+       struct vnode    *vp;
+       struct inode    *ip;
+       struct ucred    *cred;
+       struct proc     *p;
+       int             error;
+
+       vap = ap->a_vap;
+       vp = ap->a_vp;
+       ip = VTOI(vp);
+       cred = ap->a_cred;
+       p = ap->a_p;
 
        /*
         * Check for unsettable attributes.
@@ -440,15 +454,12 @@
  * Inode must be locked before calling.
  */
 static int
-ufs_chmod(vp, mode, cred, p)
-       struct vnode *vp;
-       int mode;
-       struct ucred *cred;
-       struct proc *p;
+ufs_chmod(struct vnode *vp, int mode, struct ucred *cred, struct proc *p)
 {
-       struct inode *ip = VTOI(vp);
-       int error;
+       struct inode    *ip;
+       int             error;
 
+       ip = VTOI(vp);
        if (cred->cr_uid != ip->i_ffs_uid &&
            (error = suser(cred, &p->p_acflag)))
                return (error);
@@ -469,21 +480,19 @@
  * inode must be locked prior to call.
  */
 static int
-ufs_chown(vp, uid, gid, cred, p)



Home | Main Index | Thread Index | Old Index