VERSION = 2
PATCHLEVEL = 1
-SUBLEVEL = 82
+SUBLEVEL = 84
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
{
struct inode * inode;
struct autofs_dir_ent *ent;
-
- while (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name))) {
- int status = autofs_wait(sbi, &dentry->d_name);
-
- /* 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;
- }
+ int status = 0;
+
+ 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;
+ }
+ 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
}
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 */
{ 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
#include <linux/ioctl.h>
#include <linux/list.h>
#include <linux/dcache.h>
+#include <linux/stat.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
#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.
#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. */
#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 <linux/quota.h>
filp->f_reada = 1;
if (page_cache)
free_page(page_cache);
- UPDATE_ATIME(inode)
+ UPDATE_ATIME(inode);
if (!read)
read = error;
return read;