diff options
author | bde <bde@FreeBSD.org> | 1998-07-03 22:17:03 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-07-03 22:17:03 +0000 |
commit | 660e6408e6df99a20dacb070c5e7f9739efdf96d (patch) | |
tree | fa18791e6630cac02a4e08a1e8a214bd606680e8 /sys/gnu/ext2fs/ext2_inode.c | |
parent | dfd9848c30c89d2bd43b93309c934a84cc254107 (diff) | |
download | FreeBSD-src-660e6408e6df99a20dacb070c5e7f9739efdf96d.zip FreeBSD-src-660e6408e6df99a20dacb070c5e7f9739efdf96d.tar.gz |
Sync timestamp changes for inodes of special files to disk as late
as possible (when the inode is reclaimed). Temporarily only do
this if option UFS_LAZYMOD configured and softupdates aren't enabled.
UFS_LAZYMOD is intentionally left out of /sys/conf/options.
This is mainly to avoid almost useless disk i/o on battery powered
machines. It's silly to write to disk (on the next sync or when the
inode becomes inactive) just because someone hit a key or something
wrote to the screen or /dev/null.
PR: 5577
Previous version reviewed by: phk
Diffstat (limited to 'sys/gnu/ext2fs/ext2_inode.c')
-rw-r--r-- | sys/gnu/ext2fs/ext2_inode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c index a094ad2..ae37b2c8 100644 --- a/sys/gnu/ext2fs/ext2_inode.c +++ b/sys/gnu/ext2fs/ext2_inode.c @@ -72,12 +72,12 @@ ext2_init(struct vfsconf *vfsp) /* * Update the access, modified, and inode change times as specified by the - * IACCESS, IUPDATE, and ICHANGE flags respectively. The IMODIFIED flag is - * used to specify that the inode needs to be updated but that the times have - * already been set. The access and modified times are taken from the second - * and third parameters; the inode change time is always taken from the current - * time. If waitfor is set, then wait for the disk write of the inode to - * complete. + * IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode + * to disk if the IN_MODIFIED flag is set (it may be set initially, or by + * the timestamp update). The IN_LAZYMOD flag is set to force a write + * later if not now. If we write now, then clear both IN_MODIFIED and + * IN_LAZYMOD to reflect the presumably successful write, and if waitfor is + * set, then wait for the write to complete. */ int ext2_update(vp, access, modify, waitfor) @@ -95,7 +95,7 @@ ext2_update(vp, access, modify, waitfor) ip = VTOI(vp); if ((ip->i_flag & IN_MODIFIED) == 0) return (0); - ip->i_flag &= ~IN_MODIFIED; + ip->i_flag &= ~(IN_LAZYMOD | IN_MODIFIED); if (vp->v_mount->mnt_flag & MNT_RDONLY) return (0); fs = ip->i_e2fs; |