Whamcloud - gitweb
b=16395
[fs/lustre-release.git] / lustre / kernel_patches / patches / nfs-cifs-intent-2.6-fc5.patch
1 Index: linux-2.6.16.i686/fs/cifs/dir.c
2 ===================================================================
3 --- linux-2.6.16.i686.orig/fs/cifs/dir.c        2006-05-30 15:47:03.000000000 +0800
4 +++ linux-2.6.16.i686/fs/cifs/dir.c     2006-05-30 21:11:39.000000000 +0800
5 @@ -147,7 +147,7 @@
6         }
7  
8         if(nd && (nd->flags & LOOKUP_OPEN)) {
9 -               int oflags = nd->intent.open.flags;
10 +               int oflags = nd->intent.flags;
11  
12                 desiredAccess = 0;
13                 if (oflags & FMODE_READ)
14 Index: linux-2.6.16.i686/fs/nfs/dir.c
15 ===================================================================
16 --- linux-2.6.16.i686.orig/fs/nfs/dir.c 2006-03-20 13:53:29.000000000 +0800
17 +++ linux-2.6.16.i686/fs/nfs/dir.c      2006-05-30 21:10:01.000000000 +0800
18 @@ -831,7 +831,7 @@
19                 return 0;
20         if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_CREATE) == 0)
21                 return 0;
22 -       return (nd->intent.open.flags & O_EXCL) != 0;
23 +       return (nd->intent.it_flags & O_EXCL) != 0;
24  }
25  
26  static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
27 @@ -902,7 +902,7 @@
28         if (nd->flags & LOOKUP_DIRECTORY)
29                 return 0;
30         /* Are we trying to write to a read only partition? */
31 -       if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
32 +       if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
33                 return 0;
34         return 1;
35  }
36 @@ -923,7 +923,7 @@
37         dentry->d_op = NFS_PROTO(dir)->dentry_ops;
38  
39         /* Let vfs_create() deal with O_EXCL */
40 -       if (nd->intent.open.flags & O_EXCL) {
41 +       if (nd->intent.it_flags & O_EXCL) {
42                 d_add(dentry, NULL);
43                 goto out;
44         }
45 @@ -938,7 +938,7 @@
46                 goto out;
47         }
48  
49 -       if (nd->intent.open.flags & O_CREAT) {
50 +       if (nd->intent.it_flags & O_CREAT) {
51                 nfs_begin_data_update(dir);
52                 res = nfs4_atomic_open(dir, dentry, nd);
53                 nfs_end_data_update(dir);
54 @@ -957,7 +957,7 @@
55                         case -ENOTDIR:
56                                 goto no_open;
57                         case -ELOOP:
58 -                               if (!(nd->intent.open.flags & O_NOFOLLOW))
59 +                               if (!(nd->intent.it_flags & O_NOFOLLOW))
60                                         goto no_open;
61                         /* case -EINVAL: */
62                         default:
63 @@ -993,7 +993,7 @@
64         /* NFS only supports OPEN on regular files */
65         if (!S_ISREG(inode->i_mode))
66                 goto no_open;
67 -       openflags = nd->intent.open.flags;
68 +       openflags = nd->intent.it_flags;
69         /* We cannot do exclusive creation on a positive dentry */
70         if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
71                 goto no_open;
72 @@ -1126,7 +1126,7 @@
73         attr.ia_valid = ATTR_MODE;
74  
75         if (nd && (nd->flags & LOOKUP_CREATE))
76 -               open_flags = nd->intent.open.flags;
77 +               open_flags = nd->intent.it_flags;
78  
79         lock_kernel();
80         nfs_begin_data_update(dir);
81 Index: linux-2.6.16.i686/fs/nfs/nfs4proc.c
82 ===================================================================
83 --- linux-2.6.16.i686.orig/fs/nfs/nfs4proc.c    2006-03-20 13:53:29.000000000 +0800
84 +++ linux-2.6.16.i686/fs/nfs/nfs4proc.c 2006-05-30 21:11:00.000000000 +0800
85 @@ -1220,7 +1220,7 @@
86                 ctx = (struct nfs_open_context *)filp->private_data;
87                 ctx->state = state;
88         } else
89 -               nfs4_close_state(state, nd->intent.open.flags);
90 +               nfs4_close_state(state, nd->intent.flags);
91  }
92  
93  struct dentry *
94 @@ -1232,19 +1232,19 @@
95         struct dentry *res;
96  
97         if (nd->flags & LOOKUP_CREATE) {
98 -               attr.ia_mode = nd->intent.open.create_mode;
99 +               attr.ia_mode = nd->intent.create_mode;
100                 attr.ia_valid = ATTR_MODE;
101                 if (!IS_POSIXACL(dir))
102                         attr.ia_mode &= ~current->fs->umask;
103         } else {
104                 attr.ia_valid = 0;
105 -               BUG_ON(nd->intent.open.flags & O_CREAT);
106 +               BUG_ON(nd->intent.flags & O_CREAT);
107         }
108  
109         cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
110         if (IS_ERR(cred))
111                 return (struct dentry *)cred;
112 -       state = nfs4_do_open(dir, dentry, nd->intent.open.flags, &attr, cred);
113 +       state = nfs4_do_open(dir, dentry, nd->intent.flags, &attr, cred);
114         put_rpccred(cred);
115         if (IS_ERR(state)) {
116                 if (PTR_ERR(state) == -ENOENT)