kernel/ksyms.c | 1
12 files changed, 558 insertions(+), 128 deletions(-)
-Index: linux-2.4.21-suse2/fs/dcache.c
+Index: kernel-2.4.212lgns/fs/dcache.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/dcache.c 2003-10-28 21:33:59.000000000 +0300
-+++ linux-2.4.21-suse2/fs/dcache.c 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -186,6 +186,13 @@
spin_unlock(&dcache_lock);
return 0;
}
#define do_switch(x,y) do { \
-Index: linux-2.4.21-suse2/fs/exec.c
+Index: kernel-2.4.212lgns/fs/exec.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/exec.c 2003-10-28 21:34:17.000000000 +0300
-+++ linux-2.4.21-suse2/fs/exec.c 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -112,8 +112,10 @@
struct file * file;
struct nameidata nd;
goto close_fail;
retval = binfmt->core_dump(signr, regs, file);
-Index: linux-2.4.21-suse2/fs/namei.c
+Index: kernel-2.4.212lgns/fs/namei.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/namei.c 2004-01-10 12:06:40.000000000 +0300
-+++ linux-2.4.21-suse2/fs/namei.c 2004-01-10 12:44:04.000000000 +0300
+--- 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
@@ -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, it) &&
++ if (!dentry->d_op->d_revalidate_it(dentry, flags, NULL, 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, it, flags);
++ result = dir->i_op->lookup_it(dir, dentry, NULL, 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, it) &&
++ if (!result->d_op->d_revalidate_it(result, flags, NULL, it) &&
+ !d_invalidate(result)) {
+ dput(result);
+ if (counter > 10)
break;
}
goto return_base;
-@@ -643,6 +680,25 @@
+@@ -643,6 +680,27 @@
* 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, it)) {
++ if (!dentry->d_op->d_revalidate_it(dentry, 0, NULL, it)) {
+ struct dentry *new;
+ err = permission(dentry->d_parent->d_inode,
-+ MAY_EXEC);
++ MAY_EXEC);
+ if (err)
+ break;
+ new = real_lookup(dentry->d_parent,
-+ &dentry->d_name, 0, NULL);
-+ d_invalidate(dentry);
-+ dput(dentry);
-+ if (IS_ERR(new)) {
++ &dentry->d_name, 0, it);
++ if (IS_ERR(new)) {
+ err = PTR_ERR(new);
+ break;
+ }
++ d_invalidate(dentry);
++ dput(dentry);
+ nd->dentry = new;
+ }
++ if (!nd->dentry->d_inode)
++ goto no_inode;
+ } else
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
err = -ESTALE;
if (!dentry->d_op->d_revalidate(dentry, lookup_flags & LOOKUP_PARENT)) {
-@@ -656,6 +712,8 @@
+@@ -656,6 +714,8 @@
dput(dentry);
break;
}
-+ if (err)
-+ intent_release(it);
++ if (err)
++ intent_release(it);
path_release(nd);
return_err:
return err;
-@@ -663,7 +721,7 @@
+@@ -663,13 +723,13 @@
int link_path_walk(const char * name, struct nameidata *nd)
{
}
static inline int __path_walk(const char * name, struct nameidata *nd)
-@@ -677,6 +735,11 @@
+ {
+ current->total_link_count = 0;
+- return __link_path_walk(name, nd);
++ return __link_path_walk_it(name, nd, NULL);
+ }
+
+ int path_walk(const char * name, struct nameidata *nd)
+@@ -677,6 +737,12 @@
return __path_walk(name, nd);
}
+int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it)
+{
-+ return __path_walk(name, nd, it);
++ current->total_link_count = 0;
++ return __link_path_walk_it(name, nd, it);
+}
+
/* SMP-safe */
/* returns 1 if everything is done */
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
-@@ -759,6 +822,17 @@
+@@ -759,6 +825,17 @@
}
/* SMP-safe */
int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
{
int error = 0;
-@@ -773,6 +847,7 @@
+@@ -773,6 +850,7 @@
{
nd->last_type = LAST_ROOT; /* if there are only slashes... */
nd->flags = flags;
if (*name=='/')
return walk_init_root(name,nd);
read_lock(¤t->fs->lock);
-@@ -787,7 +862,8 @@
+@@ -787,7 +865,8 @@
* needs parent already locked. Doesn't follow mounts.
* SMP-safe.
*/
{
struct dentry * dentry;
struct inode *inode;
-@@ -810,13 +886,16 @@
+@@ -810,13 +889,16 @@
goto out;
}
goto out;
lock_kernel();
+ if (inode->i_op->lookup_it)
-+ dentry = inode->i_op->lookup_it(inode, new, it, 0);
++ dentry = inode->i_op->lookup_it(inode, new, NULL, it, 0);
+ else
dentry = inode->i_op->lookup(inode, new);
unlock_kernel();
if (!dentry)
-@@ -828,6 +907,12 @@
+@@ -828,6 +910,12 @@
return dentry;
}
/* SMP-safe */
struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
{
-@@ -849,7 +934,7 @@
+@@ -849,7 +937,7 @@
}
this.hash = end_name_hash(hash);
access:
return ERR_PTR(-EACCES);
}
-@@ -880,6 +965,23 @@
+@@ -880,6 +968,23 @@
return err;
}
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -977,7 +1079,8 @@
+@@ -977,7 +1082,8 @@
return retval;
}
{
int error;
-@@ -990,12 +1093,15 @@
+@@ -990,12 +1096,15 @@
goto exit_lock;
error = -EACCES; /* shouldn't it be ENOSYS? */
unlock_kernel();
exit_lock:
up(&dir->i_zombie);
-@@ -1004,6 +1110,11 @@
+@@ -1004,6 +1113,11 @@
return error;
}
/*
* open_namei()
*
-@@ -1018,7 +1129,8 @@
+@@ -1018,7 +1132,8 @@
* for symlinks (where the permissions are checked later).
* SMP-safe
*/
{
int acc_mode, error = 0;
struct inode *inode;
-@@ -1028,11 +1140,14 @@
+@@ -1028,11 +1143,14 @@
acc_mode = ACC_MODE(flag);
if (error)
return error;
dentry = nd->dentry;
-@@ -1042,6 +1157,10 @@
+@@ -1042,6 +1160,10 @@
/*
* Create - we need to know the parent.
*/
error = path_lookup(pathname, LOOKUP_PARENT, nd);
if (error)
return error;
-@@ -1057,7 +1176,7 @@
+@@ -1057,7 +1179,7 @@
dir = nd->dentry;
down(&dir->d_inode->i_sem);
do_last:
error = PTR_ERR(dentry);
-@@ -1066,11 +1185,12 @@
+@@ -1066,11 +1188,12 @@
goto exit;
}
up(&dir->d_inode->i_sem);
#ifndef DENTRY_WASTE_RAM
if (error)
-@@ -1178,7 +1298,7 @@
+@@ -1178,7 +1301,7 @@
if (!error) {
DQUOT_INIT(inode);
}
put_write_access(inode);
if (error)
-@@ -1190,8 +1310,10 @@
+@@ -1190,8 +1313,10 @@
return 0;
exit_dput:
path_release(nd);
return error;
-@@ -1210,7 +1332,10 @@
+@@ -1210,7 +1335,10 @@
* are done. Procfs-like symlinks just set LAST_BIND.
*/
UPDATE_ATIME(dentry->d_inode);
dput(dentry);
if (error)
return error;
-@@ -1232,13 +1357,20 @@
+@@ -1232,13 +1360,20 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
{
struct dentry *dentry;
-@@ -1246,7 +1378,7 @@
+@@ -1246,7 +1381,7 @@
dentry = ERR_PTR(-EEXIST);
if (nd->last_type != LAST_NORM)
goto fail;
if (IS_ERR(dentry))
goto fail;
if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
-@@ -1302,7 +1434,16 @@
+@@ -1302,7 +1437,20 @@
error = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (error)
goto out;
- dentry = lookup_create(&nd, 0);
+
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out2;
++ }
+ if (nd.dentry->d_inode->i_op->mknod_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->mknod_raw(&nd, mode, dev);
error = PTR_ERR(dentry);
if (!IS_POSIXACL(nd.dentry->d_inode))
-@@ -1324,6 +1465,7 @@
+@@ -1324,6 +1472,7 @@
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
putname(tmp);
-@@ -1371,7 +1513,14 @@
+@@ -1371,7 +1520,18 @@
error = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (error)
goto out;
- dentry = lookup_create(&nd, 1);
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out2;
++ }
+ if (nd.dentry->d_inode->i_op->mkdir_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->mkdir_raw(&nd, mode);
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
if (!IS_POSIXACL(nd.dentry->d_inode))
-@@ -1380,6 +1529,7 @@
+@@ -1380,6 +1540,7 @@
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
putname(tmp);
-@@ -1480,8 +1630,16 @@
+@@ -1480,8 +1641,16 @@
error = -EBUSY;
goto exit1;
}
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
error = vfs_rmdir(nd.dentry->d_inode, dentry);
-@@ -1539,8 +1697,15 @@
+@@ -1539,8 +1708,15 @@
error = -EISDIR;
if (nd.last_type != LAST_NORM)
goto exit1;
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
/* Why not before? Because we want correct error value */
-@@ -1607,15 +1772,23 @@
+@@ -1607,15 +1783,27 @@
error = path_lookup(to, LOOKUP_PARENT, &nd);
if (error)
goto out;
- dentry = lookup_create(&nd, 0);
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out2;
++ }
+ if (nd.dentry->d_inode->i_op->symlink_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->symlink_raw(&nd, from);
putname(to);
}
putname(from);
-@@ -1691,7 +1864,14 @@
+@@ -1691,7 +1879,18 @@
error = -EXDEV;
if (old_nd.mnt != nd.mnt)
goto out_release;
- new_dentry = lookup_create(&nd, 0);
++ if (nd.last_type != LAST_NORM) {
++ error = -EEXIST;
++ goto out_release;
++ }
+ if (nd.dentry->d_inode->i_op->link_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
+ error = op->link_raw(&old_nd, &nd);
error = PTR_ERR(new_dentry);
if (!IS_ERR(new_dentry)) {
error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
-@@ -1735,7 +1915,7 @@
+@@ -1735,7 +1934,7 @@
* locking].
*/
int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
struct inode *target;
-@@ -1814,7 +1994,7 @@
+@@ -1814,7 +2013,7 @@
}
int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
-@@ -1902,9 +2082,18 @@
+@@ -1902,9 +2101,18 @@
if (newnd.last_type != LAST_NORM)
goto exit2;
error = PTR_ERR(old_dentry);
if (IS_ERR(old_dentry))
goto exit3;
-@@ -1920,16 +2109,16 @@
+@@ -1920,16 +2128,16 @@
if (newnd.last.name[newnd.last.len])
goto exit4;
}
dput(new_dentry);
exit4:
dput(old_dentry);
-@@ -1980,20 +2169,26 @@
+@@ -1980,20 +2188,26 @@
}
static inline int
out:
if (current->link_count || res || nd->last_type!=LAST_NORM)
return res;
-@@ -2017,7 +2212,13 @@
+@@ -2017,7 +2231,13 @@
int vfs_follow_link(struct nameidata *nd, const char *link)
{
}
/* get the link contents into pagecache */
-@@ -2059,7 +2260,7 @@
+@@ -2059,7 +2279,7 @@
{
struct page *page = NULL;
char *s = page_getlink(dentry, &page);
if (page) {
kunmap(page);
page_cache_release(page);
-Index: linux-2.4.21-suse2/fs/namespace.c
+Index: kernel-2.4.212lgns/fs/namespace.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/namespace.c 2003-10-28 21:34:12.000000000 +0300
-+++ linux-2.4.21-suse2/fs/namespace.c 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -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,10 +732,11 @@
+@@ -725,9 +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,
- data_page);
-@@ -739,6 +747,8 @@
+@@ -739,6 +748,8 @@
else
retval = do_add_mount(&nd, type_page, flags, mnt_flags,
dev_name, data_page);
path_release(&nd);
return retval;
}
-@@ -904,6 +914,8 @@
+@@ -904,6 +915,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 +923,14 @@
+@@ -911,14 +924,14 @@
lock_kernel();
if (error)
goto out1;
-@@ -973,8 +985,10 @@
+@@ -973,8 +986,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: linux-2.4.21-suse2/fs/open.c
+Index: kernel-2.4.212lgns/fs/open.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/open.c 2003-10-28 21:33:59.000000000 +0300
-+++ linux-2.4.21-suse2/fs/open.c 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -19,6 +19,8 @@
#include <asm/uaccess.h>
- error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
- LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
+ error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
-+ LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
++ LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
if (error)
goto out;
/*
* Find an empty file descriptor entry, and mark it busy.
*/
-Index: linux-2.4.21-suse2/fs/stat.c
+Index: kernel-2.4.212lgns/fs/stat.c
===================================================================
---- linux-2.4.21-suse2.orig/fs/stat.c 2003-10-28 21:33:58.000000000 +0300
-+++ linux-2.4.21-suse2/fs/stat.c 2004-01-10 12:15:41.000000000 +0300
-@@ -17,10 +17,14 @@
+--- 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
+@@ -17,10 +17,12 @@
* Revalidate the inode. This is required for proper NFS attribute caching.
*/
static __inline__ int
{
struct inode * inode = dentry->d_inode;
- if (inode->i_op && inode->i_op->revalidate)
-+ if (!inode)
-+ return -ENOENT;
+ if (inode->i_op && inode->i_op->revalidate_it)
+ return inode->i_op->revalidate_it(dentry, it);
+ else if (inode->i_op && inode->i_op->revalidate)
return inode->i_op->revalidate(dentry);
return 0;
}
-@@ -141,13 +145,15 @@
+@@ -141,13 +143,15 @@
asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -157,13 +163,15 @@
+@@ -157,13 +161,15 @@
asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -178,13 +186,15 @@
+@@ -178,13 +184,15 @@
asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -195,13 +205,15 @@
+@@ -195,13 +203,15 @@
asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -222,7 +234,7 @@
+@@ -222,7 +232,7 @@
if (f) {
struct dentry * dentry = f->f_dentry;
if (!err)
err = cp_old_stat(dentry->d_inode, statbuf);
fput(f);
-@@ -241,7 +253,7 @@
+@@ -241,7 +251,7 @@
if (f) {
struct dentry * dentry = f->f_dentry;
if (!err)
err = cp_new_stat(dentry->d_inode, statbuf);
fput(f);
-@@ -263,7 +275,7 @@
+@@ -263,7 +273,7 @@
error = -EINVAL;
if (inode->i_op && inode->i_op->readlink &&
UPDATE_ATIME(inode);
error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
}
-@@ -339,12 +351,14 @@
+@@ -339,12 +349,14 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -354,12 +368,14 @@
+@@ -354,12 +366,14 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -374,7 +390,7 @@
+@@ -374,7 +388,7 @@
if (f) {
struct dentry * dentry = f->f_dentry;
if (!err)
err = cp_new_stat64(dentry->d_inode, statbuf);
fput(f);
-Index: linux-2.4.21-suse2/include/linux/dcache.h
+Index: kernel-2.4.212lgns/include/linux/dcache.h
===================================================================
---- linux-2.4.21-suse2.orig/include/linux/dcache.h 2003-11-11 03:44:28.000000000 +0300
-+++ linux-2.4.21-suse2/include/linux/dcache.h 2004-01-10 12:15:41.000000000 +0300
-@@ -7,6 +7,51 @@
+--- 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 @@
#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
-@@ -94,8 +139,22 @@
+@@ -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 @@
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 lookup_intent *);
++ int (*d_revalidate_it)(struct dentry *, int, struct nameidata *, struct lookup_intent *);
+ void (*d_pin)(struct dentry *, struct vfsmount * , int);
+ void (*d_unpin)(struct dentry *, struct vfsmount *, int);
};
-+#define PIN(de,mnt,flag) if (de->d_op && de->d_op->d_pin) \
++#define PIN(de,mnt,flag) if (de && de->d_op && de->d_op->d_pin) \
+ de->d_op->d_pin(de, mnt, flag);
-+#define UNPIN(de,mnt,flag) if (de->d_op && de->d_op->d_unpin) \
++#define UNPIN(de,mnt,flag) if (de && de->d_op && de->d_op->d_unpin) \
+ de->d_op->d_unpin(de, mnt, flag);
+
+
/* 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 +186,7 @@
+@@ -127,6 +189,7 @@
* s_nfsd_free_path semaphore will be down
*/
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
extern spinlock_t dcache_lock;
-Index: linux-2.4.21-suse2/include/linux/fs.h
+Index: kernel-2.4.212lgns/include/linux/fs.h
===================================================================
---- linux-2.4.21-suse2.orig/include/linux/fs.h 2004-01-10 11:28:05.000000000 +0300
-+++ linux-2.4.21-suse2/include/linux/fs.h 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -74,6 +74,7 @@
#define FMODE_READ 1
#define ATTR_ATTR_FLAG 1024
+#define ATTR_RAW 0x0800 /* file system, not vfs will massage attrs */
+#define ATTR_FROM_OPEN 0x1000 /* called from open path, ie O_TRUNC */
-+#define ATTR_CTIME_SET 0x2000
++#define ATTR_CTIME_SET 0x2000
/*
* This is the Inode Attributes structure, used for notify_change(). It
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 lookup_intent *, int flags);
++ struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct nameidata *, 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);
-@@ -1205,10 +1224,14 @@
+@@ -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 @@
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 +1527,7 @@
+@@ -1504,6 +1530,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 +1540,8 @@
+@@ -1516,6 +1543,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 +1693,8 @@
+@@ -1667,6 +1696,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: linux-2.4.21-suse2/include/linux/fs_struct.h
+Index: kernel-2.4.212lgns/include/linux/fs_struct.h
===================================================================
---- linux-2.4.21-suse2.orig/include/linux/fs_struct.h 2001-07-14 02:10:44.000000000 +0400
-+++ linux-2.4.21-suse2/include/linux/fs_struct.h 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -34,10 +34,12 @@
write_lock(&fs->lock);
old_root = fs->root;
dput(old_pwd);
mntput(old_pwdmnt);
}
-Index: linux-2.4.21-suse2/kernel/exit.c
+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
===================================================================
---- linux-2.4.21-suse2.orig/kernel/exit.c 2003-10-28 21:34:13.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/exit.c 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -288,11 +288,14 @@
{
/* No need to hold fs->lock if we are killing it */
dput(fs->altroot);
mntput(fs->altrootmnt);
}
-Index: linux-2.4.21-suse2/kernel/fork.c
+Index: kernel-2.4.212lgns/kernel/fork.c
===================================================================
---- linux-2.4.21-suse2.orig/kernel/fork.c 2003-10-28 21:34:17.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/fork.c 2004-01-10 12:15:41.000000000 +0300
+--- 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
@@ -461,10 +461,13 @@
fs->umask = old->umask;
read_lock(&old->lock);
fs->altrootmnt = mntget(old->altrootmnt);
fs->altroot = dget(old->altroot);
} else {
-Index: linux-2.4.21-suse2/kernel/ksyms.c
+Index: kernel-2.4.212lgns/kernel/ksyms.c
===================================================================
---- linux-2.4.21-suse2.orig/kernel/ksyms.c 2004-01-10 11:28:05.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/ksyms.c 2004-01-10 12:15:41.000000000 +0300
-@@ -327,6 +327,7 @@
+--- 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 @@
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);