cleanup and remove vrpages references
[unix-history] / usr / src / sys / ufs / ffs / ufs_vnops.c
index 6b3892b..2c811d2 100644 (file)
@@ -1,4 +1,4 @@
-/*     ufs_vnops.c     4.6     %G%     */
+/*     ufs_vnops.c     4.11    81/08/12        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -30,7 +30,17 @@ fstat()
        fp = getf(uap->fdes);
        if(fp == NULL)
                return;
        fp = getf(uap->fdes);
        if(fp == NULL)
                return;
-       stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0);
+       if (fp->f_flag&FPORT) {
+               ptstat(fp);
+               return;
+       }
+#ifdef BBNNET
+       if (fp->f_flag&FNET) {
+               u.u_error = EINVAL;
+               return;
+       }
+#endif
+       stat1(fp->f_inode, uap->sb);
 }
 
 /*
 }
 
 /*
@@ -48,7 +58,7 @@ stat()
        ip = namei(uchar, 0);
        if(ip == NULL)
                return;
        ip = namei(uchar, 0);
        if(ip == NULL)
                return;
-       stat1(ip, uap->sb, (off_t)0);
+       stat1(ip, uap->sb);
        iput(ip);
 }
 
        iput(ip);
 }
 
@@ -56,10 +66,9 @@ stat()
  * The basic routine for fstat and stat:
  * get the inode and pass appropriate parts back.
  */
  * The basic routine for fstat and stat:
  * get the inode and pass appropriate parts back.
  */
-stat1(ip, ub, pipeadj)
+stat1(ip, ub)
 register struct inode *ip;
 struct stat *ub;
 register struct inode *ip;
 struct stat *ub;
-off_t pipeadj;
 {
        register struct dinode *dp;
        register struct buf *bp;
 {
        register struct dinode *dp;
        register struct buf *bp;
@@ -76,7 +85,7 @@ off_t pipeadj;
        ds.st_uid = ip->i_uid;
        ds.st_gid = ip->i_gid;
        ds.st_rdev = (dev_t)ip->i_un.i_rdev;
        ds.st_uid = ip->i_uid;
        ds.st_gid = ip->i_gid;
        ds.st_rdev = (dev_t)ip->i_un.i_rdev;
-       ds.st_size = ip->i_size - pipeadj;
+       ds.st_size = ip->i_size;
        /*
         * next the dates in the disk
         */
        /*
         * next the dates in the disk
         */
@@ -135,8 +144,7 @@ dup()
 /*
  * the mount system call.
  */
 /*
  * the mount system call.
  */
-smount()
-{
+smount() {
        dev_t dev;
        register struct inode *ip;
        register struct mount *mp;
        dev_t dev;
        register struct inode *ip;
        register struct mount *mp;
@@ -148,6 +156,7 @@ smount()
                char    *freg;
                int     ronly;
        } *uap;
                char    *freg;
                int     ronly;
        } *uap;
+       register char *cp;
 
        uap = (struct a *)u.u_ap;
        dev = getmdev();
 
        uap = (struct a *)u.u_ap;
        dev = getmdev();
@@ -189,6 +198,11 @@ smount()
        fp->s_ronly = uap->ronly & 1;
        fp->s_nbehind = 0;
        fp->s_lasti = 1;
        fp->s_ronly = uap->ronly & 1;
        fp->s_nbehind = 0;
        fp->s_lasti = 1;
+       u.u_dirp = uap->freg;
+       for (cp = fp->s_fsmnt; cp < &fp->s_fsmnt[sizeof (fp->s_fsmnt) - 1]; )
+               if ((*cp++ = uchar()) == 0)
+                       u.u_dirp--;             /* get 0 again */
+       *cp = 0;
        brelse(bp);
        ip->i_flag |= IMOUNT;
        prele(ip);
        brelse(bp);
        ip->i_flag |= IMOUNT;
        prele(ip);
@@ -227,7 +241,7 @@ sumount()
 
 found:
        stillopen = 0;
 
 found:
        stillopen = 0;
-       for(ip = &inode[0]; ip < &inode[NINODE]; ip++)
+       for(ip = inode; ip < inodeNINODE; ip++)
                if (ip->i_number != 0 && dev == ip->i_dev) {
                        u.u_error = EBUSY;
                        return;
                if (ip->i_number != 0 && dev == ip->i_dev) {
                        u.u_error = EBUSY;
                        return;