kernel/ksyms.c | 1
12 files changed, 558 insertions(+), 128 deletions(-)
-Index: kernel-2.4.212lgns/fs/dcache.c
+Index: linux-2.4.21-x86_64/fs/dcache.c
===================================================================
---- kernel-2.4.212lgns.orig/fs/dcache.c 2003-10-28 10:33:59.000000000 -0800
-+++ kernel-2.4.212lgns/fs/dcache.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/fs/dcache.c 2003-10-28 10:33:59.000000000 -0800
++++ linux-2.4.21-x86_64/fs/dcache.c 2004-04-12 19:57:36.000000000 -0700
@@ -186,6 +186,13 @@
spin_unlock(&dcache_lock);
return 0;
}
#define do_switch(x,y) do { \
-Index: kernel-2.4.212lgns/fs/exec.c
+Index: linux-2.4.21-x86_64/fs/exec.c
===================================================================
---- kernel-2.4.212lgns.orig/fs/exec.c 2003-10-28 10:34:17.000000000 -0800
-+++ kernel-2.4.212lgns/fs/exec.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/fs/exec.c 2003-10-28 10:34:17.000000000 -0800
++++ linux-2.4.21-x86_64/fs/exec.c 2004-04-12 19:57:36.000000000 -0700
@@ -112,8 +112,10 @@
struct file * file;
struct nameidata nd;
goto close_fail;
retval = binfmt->core_dump(signr, regs, file);
-Index: kernel-2.4.212lgns/fs/namei.c
+Index: linux-2.4.21-x86_64/fs/namei.c
===================================================================
---- kernel-2.4.212lgns.orig/fs/namei.c 2003-10-28 10:34:18.000000000 -0800
-+++ kernel-2.4.212lgns/fs/namei.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/fs/namei.c 2003-10-28 10:34:18.000000000 -0800
++++ linux-2.4.21-x86_64/fs/namei.c 2004-04-12 19:58:44.000000000 -0700
@@ -94,6 +94,13 @@
* XEmacs seems to be relying on it...
*/
struct dentry * dentry = d_lookup(parent, name);
+ if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
-+ if (!dentry->d_op->d_revalidate_it(dentry, flags, NULL, it) &&
++ if (!dentry->d_op->d_revalidate_it(dentry, flags, it) &&
+ !d_invalidate(dentry)) {
+ dput(dentry);
+ dentry = NULL;
if (dentry) {
lock_kernel();
+ if (dir->i_op->lookup_it)
-+ result = dir->i_op->lookup_it(dir, dentry, NULL, it, flags);
++ result = dir->i_op->lookup_it(dir, dentry, it, flags);
+ else
result = dir->i_op->lookup(dir, dentry);
unlock_kernel();
result = ERR_PTR(-ENOENT);
}
+ } else if (result->d_op && result->d_op->d_revalidate_it) {
-+ if (!result->d_op->d_revalidate_it(result, flags, NULL, it) &&
++ if (!result->d_op->d_revalidate_it(result, flags, it) &&
+ !d_invalidate(result)) {
+ dput(result);
+ if (counter > 10)
break;
}
goto return_base;
-@@ -643,6 +680,27 @@
+@@ -637,12 +672,42 @@
+ nd->last_type = LAST_DOT;
+ else if (this.len == 2 && this.name[1] == '.')
+ nd->last_type = LAST_DOTDOT;
++ else
++ goto return_base;
+ return_reval:
+ /*
+ * We bypassed the ordinary revalidation routines.
* Check the cached dentry for staleness.
*/
dentry = nd->dentry;
+ if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
+ err = -ESTALE;
-+ if (!dentry->d_op->d_revalidate_it(dentry, 0, NULL, it)) {
++ if (!dentry->d_op->d_revalidate_it(dentry, 0, it)) {
+ struct dentry *new;
+ err = permission(dentry->d_parent->d_inode,
+ MAY_EXEC);
+ }
+ if (!nd->dentry->d_inode)
+ goto no_inode;
++ if (lookup_flags & LOOKUP_DIRECTORY) {
++ err = -ENOTDIR;
++ if (!nd->dentry->d_inode->i_op ||
++ (!nd->dentry->d_inode->i_op->lookup &&
++ !nd->dentry->d_inode->i_op->lookup_it))
++ break;
++ }
+ } else
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
err = -ESTALE;
dput(dentry);
break;
}
-+ if (err)
-+ intent_release(it);
++ if (err)
++ intent_release(it);
path_release(nd);
return_err:
return err;
goto out;
lock_kernel();
+ if (inode->i_op->lookup_it)
-+ dentry = inode->i_op->lookup_it(inode, new, NULL, it, 0);
++ dentry = inode->i_op->lookup_it(inode, new, it, 0);
+ else
dentry = inode->i_op->lookup(inode, new);
unlock_kernel();
if (page) {
kunmap(page);
page_cache_release(page);
-Index: kernel-2.4.212lgns/fs/namespace.c
+Index: linux-2.4.21-x86_64/fs/namespace.c
===================================================================
---- kernel-2.4.212lgns.orig/fs/namespace.c 2003-10-28 10:34:12.000000000 -0800
-+++ kernel-2.4.212lgns/fs/namespace.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/fs/namespace.c 2003-10-28 10:34:12.000000000 -0800
++++ linux-2.4.21-x86_64/fs/namespace.c 2004-04-12 19:57:36.000000000 -0700
@@ -98,6 +98,7 @@
{
old_nd->dentry = mnt->mnt_mountpoint;
list_add(&mnt->mnt_hash, mount_hashtable+hash(nd->mnt, nd->dentry));
list_add(&mnt->mnt_child, &nd->mnt->mnt_mounts);
nd->dentry->d_mounted++;
-@@ -286,7 +288,7 @@
- }
- }
-
--static int do_umount(struct vfsmount *mnt, int flags)
-+int do_umount(struct vfsmount *mnt, int flags)
- {
- struct super_block * sb = mnt->mnt_sb;
- int retval = 0;
@@ -488,14 +490,17 @@
{
struct nameidata old_nd;
int retval = 0;
int mnt_flags = 0;
-@@ -725,9 +732,11 @@
+@@ -725,10 +732,11 @@
flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV);
/* ... and get the mountpoint */
+ if (retval) {
+ intent_release(&it);
return retval;
+-
+ }
-
if (flags & MS_REMOUNT)
retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
-@@ -739,6 +748,8 @@
+ data_page);
+@@ -739,6 +747,8 @@
else
retval = do_add_mount(&nd, type_page, flags, mnt_flags,
dev_name, data_page);
path_release(&nd);
return retval;
}
-@@ -904,6 +915,8 @@
+@@ -904,6 +914,8 @@
{
struct vfsmount *tmp;
struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd;
int error;
if (!capable(CAP_SYS_ADMIN))
-@@ -911,14 +924,14 @@
+@@ -911,14 +923,14 @@
lock_kernel();
if (error)
goto out1;
-@@ -973,8 +986,10 @@
+@@ -973,8 +985,10 @@
up(&old_nd.dentry->d_inode->i_zombie);
up_write(¤t->namespace->sem);
path_release(&user_nd);
path_release(&new_nd);
out0:
unlock_kernel();
-Index: kernel-2.4.212lgns/fs/open.c
+Index: linux-2.4.21-x86_64/fs/open.c
===================================================================
---- kernel-2.4.212lgns.orig/fs/open.c 2003-10-28 10:33:59.000000000 -0800
-+++ kernel-2.4.212lgns/fs/open.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/fs/open.c 2003-10-28 10:33:59.000000000 -0800
++++ linux-2.4.21-x86_64/fs/open.c 2004-04-12 19:57:36.000000000 -0700
@@ -19,6 +19,8 @@
#include <asm/uaccess.h>
/*
* Find an empty file descriptor entry, and mark it busy.
*/
-Index: kernel-2.4.212lgns/fs/stat.c
+Index: linux-2.4.21-x86_64/fs/stat.c
===================================================================
---- kernel-2.4.212lgns.orig/fs/stat.c 2003-10-28 10:33:58.000000000 -0800
-+++ kernel-2.4.212lgns/fs/stat.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/fs/stat.c 2003-10-28 10:33:58.000000000 -0800
++++ linux-2.4.21-x86_64/fs/stat.c 2004-04-12 19:58:44.000000000 -0700
@@ -17,10 +17,12 @@
* Revalidate the inode. This is required for proper NFS attribute caching.
*/
if (!err)
err = cp_new_stat64(dentry->d_inode, statbuf);
fput(f);
-Index: kernel-2.4.212lgns/include/linux/dcache.h
+Index: linux-2.4.21-x86_64/include/linux/dcache.h
===================================================================
---- kernel-2.4.212lgns.orig/include/linux/dcache.h 2003-11-10 16:44:28.000000000 -0800
-+++ kernel-2.4.212lgns/include/linux/dcache.h 2004-05-11 06:41:10.000000000 -0700
-@@ -7,6 +7,52 @@
+--- linux-2.4.21-x86_64.orig/include/linux/dcache.h 2003-11-10 16:44:28.000000000 -0800
++++ linux-2.4.21-x86_64/include/linux/dcache.h 2004-04-12 19:57:36.000000000 -0700
+@@ -7,6 +7,51 @@
#include <linux/gdb.h>
#include <linux/mount.h>
#include <linux/kernel.h>
+#define IT_GETXATTR 0x0040
+#define IT_EXEC 0x0080
+#define IT_PIN 0x0100
-+#define IT_CHDIR 0x0200
+
+#define IT_FL_LOCKED 0x0001
+#define IT_FL_FOLLOWED 0x0002 /* set by vfs_follow_link */
/*
* linux/include/linux/dcache.h
-@@ -87,6 +133,8 @@
- unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
- };
-
-+struct nameidata;
-+
- struct dentry_operations {
- int (*d_revalidate)(struct dentry *, int);
- int (*d_hash) (struct dentry *, struct qstr *);
-@@ -94,8 +142,22 @@
+@@ -94,8 +139,22 @@
int (*d_delete)(struct dentry *);
void (*d_release)(struct dentry *);
void (*d_iput)(struct dentry *, struct inode *);
-+ int (*d_revalidate_it)(struct dentry *, int, struct nameidata *, struct lookup_intent *);
++ int (*d_revalidate_it)(struct dentry *, int, struct lookup_intent *);
+ void (*d_pin)(struct dentry *, struct vfsmount * , int);
+ void (*d_unpin)(struct dentry *, struct vfsmount *, int);
};
/* the dentry parameter passed to d_hash and d_compare is the parent
* directory of the entries to be compared. It is used in case these
* functions need any directory specific information for determining
-@@ -127,6 +189,7 @@
+@@ -127,6 +186,7 @@
* s_nfsd_free_path semaphore will be down
*/
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
extern spinlock_t dcache_lock;
-Index: kernel-2.4.212lgns/include/linux/fs.h
+Index: linux-2.4.21-x86_64/include/linux/fs.h
===================================================================
---- kernel-2.4.212lgns.orig/include/linux/fs.h 2004-05-11 06:37:51.000000000 -0700
-+++ kernel-2.4.212lgns/include/linux/fs.h 2004-05-11 06:48:41.000000000 -0700
+--- linux-2.4.21-x86_64.orig/include/linux/fs.h 2004-04-12 19:57:33.000000000 -0700
++++ linux-2.4.21-x86_64/include/linux/fs.h 2004-04-12 19:57:36.000000000 -0700
@@ -74,6 +74,7 @@
#define FMODE_READ 1
int (*create) (struct inode *,struct dentry *,int);
+ int (*create_it) (struct inode *,struct dentry *,int, struct lookup_intent *);
struct dentry * (*lookup) (struct inode *,struct dentry *);
-+ struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct nameidata *, struct lookup_intent *, int flags);
++ struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct lookup_intent *, int flags);
int (*link) (struct dentry *,struct inode *,struct dentry *);
+ int (*link_raw) (struct nameidata *,struct nameidata *);
int (*unlink) (struct inode *,struct dentry *);
int (*getattr) (struct dentry *, struct iattr *);
int (*setxattr) (struct dentry *, const char *, const void *, size_t, int);
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
-@@ -1046,6 +1065,7 @@
- int (*remount_fs) (struct super_block *, int *, char *);
- void (*clear_inode) (struct inode *);
- void (*umount_begin) (struct super_block *);
-+ void (*umount_lustre) (struct super_block *);
-
- /* Following are for knfsd to interact with "interesting" filesystems
- * Currently just reiserfs, but possibly FAT and others later
-@@ -1205,10 +1225,16 @@
+@@ -1205,10 +1224,14 @@
asmlinkage long sys_open(const char *, int, int);
asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */
-extern int do_truncate(struct dentry *, loff_t start);
+extern int do_truncate(struct dentry *, loff_t start, int called_from_open);
-+struct dentry *lookup_create(struct nameidata *nd, int is_dir,
-+ struct lookup_intent *it);
extern struct file *filp_open(const char *, int, int);
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
extern int filp_close(struct file *, fl_owner_t id);
extern char * getname(const char *);
-@@ -1504,6 +1530,7 @@
+@@ -1504,6 +1527,7 @@
extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
extern int FASTCALL(path_walk(const char *, struct nameidata *));
extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
-@@ -1516,6 +1543,8 @@
+@@ -1516,6 +1540,8 @@
extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
#define user_path_walk(name,nd) __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
#define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
extern void inode_init_once(struct inode *);
extern void _inode_init_once(struct inode *);
-@@ -1667,6 +1696,8 @@
+@@ -1667,6 +1693,8 @@
extern int vfs_readlink(struct dentry *, char *, int, const char *);
extern int vfs_follow_link(struct nameidata *, const char *);
extern int page_readlink(struct dentry *, char *, int);
extern int page_follow_link(struct dentry *, struct nameidata *);
extern struct inode_operations page_symlink_inode_operations;
-Index: kernel-2.4.212lgns/include/linux/fs_struct.h
+Index: linux-2.4.21-x86_64/include/linux/fs_struct.h
===================================================================
---- kernel-2.4.212lgns.orig/include/linux/fs_struct.h 2001-07-13 15:10:44.000000000 -0700
-+++ kernel-2.4.212lgns/include/linux/fs_struct.h 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/include/linux/fs_struct.h 2001-07-13 15:10:44.000000000 -0700
++++ linux-2.4.21-x86_64/include/linux/fs_struct.h 2004-04-12 19:57:36.000000000 -0700
@@ -34,10 +34,12 @@
write_lock(&fs->lock);
old_root = fs->root;
dput(old_pwd);
mntput(old_pwdmnt);
}
-Index: kernel-2.4.212lgns/include/linux/mount.h
-===================================================================
---- kernel-2.4.212lgns.orig/include/linux/mount.h 2003-11-06 14:18:54.000000000 -0800
-+++ kernel-2.4.212lgns/include/linux/mount.h 2004-05-11 06:41:10.000000000 -0700
-@@ -29,6 +29,8 @@
- int mnt_flags;
- char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
- struct list_head mnt_list;
-+ struct list_head mnt_lustre_list; /* GNS mount list */
-+ unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
- };
-
- static inline struct vfsmount *mntget(struct vfsmount *mnt)
-@@ -39,6 +41,7 @@
- }
-
- extern void __mntput(struct vfsmount *mnt);
-+extern int do_umount(struct vfsmount *mnt, int flags);
-
- static inline void mntput(struct vfsmount *mnt)
- {
-Index: kernel-2.4.212lgns/kernel/exit.c
+Index: linux-2.4.21-x86_64/kernel/exit.c
===================================================================
---- kernel-2.4.212lgns.orig/kernel/exit.c 2003-10-28 10:34:13.000000000 -0800
-+++ kernel-2.4.212lgns/kernel/exit.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/kernel/exit.c 2003-10-28 10:34:13.000000000 -0800
++++ linux-2.4.21-x86_64/kernel/exit.c 2004-04-12 19:57:36.000000000 -0700
@@ -288,11 +288,14 @@
{
/* No need to hold fs->lock if we are killing it */
dput(fs->altroot);
mntput(fs->altrootmnt);
}
-Index: kernel-2.4.212lgns/kernel/fork.c
+Index: linux-2.4.21-x86_64/kernel/fork.c
===================================================================
---- kernel-2.4.212lgns.orig/kernel/fork.c 2003-10-28 10:34:17.000000000 -0800
-+++ kernel-2.4.212lgns/kernel/fork.c 2004-05-11 06:41:10.000000000 -0700
+--- linux-2.4.21-x86_64.orig/kernel/fork.c 2003-10-28 10:34:17.000000000 -0800
++++ linux-2.4.21-x86_64/kernel/fork.c 2004-04-12 19:57:36.000000000 -0700
@@ -461,10 +461,13 @@
fs->umask = old->umask;
read_lock(&old->lock);
fs->altrootmnt = mntget(old->altrootmnt);
fs->altroot = dget(old->altroot);
} else {
-Index: kernel-2.4.212lgns/kernel/ksyms.c
+Index: linux-2.4.21-x86_64/kernel/ksyms.c
===================================================================
---- kernel-2.4.212lgns.orig/kernel/ksyms.c 2004-05-11 06:37:51.000000000 -0700
-+++ kernel-2.4.212lgns/kernel/ksyms.c 2004-05-11 06:41:10.000000000 -0700
-@@ -327,6 +327,9 @@
+--- linux-2.4.21-x86_64.orig/kernel/ksyms.c 2004-04-12 19:57:33.000000000 -0700
++++ linux-2.4.21-x86_64/kernel/ksyms.c 2004-04-12 19:57:36.000000000 -0700
+@@ -327,6 +327,7 @@
EXPORT_SYMBOL(set_page_dirty);
EXPORT_SYMBOL(vfs_readlink);
EXPORT_SYMBOL(vfs_follow_link);
+EXPORT_SYMBOL(vfs_follow_link_it);
-+EXPORT_SYMBOL(do_umount);
-+EXPORT_SYMBOL(lookup_create);
EXPORT_SYMBOL(page_readlink);
EXPORT_SYMBOL(page_follow_link);
EXPORT_SYMBOL(page_symlink_inode_operations);