Whamcloud - gitweb
- configurable stack size fo x86_64
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent-2.4.20-hp.patch
index 8585701..cf07450 100644 (file)
  kernel/ksyms.c            |    1 
  13 files changed, 591 insertions(+), 133 deletions(-)
 
+Index: linux/fs/dcache.c
+===================================================================
+--- linux.orig/fs/dcache.c     Thu Nov 28 18:53:15 2002
++++ linux/fs/dcache.c  Wed Mar 17 13:11:25 2004
+@@ -181,6 +181,13 @@
+               spin_unlock(&dcache_lock);
+               return 0;
+       }
++
++      /* network invalidation by Lustre */
++      if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
++              spin_unlock(&dcache_lock);
++              return 0;
++      }
++
+       /*
+        * Check whether to do a partial shrink_dcache
+        * to get rid of unused child entries.
+@@ -830,13 +837,19 @@
+  * Adds a dentry to the hash according to its name.
+  */
+  
+-void d_rehash(struct dentry * entry)
++void __d_rehash(struct dentry * entry, int lock)
+ {
+       struct list_head *list = d_hash(entry->d_parent, entry->d_name.hash);
+       if (!list_empty(&entry->d_hash)) BUG();
+-      spin_lock(&dcache_lock);
++      if (lock) spin_lock(&dcache_lock);
+       list_add(&entry->d_hash, list);
+-      spin_unlock(&dcache_lock);
++      if (lock) spin_unlock(&dcache_lock);
++}
++EXPORT_SYMBOL(__d_rehash);
++
++void d_rehash(struct dentry * entry)
++{
++      __d_rehash(entry, 1);
+ }
+ #define do_switch(x,y) do { \
 Index: linux/fs/exec.c
 ===================================================================
 --- linux.orig/fs/exec.c       Wed Mar 17 13:00:38 2004
@@ -78,164 +119,6 @@ Index: linux/fs/exec.c
                goto close_fail;
  
        retval = binfmt->core_dump(signr, regs, file);
-Index: linux/fs/dcache.c
-===================================================================
---- linux.orig/fs/dcache.c     Thu Nov 28 18:53:15 2002
-+++ linux/fs/dcache.c  Wed Mar 17 13:11:25 2004
-@@ -181,6 +181,13 @@
-               spin_unlock(&dcache_lock);
-               return 0;
-       }
-+
-+      /* network invalidation by Lustre */
-+      if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
-+              spin_unlock(&dcache_lock);
-+              return 0;
-+      }
-+
-       /*
-        * Check whether to do a partial shrink_dcache
-        * to get rid of unused child entries.
-@@ -830,13 +837,19 @@
-  * Adds a dentry to the hash according to its name.
-  */
-  
--void d_rehash(struct dentry * entry)
-+void __d_rehash(struct dentry * entry, int lock)
- {
-       struct list_head *list = d_hash(entry->d_parent, entry->d_name.hash);
-       if (!list_empty(&entry->d_hash)) BUG();
--      spin_lock(&dcache_lock);
-+      if (lock) spin_lock(&dcache_lock);
-       list_add(&entry->d_hash, list);
--      spin_unlock(&dcache_lock);
-+      if (lock) spin_unlock(&dcache_lock);
-+}
-+EXPORT_SYMBOL(__d_rehash);
-+
-+void d_rehash(struct dentry * entry)
-+{
-+      __d_rehash(entry, 1);
- }
- #define do_switch(x,y) do { \
-Index: linux/fs/namespace.c
-===================================================================
---- linux.orig/fs/namespace.c  Thu Nov 28 18:53:15 2002
-+++ linux/fs/namespace.c       Wed Mar 17 13:11:25 2004
-@@ -99,6 +99,7 @@
- {
-       old_nd->dentry = mnt->mnt_mountpoint;
-       old_nd->mnt = mnt->mnt_parent;
-+      UNPIN(old_nd->dentry, old_nd->mnt, 1);
-       mnt->mnt_parent = mnt;
-       mnt->mnt_mountpoint = mnt->mnt_root;
-       list_del_init(&mnt->mnt_child);
-@@ -110,6 +111,7 @@
- {
-       mnt->mnt_parent = mntget(nd->mnt);
-       mnt->mnt_mountpoint = dget(nd->dentry);
-+      PIN(nd->dentry, nd->mnt, 1);
-       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++;
-@@ -485,14 +487,17 @@
- {
-       struct nameidata old_nd;
-       struct vfsmount *mnt = NULL;
-+      struct lookup_intent it = { .it_op = IT_GETATTR };
-       int err = mount_is_safe(nd);
-       if (err)
-               return err;
-       if (!old_name || !*old_name)
-               return -EINVAL;
--      err = path_lookup(old_name, LOOKUP_POSITIVE|LOOKUP_FOLLOW, &old_nd);
--      if (err)
-+      err = path_lookup_it(old_name, LOOKUP_POSITIVE|LOOKUP_FOLLOW, &old_nd, &it);
-+      if (err) {
-+              intent_release(&it);
-               return err;
-+      }
-       down_write(&current->namespace->sem);
-       err = -EINVAL;
-@@ -515,6 +520,7 @@
-       }
-       up_write(&current->namespace->sem);
-+      intent_release(&it);
-       path_release(&old_nd);
-       return err;
- }
-@@ -698,6 +704,7 @@
-                 unsigned long flags, void *data_page)
- {
-       struct nameidata nd;
-+      struct lookup_intent it = { .it_op = IT_GETATTR };
-       int retval = 0;
-       int mnt_flags = 0;
-@@ -722,10 +729,11 @@
-       flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV);
-       /* ... and get the mountpoint */
--      retval = path_lookup(dir_name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, &nd);
--      if (retval)
-+      retval = path_lookup_it(dir_name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, &nd, &it);
-+      if (retval) {
-+              intent_release(&it);
-               return retval;
--
-+      }
-       if (flags & MS_REMOUNT)
-               retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
-                                   data_page);
-@@ -736,6 +744,8 @@
-       else
-               retval = do_add_mount(&nd, type_page, flags, mnt_flags,
-                                     dev_name, data_page);
-+
-+      intent_release(&it);
-       path_release(&nd);
-       return retval;
- }
-@@ -901,6 +911,8 @@
- {
-       struct vfsmount *tmp;
-       struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd;
-+      struct lookup_intent new_it = { .it_op = IT_GETATTR };
-+      struct lookup_intent old_it = { .it_op = IT_GETATTR };
-       int error;
-       if (!capable(CAP_SYS_ADMIN))
-@@ -908,14 +920,14 @@
-       lock_kernel();
--      error = __user_walk(new_root, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &new_nd);
-+      error = __user_walk_it(new_root, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &new_nd, &new_it);
-       if (error)
-               goto out0;
-       error = -EINVAL;
-       if (!check_mnt(new_nd.mnt))
-               goto out1;
--      error = __user_walk(put_old, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &old_nd);
-+      error = __user_walk_it(put_old, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &old_nd, &old_it);
-       if (error)
-               goto out1;
-@@ -970,8 +982,10 @@
-       up(&old_nd.dentry->d_inode->i_zombie);
-       up_write(&current->namespace->sem);
-       path_release(&user_nd);
-+      intent_release(&old_it);
-       path_release(&old_nd);
- out1:
-+      intent_release(&new_it);
-       path_release(&new_nd);
- out0:
-       unlock_kernel();
 Index: linux/fs/namei.c
 ===================================================================
 --- linux.orig/fs/namei.c      Wed Mar 17 13:00:37 2004
@@ -265,7 +148,7 @@ Index: linux/fs/namei.c
        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;
@@ -297,7 +180,7 @@ Index: linux/fs/namei.c
                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();
@@ -307,7 +190,7 @@ Index: linux/fs/namei.c
                        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)
@@ -480,20 +363,20 @@ Index: linux/fs/namei.c
                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);
 +                              if (err)
 +                                      break;
 +                              new = real_lookup(dentry->d_parent,
-+                                                &dentry->d_name, 0, NULL);
-+                              d_invalidate(dentry);
-+                              dput(dentry);
++                                                &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)
@@ -581,7 +464,7 @@ Index: linux/fs/namei.c
                        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();
@@ -796,7 +679,7 @@ Index: linux/fs/namei.c
 +
  /* SMP-safe */
 -static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
-+static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
++struct dentry *lookup_create(struct nameidata *nd, int is_dir,
 +                                  struct lookup_intent *it)
  {
        struct dentry *dentry;
@@ -1065,6 +948,132 @@ Index: linux/fs/namei.c
        if (page) {
                kunmap(page);
                page_cache_release(page);
+Index: linux/fs/namespace.c
+===================================================================
+--- linux.orig/fs/namespace.c  Thu Nov 28 18:53:15 2002
++++ linux/fs/namespace.c       Wed Mar 17 13:11:25 2004
+@@ -99,6 +99,7 @@
+ {
+       old_nd->dentry = mnt->mnt_mountpoint;
+       old_nd->mnt = mnt->mnt_parent;
++      UNPIN(old_nd->dentry, old_nd->mnt, 1);
+       mnt->mnt_parent = mnt;
+       mnt->mnt_mountpoint = mnt->mnt_root;
+       list_del_init(&mnt->mnt_child);
+@@ -110,6 +111,7 @@
+ {
+       mnt->mnt_parent = mntget(nd->mnt);
+       mnt->mnt_mountpoint = dget(nd->dentry);
++      PIN(nd->dentry, nd->mnt, 1);
+       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 +293,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;
+@@ -485,14 +487,17 @@
+ {
+       struct nameidata old_nd;
+       struct vfsmount *mnt = NULL;
++      struct lookup_intent it = { .it_op = IT_GETATTR };
+       int err = mount_is_safe(nd);
+       if (err)
+               return err;
+       if (!old_name || !*old_name)
+               return -EINVAL;
+-      err = path_lookup(old_name, LOOKUP_POSITIVE|LOOKUP_FOLLOW, &old_nd);
+-      if (err)
++      err = path_lookup_it(old_name, LOOKUP_POSITIVE|LOOKUP_FOLLOW, &old_nd, &it);
++      if (err) {
++              intent_release(&it);
+               return err;
++      }
+       down_write(&current->namespace->sem);
+       err = -EINVAL;
+@@ -515,6 +520,7 @@
+       }
+       up_write(&current->namespace->sem);
++      intent_release(&it);
+       path_release(&old_nd);
+       return err;
+ }
+@@ -698,6 +704,7 @@
+                 unsigned long flags, void *data_page)
+ {
+       struct nameidata nd;
++      struct lookup_intent it = { .it_op = IT_GETATTR };
+       int retval = 0;
+       int mnt_flags = 0;
+@@ -722,10 +729,11 @@
+       flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV);
+       /* ... and get the mountpoint */
+-      retval = path_lookup(dir_name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, &nd);
+-      if (retval)
++      retval = path_lookup_it(dir_name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, &nd, &it);
++      if (retval) {
++              intent_release(&it);
+               return retval;
+-
++      }
+       if (flags & MS_REMOUNT)
+               retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
+                                   data_page);
+@@ -736,6 +744,8 @@
+       else
+               retval = do_add_mount(&nd, type_page, flags, mnt_flags,
+                                     dev_name, data_page);
++
++      intent_release(&it);
+       path_release(&nd);
+       return retval;
+ }
+@@ -901,6 +911,8 @@
+ {
+       struct vfsmount *tmp;
+       struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd;
++      struct lookup_intent new_it = { .it_op = IT_GETATTR };
++      struct lookup_intent old_it = { .it_op = IT_GETATTR };
+       int error;
+       if (!capable(CAP_SYS_ADMIN))
+@@ -908,14 +920,14 @@
+       lock_kernel();
+-      error = __user_walk(new_root, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &new_nd);
++      error = __user_walk_it(new_root, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &new_nd, &new_it);
+       if (error)
+               goto out0;
+       error = -EINVAL;
+       if (!check_mnt(new_nd.mnt))
+               goto out1;
+-      error = __user_walk(put_old, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &old_nd);
++      error = __user_walk_it(put_old, LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &old_nd, &old_it);
+       if (error)
+               goto out1;
+@@ -970,8 +982,10 @@
+       up(&old_nd.dentry->d_inode->i_zombie);
+       up_write(&current->namespace->sem);
+       path_release(&user_nd);
++      intent_release(&old_it);
+       path_release(&old_nd);
+ out1:
++      intent_release(&new_it);
+       path_release(&new_nd);
+ out0:
+       unlock_kernel();
 Index: linux/fs/open.c
 ===================================================================
 --- linux.orig/fs/open.c       Thu Nov 28 18:53:15 2002
@@ -1467,6 +1476,20 @@ Index: linux/fs/open.c
  /*
   * Find an empty file descriptor entry, and mark it busy.
   */
+Index: linux/fs/proc/base.c
+===================================================================
+--- linux.orig/fs/proc/base.c  Wed Mar 17 13:00:35 2004
++++ linux/fs/proc/base.c       Wed Mar 17 13:11:25 2004
+@@ -481,6 +481,9 @@
+       error = inode->u.proc_i.op.proc_get_link(inode, &nd->dentry, &nd->mnt);
+       nd->last_type = LAST_BIND;
++
++      if (nd->intent != NULL)
++              nd->intent->d.lustre.it_int_flags |= IT_FL_FOLLOWED;
+ out:
+       return error;
+ }
 Index: linux/fs/stat.c
 ===================================================================
 --- linux.orig/fs/stat.c       Thu Sep 13 19:04:43 2001
@@ -1628,25 +1651,11 @@ Index: linux/fs/stat.c
                if (!err)
                        err = cp_new_stat64(dentry->d_inode, statbuf);
                fput(f);
-Index: linux/fs/proc/base.c
-===================================================================
---- linux.orig/fs/proc/base.c  Wed Mar 17 13:00:35 2004
-+++ linux/fs/proc/base.c       Wed Mar 17 13:11:25 2004
-@@ -481,6 +481,9 @@
-       error = inode->u.proc_i.op.proc_get_link(inode, &nd->dentry, &nd->mnt);
-       nd->last_type = LAST_BIND;
-+
-+      if (nd->intent != NULL)
-+              nd->intent->d.lustre.it_int_flags |= IT_FL_FOLLOWED;
- out:
-       return error;
- }
 Index: linux/include/linux/dcache.h
 ===================================================================
 --- linux.orig/include/linux/dcache.h  Thu Nov 28 18:53:15 2002
 +++ linux/include/linux/dcache.h       Wed Mar 17 13:11:25 2004
-@@ -6,6 +6,51 @@
+@@ -6,6 +6,52 @@
  #include <asm/atomic.h>
  #include <linux/mount.h>
  #include <linux/kernel.h>
@@ -1661,6 +1670,7 @@ Index: linux/include/linux/dcache.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 */
@@ -1698,11 +1708,20 @@ Index: linux/include/linux/dcache.h
  
  /*
   * linux/include/linux/dcache.h
+@@ -84,6 +130,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 *);
 @@ -91,8 +136,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);
  };
@@ -1747,7 +1766,7 @@ Index: linux/include/linux/fs.h
  #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
@@ -1791,7 +1810,7 @@ Index: linux/include/linux/fs.h
        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 *);
@@ -1818,12 +1837,22 @@ Index: linux/include/linux/fs.h
        int (*getattr) (struct dentry *, struct iattr *);
        int (*setxattr) (struct dentry *, const char *, void *, size_t, int);
        ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
-@@ -1088,10 +1107,14 @@
+@@ -938,6 +957,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
+@@ -1088,10 +1107,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);
@@ -1890,18 +1919,25 @@ Index: linux/include/linux/fs_struct.h
                dput(old_pwd);
                mntput(old_pwdmnt);
        }
-Index: linux/kernel/ksyms.c
+Index: linux/kernel/exit.c
 ===================================================================
---- linux.orig/kernel/ksyms.c  Wed Mar 17 13:11:23 2004
-+++ linux/kernel/ksyms.c       Wed Mar 17 13:11:25 2004
-@@ -315,6 +315,7 @@
- EXPORT_SYMBOL(set_page_dirty);
- EXPORT_SYMBOL(vfs_readlink);
- EXPORT_SYMBOL(vfs_follow_link);
-+EXPORT_SYMBOL(vfs_follow_link_it);
- EXPORT_SYMBOL(page_readlink);
- EXPORT_SYMBOL(page_follow_link);
- EXPORT_SYMBOL(page_symlink_inode_operations);
+--- linux.orig/kernel/exit.c   Wed Mar 17 13:00:38 2004
++++ linux/kernel/exit.c        Wed Mar 17 13:11:25 2004
+@@ -239,11 +239,14 @@
+ {
+       /* No need to hold fs->lock if we are killing it */
+       if (atomic_dec_and_test(&fs->count)) {
++              UNPIN(fs->pwd, fs->pwdmnt, 0);
++              UNPIN(fs->root, fs->rootmnt, 1);
+               dput(fs->root);
+               mntput(fs->rootmnt);
+               dput(fs->pwd);
+               mntput(fs->pwdmnt);
+               if (fs->altroot) {
++                      UNPIN(fs->altroot, fs->altrootmnt, 1);
+                       dput(fs->altroot);
+                       mntput(fs->altrootmnt);
+               }
 Index: linux/kernel/fork.c
 ===================================================================
 --- linux.orig/kernel/fork.c   Wed Mar 17 13:00:38 2004
@@ -1920,22 +1956,37 @@ Index: linux/kernel/fork.c
                        fs->altrootmnt = mntget(old->altrootmnt);
                        fs->altroot = dget(old->altroot);
                } else {
-Index: linux/kernel/exit.c
+Index: linux/kernel/ksyms.c
 ===================================================================
---- linux.orig/kernel/exit.c   Wed Mar 17 13:00:38 2004
-+++ linux/kernel/exit.c        Wed Mar 17 13:11:25 2004
-@@ -239,11 +239,14 @@
+--- linux.orig/kernel/ksyms.c  Wed Mar 17 13:11:23 2004
++++ linux/kernel/ksyms.c       Wed Mar 17 13:11:25 2004
+@@ -315,6 +315,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);
+===== include/linux/mount.h 1.7 vs edited =====
+--- linux.orig/include/linux/mount.h   Tue Feb  5 09:49:35 2002
++++ linux/include/linux/mount.h        Tue May  4 19:23:48 2004
+@@ -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 +39,7 @@
+ }
+ extern void __mntput(struct vfsmount *mnt);
++extern int do_umount(struct vfsmount *mnt, int flags);
+ static inline void mntput(struct vfsmount *mnt)
  {
-       /* No need to hold fs->lock if we are killing it */
-       if (atomic_dec_and_test(&fs->count)) {
-+              UNPIN(fs->pwd, fs->pwdmnt, 0);
-+              UNPIN(fs->root, fs->rootmnt, 1);
-               dput(fs->root);
-               mntput(fs->rootmnt);
-               dput(fs->pwd);
-               mntput(fs->pwdmnt);
-               if (fs->altroot) {
-+                      UNPIN(fs->altroot, fs->altrootmnt, 1);
-                       dput(fs->altroot);
-                       mntput(fs->altrootmnt);
-               }