Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent-2.6-rhel4.patch
index 1e659f5..66e65fb 100644 (file)
@@ -164,7 +164,7 @@ diff -rup RH_2_6_9_55.orig/fs/namei.c RH_2_6_9_55/fs/namei.c
 +              counter++;
 +              if (counter < 10)
 +                      goto revalidate_again;
-+              printk("excessive revalidate_it loops\n");
++              //printk("excessive revalidate_it loops\n");
 +              return -ESTALE;
 +      }
 +      return 0;
@@ -581,14 +581,6 @@ diff -rup RH_2_6_9_55.orig/fs/namei.c RH_2_6_9_55/fs/namei.c
 diff -urNp RH_2_6_9_42_0_3.orig/fs/namespace.c RH_2_6_9_42_0_3/fs/namespace.c
 --- RH_2_6_9_42_0_3.orig/fs/namespace.c
 +++ RH_2_6_9_42_0_3/fs/namespace.c
-@@ -61,6 +61,7 @@ struct vfsmount *alloc_vfsmnt(const char
-               INIT_LIST_HEAD(&mnt->mnt_mounts);
-               INIT_LIST_HEAD(&mnt->mnt_list);
-               INIT_LIST_HEAD(&mnt->mnt_fslink);
-+              INIT_LIST_HEAD(&mnt->mnt_lustre_list);
-               if (name) {
-                       int size = strlen(name)+1;
-                       char *newname = kmalloc(size, GFP_KERNEL);
 @@ -114,6 +115,7 @@ static inline int check_mnt(struct vfsmo
  
  static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
@@ -705,8 +697,8 @@ diff -rup RH_2_6_9_55.orig/fs/nfs/dir.c RH_2_6_9_55/fs/nfs/dir.c
 diff -rup RH_2_6_9_55.orig/fs/nfs/nfs4proc.c RH_2_6_9_55/fs/nfs/nfs4proc.c
 --- RH_2_6_9_55.orig/fs/nfs/nfs4proc.c
 +++ RH_2_6_9_55/fs/nfs/nfs4proc.c
-@@ -770,17 +770,17 @@ nfs4_atomic_open(struct inode *dir, stru
-       struct nfs4_state *state;
+@@ -770,27 +770,27 @@ nfs4_atomic_open(struct inode *dir, stru
+       struct nfs4_inc_open *inc_open;
  
        if (nd->flags & LOOKUP_CREATE) {
 -              attr.ia_mode = nd->intent.open.create_mode;
@@ -720,12 +712,23 @@ diff -rup RH_2_6_9_55.orig/fs/nfs/nfs4proc.c RH_2_6_9_55/fs/nfs/nfs4proc.c
 +              BUG_ON(nd->intent.it_flags & O_CREAT);
        }
  
+       /* track info in case the open never completes */
+       if (!(inc_open = kmalloc(sizeof(*inc_open), GFP_KERNEL)))
+               return ERR_PTR(-ENOMEM);
        cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
 -      state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
 +      state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
        put_rpccred(cred);
-       if (IS_ERR(state))
-               return (struct inode *)state;
+       if (IS_ERR(state)) {
+               kfree(inc_open);
+               return (struct inode *)state;
+       }
+       inc_open->task = current;
+-      inc_open->flags = nd->intent.open.flags;
++      inc_open->flags = nd->intent.it_flags;
+       INIT_LIST_HEAD(&inc_open->state);
+       spin_lock(&state->inode->i_lock);
+       list_add(&inc_open->state, &state->inc_open);
 diff -rup RH_2_6_9_55.orig/fs/open.c RH_2_6_9_55/fs/open.c
 --- RH_2_6_9_55.orig/fs/open.c
 +++ RH_2_6_9_55/fs/open.c
@@ -1202,8 +1205,9 @@ diff -rup RH_2_6_9_55.orig/fs/stat.c RH_2_6_9_55/fs/stat.c
        int error;
 +      intent_init(&nd.intent, IT_GETATTR);
 
-       error = user_path_walk(name, &nd);
-       if (!error) {
+-      error = user_path_walk(name, &nd);
++      error = user_path_walk_it(name, &nd);
+       if (!error) {
 -              error = vfs_getattr64(nd.mnt, nd.dentry, stat);
 +              error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
                path_release(&nd);
@@ -1215,8 +1219,9 @@ diff -rup RH_2_6_9_55.orig/fs/stat.c RH_2_6_9_55/fs/stat.c
        int error;
 +      intent_init(&nd.intent, IT_GETATTR);
 
-       error = user_path_walk_link(name, &nd);
-       if (!error) {
+-      error = user_path_walk_link(name, &nd);
++      error = user_path_walk_link_it(name, &nd);
+       if (!error) {
 -              error = vfs_getattr64(nd.mnt, nd.dentry, stat);
 +              error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
                path_release(&nd);
@@ -1344,11 +1349,10 @@ diff -rup RH_2_6_9_55.orig/include/linux/fs.h RH_2_6_9_55/include/linux/fs.h
 diff -rup RH_2_6_9_55.orig/include/linux/mount.h RH_2_6_9_55/include/linux/mount.h
 --- RH_2_6_9_55.orig/include/linux/mount.h
 +++ RH_2_6_9_55/include/linux/mount.h
-@@ -34,6 +34,8 @@ struct vfsmount
+@@ -34,6 +34,7 @@ struct vfsmount
        struct list_head mnt_list;
        struct list_head mnt_fslink;    /* link in fs-specific expiry list */
        struct namespace *mnt_namespace; /* containing namespace */
-+      struct list_head mnt_lustre_list; /* GNS mount list */
 +      unsigned long mnt_last_used;    /* for GNS auto-umount (jiffies) */
  };