diff options
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 16 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 33 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_readwrite.c | 14 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 8 |
4 files changed, 30 insertions, 41 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index a757e18..6e53833 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93 - * $Id: ffs_inode.c,v 1.16 1995/11/05 21:01:15 dyson Exp $ + * $Id: ffs_inode.c,v 1.17 1995/12/07 12:47:50 davidg Exp $ */ #include <sys/param.h> @@ -143,6 +143,7 @@ ffs_update(ap) if (ap->a_waitfor && (ap->a_vp->v_mount->mnt_flag & MNT_ASYNC) == 0) return (bwrite(bp)); else { + bp->b_flags |= B_CLUSTEROK; bdwrite(bp); return (0); } @@ -228,7 +229,7 @@ ffs_truncate(ap) bdwrite(bp); else bawrite(bp); - vnode_pager_setsize(ovp, (u_long)length); + vnode_pager_setsize(ovp, length); oip->i_flag |= IN_CHANGE | IN_UPDATE; return (VOP_UPDATE(ovp, &tv, &tv, 1)); } @@ -287,7 +288,7 @@ ffs_truncate(ap) for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - error = VOP_UPDATE(ovp, &tv, &tv, 1); + error = VOP_UPDATE(ovp, &tv, &tv, 0); if (error) allerror = error; /* @@ -391,7 +392,7 @@ done: if (oip->i_blocks < 0) /* sanity */ oip->i_blocks = 0; oip->i_flag |= IN_CHANGE; - vnode_pager_setsize(ovp, (u_long)length); + vnode_pager_setsize(ovp, length); #ifdef QUOTA (void) chkdq(oip, -blocksreleased, NOCRED, 0); #endif @@ -470,7 +471,12 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) (u_int)(NINDIR(fs) - (last + 1)) * sizeof (daddr_t)); if (last == -1) bp->b_flags |= B_INVAL; - error = bwrite(bp); + if ((vp->v_mount->mnt_flag & MNT_ASYNC) == 0) { + error = bwrite(bp); + } else { + bawrite(bp); + error = 0; + } if (error) allerror = error; bap = copy; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index b72f132..3c9774a 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 - * $Id: ffs_vfsops.c,v 1.29 1995/11/20 12:25:37 phk Exp $ + * $Id: ffs_vfsops.c,v 1.30 1995/12/07 12:47:51 davidg Exp $ */ #include <sys/param.h> @@ -69,7 +69,6 @@ int ffs_sbupdate __P((struct ufsmount *, int)); int ffs_reload __P((struct mount *,struct ucred *,struct proc *)); int ffs_oldfscompat __P((struct fs *)); -void ffs_vmlimits __P((struct fs *)); struct vfsops ufs_vfsops = { ffs_mount, @@ -392,7 +391,6 @@ ffs_reload(mp, cred, p) bp->b_flags |= B_INVAL; brelse(bp); ffs_oldfscompat(fs); - ffs_vmlimits(fs); /* * Step 3: re-read summary information from disk. */ @@ -562,7 +560,6 @@ ffs_mountfs(devvp, mp, p) ump->um_quotas[i] = NULLVP; devvp->v_specflags |= SI_MOUNTEDON; ffs_oldfscompat(fs); - ffs_vmlimits(fs); /* * Set FS local "last mounted on" information (NULL pad) @@ -614,14 +611,13 @@ ffs_oldfscompat(fs) #if 0 int i; /* XXX */ quad_t sizepb = fs->fs_bsize; /* XXX */ - /* XXX */ fs->fs_maxfilesize = fs->fs_bsize * NDADDR - 1; /* XXX */ for (i = 0; i < NIADDR; i++) { /* XXX */ sizepb *= NINDIR(fs); /* XXX */ fs->fs_maxfilesize += sizepb; /* XXX */ } /* XXX */ #endif - fs->fs_maxfilesize = (u_quad_t) 1 << 39; + fs->fs_maxfilesize = (u_quad_t) 1LL << 39; fs->fs_qbmask = ~fs->fs_bmask; /* XXX */ fs->fs_qfmask = ~fs->fs_fmask; /* XXX */ } /* XXX */ @@ -629,18 +625,6 @@ ffs_oldfscompat(fs) } /* - * Sanity check for VM file size limits -- temporary until - * VM system can support > 32bit offsets - */ -void -ffs_vmlimits(fs) - struct fs *fs; -{ - if( fs->fs_maxfilesize > (((u_quad_t) 1 << 31) - 1)) - fs->fs_maxfilesize = ((u_quad_t) 1 << 31) - 1; -} - -/* * unmount system call */ int @@ -670,7 +654,10 @@ ffs_unmount(mp, mntflags, p) ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p); +/* vrele(ump->um_devvp); +*/ + vn_vmio_close(ump->um_devvp); free(fs->fs_csp[0], M_UFSMNT); free(fs, M_UFSMNT); free(ump, M_UFSMNT); @@ -764,7 +751,7 @@ ffs_sync(mp, waitfor, cred, p) struct ucred *cred; struct proc *p; { - register struct vnode *vp; + register struct vnode *vp, *nvp; register struct inode *ip; register struct ufsmount *ump = VFSTOUFS(mp); register struct fs *fs; @@ -790,15 +777,14 @@ ffs_sync(mp, waitfor, cred, p) * Write back each (modified) inode. */ loop: - for (vp = mp->mnt_vnodelist.lh_first; - vp != NULL; - vp = vp->v_mntvnodes.le_next) { + for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nvp) { /* * If the vnode that we are about to sync is no longer * associated with this mount point, start over. */ if (vp->v_mount != mp) goto loop; + nvp = vp->v_mntvnodes.le_next; if (VOP_ISLOCKED(vp)) continue; ip = VTOI(vp); @@ -815,7 +801,8 @@ loop: vput(vp); } else { tv = time; - VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); + /* VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */ + VOP_UPDATE(vp, &tv, &tv, 0); } } /* diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index b30a383..9473d6b 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufs_readwrite.c 8.7 (Berkeley) 1/21/94 - * $Id: ufs_readwrite.c,v 1.15 1995/11/05 21:01:10 dyson Exp $ + * $Id: ufs_readwrite.c,v 1.16 1995/11/20 12:25:23 phk Exp $ */ #ifdef LFS_READWRITE @@ -241,7 +241,7 @@ WRITE(ap) xfersize = uio->uio_resid; if (uio->uio_offset + xfersize > ip->i_size) - vnode_pager_setsize(vp, (u_long)uio->uio_offset + xfersize); + vnode_pager_setsize(vp, uio->uio_offset + xfersize); #ifdef LFS_READWRITE (void)lfs_check(vp, lbn); @@ -327,7 +327,7 @@ int ffs_getpages(ap) struct vop_getpages_args *ap; { - vm_offset_t foff, physoffset; + off_t foff, physoffset; int i, size, bsize; struct vnode *dp; int bbackwards, bforwards; @@ -361,7 +361,7 @@ ffs_getpages(ap) * reqlblkno is the logical block that contains the page * poff is the index of the page into the logical block */ - foff = ap->a_m[ap->a_reqpage]->offset + ap->a_offset; + foff = IDX_TO_OFF(ap->a_m[ap->a_reqpage]->pindex) + ap->a_offset; reqlblkno = foff / bsize; poff = (foff % bsize) / PAGE_SIZE; @@ -422,11 +422,11 @@ ffs_getpages(ap) */ size = pcount * PAGE_SIZE; - if ((ap->a_m[firstpage]->offset + size) > + if ((IDX_TO_OFF(ap->a_m[firstpage]->pindex) + size) > ((vm_object_t) ap->a_vp->v_object)->un_pager.vnp.vnp_size) - size = ((vm_object_t) ap->a_vp->v_object)->un_pager.vnp.vnp_size - ap->a_m[firstpage]->offset; + size = ((vm_object_t) ap->a_vp->v_object)->un_pager.vnp.vnp_size - IDX_TO_OFF(ap->a_m[firstpage]->pindex); - physoffset -= ap->a_m[ap->a_reqpage]->offset; + physoffset -= IDX_TO_OFF(ap->a_m[ap->a_reqpage]->pindex); rtval = VOP_GETPAGES(dp, &ap->a_m[firstpage], size, (ap->a_reqpage - firstpage), physoffset); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 1555491..dd61ba4 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94 - * $Id: ufs_vnops.c,v 1.33 1995/11/09 08:14:37 bde Exp $ + * $Id: ufs_vnops.c,v 1.34 1995/11/19 19:46:23 dyson Exp $ */ #include <sys/param.h> @@ -468,10 +468,6 @@ ufs_chmod(vp, mode, cred, p) ip->i_mode &= ~ALLPERMS; ip->i_mode |= (mode & ALLPERMS); ip->i_flag |= IN_CHANGE; -/* - if ((vp->v_flag & VTEXT) && (ip->i_mode & S_ISTXT) == 0) - (void) vnode_pager_uncache(vp); -*/ return (0); } @@ -1720,9 +1716,9 @@ ufs_unlock(ap) } */ *ap; { register struct inode *ip = VTOI(ap->a_vp); - struct proc *p = curproc; #ifdef DIAGNOSTIC + struct proc *p = curproc; if ((ip->i_flag & IN_LOCKED) == 0) { vprint("ufs_unlock: unlocked inode", ap->a_vp); |