new location for specdev.h include
[unix-history] / usr / src / sys / ufs / ffs / ufs_vnops.c
index ab6fcd2..5693ea9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.100 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.103 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
 #include <sys/conf.h>
 #include <sys/mount.h>
 #include <sys/vnode.h>
 #include <sys/conf.h>
 #include <sys/mount.h>
 #include <sys/vnode.h>
-#include <sys/specdev.h>
-#include <sys/fifo.h>
 #include <sys/malloc.h>
 #include <sys/dirent.h>
 
 #include <vm/vm.h>
 
 #include <sys/malloc.h>
 #include <sys/dirent.h>
 
 #include <vm/vm.h>
 
+#include <miscfs/specfs/specdev.h>
+
 #include <ufs/ufs/lockf.h>
 #include <ufs/ufs/quota.h>
 #include <ufs/ufs/inode.h>
 #include <ufs/ufs/lockf.h>
 #include <ufs/ufs/quota.h>
 #include <ufs/ufs/inode.h>
@@ -174,7 +174,6 @@ ufs_access(ap)
                struct proc *a_p;
        } */ *ap;
 {
                struct proc *a_p;
        } */ *ap;
 {
-       USES_VOP_ISLOCKED;
        register struct vnode *vp = ap->a_vp;
        register struct inode *ip = VTOI(vp);
        register struct ucred *cred = ap->a_cred;
        register struct vnode *vp = ap->a_vp;
        register struct inode *ip = VTOI(vp);
        register struct ucred *cred = ap->a_cred;
@@ -278,8 +277,6 @@ ufs_setattr(ap)
                struct proc *a_p;
        } */ *ap;
 {
                struct proc *a_p;
        } */ *ap;
 {
-       USES_VOP_TRUNCATE;
-       USES_VOP_UPDATE;
        register struct vattr *vap = ap->a_vap;
        register struct vnode *vp = ap->a_vp;
        register struct inode *ip = VTOI(vp);
        register struct vattr *vap = ap->a_vap;
        register struct vnode *vp = ap->a_vp;
        register struct inode *ip = VTOI(vp);
@@ -596,12 +593,11 @@ ufs_link(ap)
                struct componentname *a_cnp;
        } */ *ap;
 {
                struct componentname *a_cnp;
        } */ *ap;
 {
-       USES_VOP_UPDATE;
-       USES_VOP_ABORTOP;
        register struct vnode *vp = ap->a_vp;
        register struct vnode *tdvp = ap->a_tdvp;
        register struct componentname *cnp = ap->a_cnp;
        register struct inode *ip;
        register struct vnode *vp = ap->a_vp;
        register struct vnode *tdvp = ap->a_tdvp;
        register struct componentname *cnp = ap->a_cnp;
        register struct inode *ip;
+       struct timeval tv;
        int error;
 
        if (vp->v_mount != tdvp->v_mount) {
        int error;
 
        if (vp->v_mount != tdvp->v_mount) {
@@ -626,7 +622,8 @@ ufs_link(ap)
                ILOCK(ip);
        ip->i_nlink++;
        ip->i_flag |= ICHG;
                ILOCK(ip);
        ip->i_nlink++;
        ip->i_flag |= ICHG;
-       error = VOP_UPDATE(tdvp, &time, &time, 1);
+       tv = time;
+       error = VOP_UPDATE(tdvp, &tv, &tv, 1);
        if (!error)
                error = ufs_direnter(ip, vp, cnp);
        if (vp != tdvp)
        if (!error)
                error = ufs_direnter(ip, vp, cnp);
        if (vp != tdvp)
@@ -651,9 +648,6 @@ relookup(dvp, vpp, cnp)
        struct vnode *dvp, **vpp;
        struct componentname *cnp;
 {
        struct vnode *dvp, **vpp;
        struct componentname *cnp;
 {
-       USES_VOP_LOCK;
-       USES_VOP_LOOKUP;
-       USES_VOP_UNLOCK;
        register struct vnode *dp = 0;  /* the directory we are searching */
        struct vnode *tdp;              /* saved dp */
        struct mount *mp;               /* mount table entry */
        register struct vnode *dp = 0;  /* the directory we are searching */
        struct vnode *tdp;              /* saved dp */
        struct mount *mp;               /* mount table entry */
@@ -834,12 +828,6 @@ ufs_rename(ap)
                struct componentname *a_tcnp;
        } */ *ap;
 {
                struct componentname *a_tcnp;
        } */ *ap;
 {
-       USES_VOP_ABORTOP;
-       USES_VOP_ACCESS;
-       USES_VOP_LOCK;
-       USES_VOP_TRUNCATE;
-       USES_VOP_UNLOCK;
-       USES_VOP_UPDATE;
        struct vnode *tvp = ap->a_tvp;
        register struct vnode *tdvp = ap->a_tdvp;
        struct vnode *fvp = ap->a_fvp;
        struct vnode *tvp = ap->a_tvp;
        register struct vnode *tdvp = ap->a_tdvp;
        struct vnode *fvp = ap->a_fvp;
@@ -848,6 +836,7 @@ ufs_rename(ap)
        register struct componentname *fcnp = ap->a_fcnp;
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
        register struct componentname *fcnp = ap->a_fcnp;
        register struct inode *ip, *xp, *dp;
        struct dirtemplate dirbuf;
+       struct timeval tv;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
        int error = 0;
        int fdvpneedsrele = 1, tdvpneedsrele = 1;
        int doingdirectory = 0, oldparent = 0, newparent = 0;
        int error = 0;
        int fdvpneedsrele = 1, tdvpneedsrele = 1;
@@ -923,7 +912,8 @@ ufs_rename(ap)
         */
        ip->i_nlink++;
        ip->i_flag |= ICHG;
         */
        ip->i_nlink++;
        ip->i_flag |= ICHG;
-       error = VOP_UPDATE(fvp, &time, &time, 1);
+       tv = time;
+       error = VOP_UPDATE(fvp, &tv, &tv, 1);
        IUNLOCK(ip);
 
        /*
        IUNLOCK(ip);
 
        /*
@@ -988,14 +978,14 @@ ufs_rename(ap)
                        }
                        dp->i_nlink++;
                        dp->i_flag |= ICHG;
                        }
                        dp->i_nlink++;
                        dp->i_flag |= ICHG;
-                       if (error = VOP_UPDATE(ITOV(dp), &time, &time, 1))
+                       if (error = VOP_UPDATE(ITOV(dp), &tv, &tv, 1))
                                goto bad;
                }
                if (error = ufs_direnter(ip, tdvp, tcnp)) {
                        if (doingdirectory && newparent) {
                                dp->i_nlink--;
                                dp->i_flag |= ICHG;
                                goto bad;
                }
                if (error = ufs_direnter(ip, tdvp, tcnp)) {
                        if (doingdirectory && newparent) {
                                dp->i_nlink--;
                                dp->i_flag |= ICHG;
-                               (void)VOP_UPDATE(ITOV(dp), &time, &time, 1);
+                               (void)VOP_UPDATE(ITOV(dp), &tv, &tv, 1);
                        }
                        goto bad;
                }
                        }
                        goto bad;
                }
@@ -1200,17 +1190,14 @@ ufs_mkdir(ap)
                struct vattr *a_vap;
        } */ *ap;
 {
                struct vattr *a_vap;
        } */ *ap;
 {
-       USES_VOP_UPDATE;
-       USES_VOP_VALLOC;
-       USES_VOP_VFREE;
        register struct vnode *dvp = ap->a_dvp;
        register struct vattr *vap = ap->a_vap;
        register struct componentname *cnp = ap->a_cnp;
        register struct inode *ip, *dp;
        struct vnode *tvp;
        struct dirtemplate dirtemplate, *dtp;
        register struct vnode *dvp = ap->a_dvp;
        register struct vattr *vap = ap->a_vap;
        register struct componentname *cnp = ap->a_cnp;
        register struct inode *ip, *dp;
        struct vnode *tvp;
        struct dirtemplate dirtemplate, *dtp;
-       int error;
-       int dmode;
+       struct timeval tv;
+       int error, dmode;
 
 #ifdef DIAGNOSTIC
        if ((cnp->cn_flags & HASBUF) == 0)
 
 #ifdef DIAGNOSTIC
        if ((cnp->cn_flags & HASBUF) == 0)
@@ -1251,7 +1238,8 @@ ufs_mkdir(ap)
        ip->i_mode = dmode;
        ITOV(ip)->v_type = VDIR;        /* Rest init'd in iget() */
        ip->i_nlink = 2;
        ip->i_mode = dmode;
        ITOV(ip)->v_type = VDIR;        /* Rest init'd in iget() */
        ip->i_nlink = 2;
-       error = VOP_UPDATE(ITOV(ip), &time, &time, 1);
+       tv = time;
+       error = VOP_UPDATE(ITOV(ip), &tv, &tv, 1);
 
        /*
         * Bump link count in parent directory
 
        /*
         * Bump link count in parent directory
@@ -1261,7 +1249,7 @@ ufs_mkdir(ap)
         */
        dp->i_nlink++;
        dp->i_flag |= ICHG;
         */
        dp->i_nlink++;
        dp->i_flag |= ICHG;
-       if (error = VOP_UPDATE(ITOV(dp), &time, &time, 1))
+       if (error = VOP_UPDATE(ITOV(dp), &tv, &tv, 1))
                goto bad;
 
        /* Initialize directory with "." and ".." from static template. */
                goto bad;
 
        /* Initialize directory with "." and ".." from static template. */
@@ -1314,13 +1302,11 @@ bad:
 int
 ufs_rmdir(ap)
        struct vop_rmdir_args /* {
 int
 ufs_rmdir(ap)
        struct vop_rmdir_args /* {
-               struct vnodeop_desc *a_desc;
                struct vnode *a_dvp;
                struct vnode *a_vp;
                struct componentname *a_cnp;
        } */ *ap;
 {
                struct vnode *a_dvp;
                struct vnode *a_vp;
                struct componentname *a_cnp;
        } */ *ap;
 {
-       USES_VOP_TRUNCATE;
        register struct vnode *dvp = ap->a_dvp;
        register struct componentname *cnp = ap->a_cnp;
        register struct inode *ip, *dp;
        register struct vnode *dvp = ap->a_dvp;
        register struct componentname *cnp = ap->a_cnp;
        register struct inode *ip, *dp;
@@ -1435,7 +1421,6 @@ ufs_readdir(ap)
                struct ucred *a_cred;
        } */ *ap;
 {
                struct ucred *a_cred;
        } */ *ap;
 {
-       USES_VOP_READ;
        register struct uio *uio = ap->a_uio;
        int count, lost, error;
 
        register struct uio *uio = ap->a_uio;
        int count, lost, error;
 
@@ -1505,7 +1490,6 @@ ufs_readlink(ap)
 {
        register struct vnode *vp = ap->a_vp;
        register struct inode *ip = VTOI(vp);
 {
        register struct vnode *vp = ap->a_vp;
        register struct inode *ip = VTOI(vp);
-       USES_VOP_READ;
 
        if (ip->i_size < vp->v_mount->mnt_maxsymlinklen) {
                uiomove((char *)ip->i_shortlink, (int)ip->i_size, ap->a_uio);
 
        if (ip->i_size < vp->v_mount->mnt_maxsymlinklen) {
                uiomove((char *)ip->i_shortlink, (int)ip->i_size, ap->a_uio);
@@ -1588,7 +1572,6 @@ ufs_strategy(ap)
                struct buf *a_bp;
        } */ *ap;
 {
                struct buf *a_bp;
        } */ *ap;
 {
-       USES_VOP_BMAP;
        register struct buf *bp = ap->a_bp;
        register struct vnode *vp = bp->b_vp;
        register struct inode *ip;
        register struct buf *bp = ap->a_bp;
        register struct vnode *vp = bp->b_vp;
        register struct inode *ip;
@@ -1935,10 +1918,8 @@ ufs_makeinode(mode, dvp, vpp, cnp)
        struct vnode **vpp;
        struct componentname *cnp;
 {
        struct vnode **vpp;
        struct componentname *cnp;
 {
-       USES_VOP_UPDATE;
-       USES_VOP_VALLOC;
-       USES_VOP_VFREE;
        register struct inode *ip, *pdir;
        register struct inode *ip, *pdir;
+       struct timeval tv;
        struct vnode *tvp;
        int error;
 
        struct vnode *tvp;
        int error;
 
@@ -1980,7 +1961,8 @@ ufs_makeinode(mode, dvp, vpp, cnp)
        /*
         * Make sure inode goes to disk before directory entry.
         */
        /*
         * Make sure inode goes to disk before directory entry.
         */
-       if (error = VOP_UPDATE(tvp, &time, &time, 1))
+       tv = time;
+       if (error = VOP_UPDATE(tvp, &tv, &tv, 1))
                goto bad;
        if (error = ufs_direnter(ip, dvp, cnp))
                goto bad;
                goto bad;
        if (error = ufs_direnter(ip, dvp, cnp))
                goto bad;