diff -u --recursive --new-file v2.1.83/linux/Makefile linux/Makefile --- v2.1.83/linux/Makefile Fri Jan 30 11:28:05 1998 +++ linux/Makefile Fri Jan 30 15:51:34 1998 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 82 +SUBLEVEL = 84 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) diff -u --recursive --new-file v2.1.83/linux/fs/autofs/root.c linux/fs/autofs/root.c --- v2.1.83/linux/fs/autofs/root.c Thu Oct 30 15:49:33 1997 +++ linux/fs/autofs/root.c Fri Jan 30 16:59:43 1998 @@ -104,19 +104,27 @@ { struct inode * inode; struct autofs_dir_ent *ent; + int status = 0; - while (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name))) { - int status = autofs_wait(sbi, &dentry->d_name); + if ( !(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name)) ) { + do { + if ( status && dentry->d_inode ) { + printk("autofs: lookup failure on existing dentry, status = %d, name = %s\n", status, dentry->d_name.name); + printk("autofs: trying to recover, but prepare for Armageddon\n"); + break; + } - /* Turn this into a real negative dentry? */ - if (status == -ENOENT) { - dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT; - dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; - return 1; - } else if (status) { - /* Return a negative dentry, but leave it "pending" */ - return 1; - } + /* Turn this into a real negative dentry? */ + if (status == -ENOENT) { + dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT; + dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; + return 1; + } else if (status) { + /* Return a negative dentry, but leave it "pending" */ + return 1; + } + status = autofs_wait(sbi, &dentry->d_name); + } while (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name)) ); } /* Abuse this field as a pointer to the directory entry, used to diff -u --recursive --new-file v2.1.83/linux/fs/inode.c linux/fs/inode.c --- v2.1.83/linux/fs/inode.c Fri Jan 16 11:24:09 1998 +++ linux/fs/inode.c Fri Jan 30 16:43:11 1998 @@ -759,3 +759,12 @@ } return 1; /* Tis' cool bro. */ } + +void update_atime (struct inode *inode) +{ + if ( IS_NOATIME (inode) ) return; + if ( IS_NODIRATIME (inode) && S_ISDIR (inode->i_mode) ) return; + if ( IS_RDONLY (inode) ) return; + inode->i_atime = CURRENT_TIME; + mark_inode_dirty (inode); +} /* End Function update_atime */ diff -u --recursive --new-file v2.1.83/linux/fs/super.c linux/fs/super.c --- v2.1.83/linux/fs/super.c Fri Jan 23 18:10:32 1998 +++ linux/fs/super.c Fri Jan 30 16:43:11 1998 @@ -292,6 +292,7 @@ { MS_SYNCHRONOUS, ",sync" }, { MS_MANDLOCK, ",mand" }, { MS_NOATIME, ",noatime" }, + { MS_NODIRATIME, ",nodiratime" }, #ifdef MS_NOSUB /* Can't find this except in mount.c */ { MS_NOSUB, ",nosub" }, #endif diff -u --recursive --new-file v2.1.83/linux/include/linux/fs.h linux/include/linux/fs.h --- v2.1.83/linux/include/linux/fs.h Tue Jan 20 16:51:56 1998 +++ linux/include/linux/fs.h Fri Jan 30 16:52:12 1998 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -90,11 +91,12 @@ #define S_APPEND 256 /* Append-only file */ #define S_IMMUTABLE 512 /* Immutable file */ #define MS_NOATIME 1024 /* Do not update access times. */ +#define MS_NODIRATIME 2048 /* Do not update directory access times */ /* * Flags that can be altered by MS_REMOUNT */ -#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME) +#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME) /* * Magic mount flag number. Has to be or-ed to the flag values. @@ -121,12 +123,10 @@ #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME) +#define IS_NODIRATIME(inode) ((inode)->i_flags & MS_NODIRATIME) -#define UPDATE_ATIME(inode) \ - if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \ - inode->i_atime = CURRENT_TIME; \ - mark_inode_dirty(inode); \ - } +extern void update_atime (struct inode *inode); +#define UPDATE_ATIME(inode) update_atime (inode) /* the read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */ @@ -313,6 +313,7 @@ #define ATTR_FLAG_NOATIME 2 /* Don't update atime */ #define ATTR_FLAG_APPEND 4 /* Append-only file */ #define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */ +#define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */ #include diff -u --recursive --new-file v2.1.83/linux/mm/filemap.c linux/mm/filemap.c --- v2.1.83/linux/mm/filemap.c Mon Jan 19 13:47:27 1998 +++ linux/mm/filemap.c Fri Jan 30 16:55:49 1998 @@ -751,7 +751,7 @@ filp->f_reada = 1; if (page_cache) free_page(page_cache); - UPDATE_ATIME(inode) + UPDATE_ATIME(inode); if (!read) read = error; return read;