Commit 9ba95981 authored by Linus Torvalds's avatar Linus Torvalds

Linux 2.1.84

- Update makefile version (forgot to in .83)
- fixes a (very obscure, possibly never happens) autofs bug.
- fix missing ; compile error in mm/filemap.c
- MS_NODIRATIME support.

[changelog summary by davej]
parent 3ebce212
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 82
SUBLEVEL = 84
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
......@@ -104,19 +104,27 @@ static int try_to_fill_dentry(struct dentry *dentry, struct super_block *sb, str
{
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
......
......@@ -759,3 +759,12 @@ int fs_may_remount_ro(struct super_block *sb)
}
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 */
......@@ -292,6 +292,7 @@ static struct proc_fs_info {
{ 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
......
......@@ -17,6 +17,7 @@
#include <linux/ioctl.h>
#include <linux/list.h>
#include <linux/dcache.h>
#include <linux/stat.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
......@@ -90,11 +91,12 @@ extern int max_files, nr_files, nr_free_files;
#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 @@ extern int max_files, nr_files, nr_free_files;
#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 @@ struct iattr {
#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>
......
......@@ -751,7 +751,7 @@ ssize_t generic_file_read(struct file * filp, char * buf,
filp->f_reada = 1;
if (page_cache)
free_page(page_cache);
UPDATE_ATIME(inode)
UPDATE_ATIME(inode);
if (!read)
read = error;
return read;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment