Back out recent laptop sync changes. They had significant errors.

This commit is contained in:
John Dyson 1998-02-01 08:24:00 +00:00
parent fcc7dccff6
commit 9cfcd01101
3 changed files with 8 additions and 31 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
* $Id: ffs_inode.c,v 1.30 1998/01/06 05:23:36 dyson Exp $
* $Id: ffs_inode.c,v 1.31 1998/02/01 01:59:11 dyson Exp $
*/
#include "opt_quota.h"
@ -87,15 +87,9 @@ ffs_update(vp, access, modify, waitfor)
~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
return (0);
}
if (vp->v_mount->mnt_flag & MNT_NOATIME) {
ip->i_flag &=~ IN_ACCESS;
}
if ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0)
return (0);
/*
* Use a copy of the current time to get consistent timestamps
* (a_access and a_modify are sometimes aliases for &time).

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
* $Id: ffs_vfsops.c,v 1.66 1998/01/22 17:30:17 dyson Exp $
* $Id: ffs_vfsops.c,v 1.67 1998/02/01 01:59:12 dyson Exp $
*/
#include "opt_quota.h"
@ -849,7 +849,6 @@ ffs_sync(mp, waitfor, cred, p)
struct fs *fs;
struct timeval tv;
int error, allerror = 0;
u_long fmask;
fs = ump->um_fs;
if (fs->fs_fmod != 0 && fs->fs_ronly != 0) { /* XXX */
@ -859,11 +858,6 @@ ffs_sync(mp, waitfor, cred, p)
/*
* Write back each (modified) inode.
*/
fmask = (mp->mnt_flag & MNT_NOATIME)?
(IN_CHANGE | IN_MODIFIED | IN_UPDATE) :
(IN_CHANGE | IN_MODIFIED | IN_UPDATE | IN_ACCESS);
simple_lock(&mntvnode_slock);
loop:
for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nvp) {
@ -876,7 +870,8 @@ ffs_sync(mp, waitfor, cred, p)
simple_lock(&vp->v_interlock);
nvp = vp->v_mntvnodes.le_next;
ip = VTOI(vp);
if (((ip->i_flag & fmask) == 0) &&
if (((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) &&
vp->v_dirtyblkhd.lh_first == NULL) {
simple_unlock(&vp->v_interlock);
continue;
@ -900,6 +895,7 @@ ffs_sync(mp, waitfor, cred, p)
simple_unlock(&mntvnode_slock);
simple_unlock(&vp->v_interlock);
gettime(&tv);
/* UFS_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
UFS_UPDATE(vp, &tv, &tv, 0);
simple_lock(&mntvnode_slock);
}

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95
* $Id: ffs_vnops.c,v 1.38 1998/01/06 05:23:44 dyson Exp $
* $Id: ffs_vnops.c,v 1.39 1998/02/01 01:59:12 dyson Exp $
*/
#include <sys/param.h>
@ -105,9 +105,6 @@ SYSCTL_NODE(_vfs, MOUNT_UFS, ffs, CTLFLAG_RW, 0, "FFS filesystem");
#include <ufs/ufs/ufs_readwrite.c>
int ffs_log_sync = 0;
/*
* Synch an open file.
*/
@ -129,6 +126,7 @@ ffs_fsync(ap)
int s;
daddr_t lbn;
if (vp->v_type == VBLK) {
lbn = INT_MAX;
} else {
@ -137,12 +135,6 @@ ffs_fsync(ap)
lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1));
}
if (ffs_log_sync) {
struct inode* ip = VTOI(vp);
printf("fsync i %u iflags 0x%x vn 0x%x vtype %d tag %d vflags 0x%x\n",
ip->i_number, ip->i_flag, vp, vp->v_type, vp->v_tag, vp->v_flag);
}
pass = 0;
/*
* Flush all dirty buffers associated with a vnode.
@ -156,11 +148,6 @@ ffs_fsync(ap)
if ((bp->b_flags & B_DELWRI) == 0)
panic("ffs_fsync: not dirty");
if (ffs_log_sync) {
printf(" blk %u (%u) flags 0x%x vn 0x%x\n", bp->b_lblkno, bp->b_blkno,
bp->b_flags, bp->b_vp);
}
if (((bp->b_vp != vp) || (ap->a_waitfor != MNT_NOWAIT)) ||
((vp->v_type != VREG) && (vp->v_type != VBLK))) {
@ -219,5 +206,5 @@ ffs_fsync(ap)
}
gettime(&tv);
return (UFS_UPDATE(ap->a_vp, &tv, &tv, 1));
return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}