diff options
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/ext2fs/ext2_inode.c | 14 | ||||
-rw-r--r-- | sys/gnu/ext2fs/inode.h | 3 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_inode.c | 14 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/inode.h | 3 |
4 files changed, 18 insertions, 16 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; diff --git a/sys/gnu/ext2fs/inode.h b/sys/gnu/ext2fs/inode.h index c787e1e..76b7b5e 100644 --- a/sys/gnu/ext2fs/inode.h +++ b/sys/gnu/ext2fs/inode.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)inode.h 8.9 (Berkeley) 5/14/95 - * $Id: inode.h,v 1.21 1998/03/08 09:59:21 julian Exp $ + * $Id: inode.h,v 1.22 1998/03/26 20:53:58 phk Exp $ */ #ifndef _UFS_UFS_INODE_H_ @@ -127,6 +127,7 @@ struct inode { #define IN_SHLOCK 0x0020 /* File has shared lock. */ #define IN_EXLOCK 0x0040 /* File has exclusive lock. */ #define IN_HASHED 0x0080 /* Inode is on hash list */ +#define IN_LAZYMOD 0x0100 /* Modified, but don't write yet. */ #ifdef KERNEL /* diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c index a094ad2..ae37b2c8 100644 --- a/sys/gnu/fs/ext2fs/ext2_inode.c +++ b/sys/gnu/fs/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; diff --git a/sys/gnu/fs/ext2fs/inode.h b/sys/gnu/fs/ext2fs/inode.h index c787e1e..76b7b5e 100644 --- a/sys/gnu/fs/ext2fs/inode.h +++ b/sys/gnu/fs/ext2fs/inode.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)inode.h 8.9 (Berkeley) 5/14/95 - * $Id: inode.h,v 1.21 1998/03/08 09:59:21 julian Exp $ + * $Id: inode.h,v 1.22 1998/03/26 20:53:58 phk Exp $ */ #ifndef _UFS_UFS_INODE_H_ @@ -127,6 +127,7 @@ struct inode { #define IN_SHLOCK 0x0020 /* File has shared lock. */ #define IN_EXLOCK 0x0040 /* File has exclusive lock. */ #define IN_HASHED 0x0080 /* Inode is on hash list */ +#define IN_LAZYMOD 0x0100 /* Modified, but don't write yet. */ #ifdef KERNEL /* |