diff -urN linux-2.1.82/fs/inode.c linux/fs/inode.c --- linux-2.1.82/fs/inode.c Sat Jan 17 06:24:09 1998 +++ linux/fs/inode.c Sat Jan 31 11:27:22 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 -urN linux-2.1.82/fs/super.c linux/fs/super.c --- linux-2.1.82/fs/super.c Thu Jan 22 09:29:34 1998 +++ linux/fs/super.c Tue Jan 27 12:05:16 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 -urN linux-2.1.82/include/linux/fs.h linux/include/linux/fs.h --- linux-2.1.82/include/linux/fs.h Sat Jan 24 12:18:35 1998 +++ linux/include/linux/fs.h Sat Jan 31 11:28:32 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