Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs update for IN_ACCESSED changes



details:   https://anonhg.NetBSD.org/src/rev/c0d42303268a
branches:  trunk
changeset: 486931:c0d42303268a
user:      perseant <perseant%NetBSD.org@localhost>
date:      Wed May 31 01:40:01 2000 +0000

description:
update for IN_ACCESSED changes

diffstat:

 sys/ufs/lfs/lfs.h         |   5 ++++-
 sys/ufs/lfs/lfs_alloc.c   |   6 +++---
 sys/ufs/lfs/lfs_bio.c     |   4 ++--
 sys/ufs/lfs/lfs_inode.c   |   8 ++++----
 sys/ufs/lfs/lfs_segment.c |  28 +++++++++++++++-------------
 sys/ufs/lfs/lfs_vnops.c   |   6 +++---
 6 files changed, 31 insertions(+), 26 deletions(-)

diffs (210 lines):

diff -r 7362e7a6deee -r c0d42303268a sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Wed May 31 01:11:58 2000 +0000
+++ b/sys/ufs/lfs/lfs.h Wed May 31 01:40:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.h,v 1.23 2000/05/27 00:19:52 perseant Exp $        */
+/*     $NetBSD: lfs.h,v 1.24 2000/05/31 01:40:01 perseant Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -89,6 +89,9 @@
 #define LFS_MAX_ACTIVE 10
 #define LFS_MAXDIROP   (desiredvnodes>>2)
 
+/* For convenience */
+#define IN_ALLMOD (IN_MODIFIED|IN_ACCESS|IN_CHANGE|IN_UPDATE|IN_ACCESSED|IN_CLEANING)
+
 #ifndef LFS_ATIME_IFILE
 # define LFS_ITIMES(ip, acc, mod, cre) FFS_ITIMES((ip),(acc),(mod),(cre))
 #else
diff -r 7362e7a6deee -r c0d42303268a sys/ufs/lfs/lfs_alloc.c
--- a/sys/ufs/lfs/lfs_alloc.c   Wed May 31 01:11:58 2000 +0000
+++ b/sys/ufs/lfs/lfs_alloc.c   Wed May 31 01:40:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_alloc.c,v 1.32 2000/05/27 00:19:52 perseant Exp $  */
+/*     $NetBSD: lfs_alloc.c,v 1.33 2000/05/31 01:40:02 perseant Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -339,10 +339,10 @@
        if (ip->i_flag & IN_CLEANING) {
                --fs->lfs_uinodes;
        }
-       if (ip->i_flag & IN_MODIFIED) {
+       if (ip->i_flag & (IN_MODIFIED | IN_ACCESSED)) {
                --fs->lfs_uinodes;
        }
-       ip->i_flag &= ~(IN_CLEANING | IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
+       ip->i_flag &= ~IN_ALLMOD;
 #ifdef DEBUG_LFS       
        if((int32_t)fs->lfs_uinodes<0) {
                printf("U1");
diff -r 7362e7a6deee -r c0d42303268a sys/ufs/lfs/lfs_bio.c
--- a/sys/ufs/lfs/lfs_bio.c     Wed May 31 01:11:58 2000 +0000
+++ b/sys/ufs/lfs/lfs_bio.c     Wed May 31 01:40:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_bio.c,v 1.20 2000/05/27 00:19:52 perseant Exp $    */
+/*     $NetBSD: lfs_bio.c,v 1.21 2000/05/31 01:40:02 perseant Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -250,7 +250,7 @@
                                ++fs->lfs_uinodes;
                        ip->i_flag |= IN_CLEANING;
                } else {
-                       if(!(ip->i_flag & IN_MODIFIED))
+                       if(!(ip->i_flag & (IN_MODIFIED | IN_ACCESSED))
                                ++fs->lfs_uinodes;
                        ip->i_flag |= IN_CHANGE | IN_MODIFIED | IN_UPDATE;
                }
diff -r 7362e7a6deee -r c0d42303268a sys/ufs/lfs/lfs_inode.c
--- a/sys/ufs/lfs/lfs_inode.c   Wed May 31 01:11:58 2000 +0000
+++ b/sys/ufs/lfs/lfs_inode.c   Wed May 31 01:40:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_inode.c,v 1.36 2000/05/13 23:43:15 perseant Exp $  */
+/*     $NetBSD: lfs_inode.c,v 1.37 2000/05/31 01:40:02 perseant Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -153,15 +153,15 @@
 #endif
                tsleep(vp, (PRIBIO+1), "lfs_update", 0);
        }
-       mod = ip->i_flag & IN_MODIFIED;
+       mod = ip->i_flag & (IN_MODIFIED | IN_ACCESSED);
        oflag = ip->i_flag;
        TIMEVAL_TO_TIMESPEC(&time, &ts);
        LFS_ITIMES(ip,
                   ap->a_access ? ap->a_access : &ts,
                   ap->a_modify ? ap->a_modify : &ts, &ts);
-       if (!mod && (ip->i_flag & IN_MODIFIED))
+       if (!mod && (ip->i_flag & (IN_MODIFIED | IN_ACCESSED)))
                ip->i_lfs->lfs_uinodes++;
-       if ((ip->i_flag & (IN_MODIFIED|IN_CLEANING)) == 0) {
+       if ((ip->i_flag & (IN_MODIFIED | IN_ACCESSED | IN_CLEANING)) == 0) {
                return (0);
        }
        
diff -r 7362e7a6deee -r c0d42303268a sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Wed May 31 01:11:58 2000 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Wed May 31 01:40:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.46 2000/05/27 00:19:53 perseant Exp $        */
+/*     $NetBSD: lfs_segment.c,v 1.47 2000/05/31 01:40:02 perseant Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -198,7 +198,7 @@
                ivndebug(vp,"vflush/in_cleaning");
 #endif
                ip->i_flag &= ~IN_CLEANING;
-               if(ip->i_flag & IN_MODIFIED) {
+               if(ip->i_flag & (IN_MODIFIED | IN_ACCESSED)) {
                        fs->lfs_uinodes--;
                } else
                        ip->i_flag |= IN_MODIFIED;
@@ -261,9 +261,9 @@
                splx(s);
                if(ip->i_flag & IN_CLEANING)
                        fs->lfs_uinodes--;
-               if(ip->i_flag & IN_MODIFIED)
+               if(ip->i_flag & (IN_MODIFIED | IN_ACCESSED))
                        fs->lfs_uinodes--;
-               ip->i_flag &= ~(IN_MODIFIED|IN_UPDATE|IN_ACCESS|IN_CHANGE|IN_CLEANING);
+               ip->i_flag &= ~IN_ALLMOD;
                printf("lfs_vflush: done not flushing ino %d\n",
                        ip->i_number);
                lfs_segunlock(fs);
@@ -288,7 +288,7 @@
                lfs_writevnodes(fs, vp->v_mount, sp, VN_CLEAN);
        }
        else if(lfs_dostats) {
-               if(vp->v_dirtyblkhd.lh_first || (VTOI(vp)->i_flag & (IN_MODIFIED|IN_UPDATE|IN_ACCESS|IN_CHANGE|IN_CLEANING)))
+               if(vp->v_dirtyblkhd.lh_first || (VTOI(vp)->i_flag & IN_ALLMOD))
                        ++lfs_stats.vflush_invoked;
 #ifdef DEBUG_LFS
                ivndebug(vp,"vflush");
@@ -429,11 +429,10 @@
                 * Write the inode/file if dirty and it's not the
                 * the IFILE.
                 */
-               if ((ip->i_flag &
-                    (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE | IN_CLEANING) ||
+               if ((ip->i_flag & IN_ALLMOD) ||
                     vp->v_dirtyblkhd.lh_first != NULL))
                {
-                       only_cleaning = ((ip->i_flag & (IN_ACCESS|IN_CHANGE|IN_MODIFIED|IN_UPDATE|IN_CLEANING))==IN_CLEANING);
+                       only_cleaning = ((ip->i_flag & IN_ALLMOD)==IN_CLEANING);
 
                        if(ip->i_number != LFS_IFILE_INUM
                           && vp->v_dirtyblkhd.lh_first != NULL)
@@ -445,7 +444,7 @@
 #ifdef DEBUG_LFS
                                        ivndebug(vp,"writevnodes/write2");
 #endif
-                               } else if(!(ip->i_flag & (IN_ACCESS|IN_CHANGE|IN_MODIFIED|IN_UPDATE|IN_CLEANING))) {
+                               } else if(!(ip->i_flag & IN_ALLMOD)) {
 #ifdef DEBUG_LFS
                                        printf("<%d>",ip->i_number);
 #endif
@@ -713,7 +712,7 @@
        struct timespec ts;
        int gotblk=0;
        
-       if (!(ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE | IN_CLEANING)))
+       if (!(ip->i_flag & IN_ALLMOD))
                return(0);
        
        /* Allocate a new inode block if necessary. */
@@ -745,15 +744,17 @@
        }
 
        /* Update the inode times and copy the inode onto the inode page. */
-       if (ip->i_flag & (IN_CLEANING|IN_MODIFIED))
+       if (ip->i_flag & (IN_CLEANING | IN_MODIFIED | IN_ACCESSED))
                --fs->lfs_uinodes;
        TIMEVAL_TO_TIMESPEC(&time, &ts);
        LFS_ITIMES(ip, &ts, &ts, &ts);
 
+       /* XXX IN_ALLMOD */
        if(ip->i_flag & IN_CLEANING)
                ip->i_flag &= ~IN_CLEANING;
        else
-               ip->i_flag &= ~(IN_ACCESS|IN_CHANGE|IN_MODIFIED|IN_UPDATE);
+               ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED |
+                               IN_UPDATE | IN_ACCESSED);
 
        /*
         * If this is the Ifile, and we've already written the Ifile in this
@@ -1447,7 +1448,8 @@
 #ifdef DEBUG_LFS
                                printf("lfs_writeseg: marking ino %d\n",ip->i_number);
 #endif
-                               if(!(ip->i_flag & (IN_CLEANING|IN_MODIFIED))) {
+                               if(!(ip->i_flag & (IN_CLEANING | IN_MODIFIED |
+                                                  IN_ACCESSED))) {
                                        fs->lfs_uinodes++;
                                        if(bp->b_flags & B_CALL)
                                                ip->i_flag |= IN_CLEANING;
diff -r 7362e7a6deee -r c0d42303268a sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Wed May 31 01:11:58 2000 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Wed May 31 01:40:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.37 2000/05/27 00:19:54 perseant Exp $  */
+/*     $NetBSD: lfs_vnops.c,v 1.38 2000/05/31 01:40:02 perseant Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -732,10 +732,10 @@
 
        simple_lock(&vp->v_interlock);
        if (vp->v_usecount > 1) {
-               mod = ip->i_flag & IN_MODIFIED;
+               mod = ip->i_flag & (IN_MODIFIED | IN_ACCESSED);
                TIMEVAL_TO_TIMESPEC(&time, &ts);
                LFS_ITIMES(ip, &ts, &ts, &ts);
-               if (!mod && ip->i_flag & IN_MODIFIED)
+               if (!mod && (ip->i_flag & (IN_MODIFIED | IN_ACCESSED)))
                        ip->i_lfs->lfs_uinodes++;
        }
        simple_unlock(&vp->v_interlock);



Home | Main Index | Thread Index | Old Index