Whamcloud - gitweb
b=20595
[fs/lustre-release.git] / lustre / kernel_patches / patches / nfs-cifs-intent-2.6-fc3.patch
1 Index: linux-2.6.10/fs/cifs/dir.c
2 ===================================================================
3 --- linux-2.6.10.orig/fs/cifs/dir.c
4 +++ linux-2.6.10/fs/cifs/dir.c
5 @@ -199,23 +199,23 @@ cifs_create(struct inode *inode, struct 
6         }
7  
8         if(nd) {
9 -               if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY)
10 +               if ((nd->intent.it_flags & O_ACCMODE) == O_RDONLY)
11                         desiredAccess = GENERIC_READ;
12 -               else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY) {
13 +               else if ((nd->intent.it_flags & O_ACCMODE) == O_WRONLY) {
14                         desiredAccess = GENERIC_WRITE;
15                         write_only = TRUE;
16 -               } else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
17 +               } else if ((nd->intent.it_flags & O_ACCMODE) == O_RDWR) {
18                         /* GENERIC_ALL is too much permission to request */
19                         /* can cause unnecessary access denied on create */
20                         /* desiredAccess = GENERIC_ALL; */
21                         desiredAccess = GENERIC_READ | GENERIC_WRITE;
22                 }
23  
24 -               if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
25 +               if((nd->intent.it_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
26                         disposition = FILE_CREATE;
27 -               else if((nd->intent.open.flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
28 +               else if((nd->intent.it_flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
29                         disposition = FILE_OVERWRITE_IF;
30 -               else if((nd->intent.open.flags & O_CREAT) == O_CREAT)
31 +               else if((nd->intent.it_flags & O_CREAT) == O_CREAT)
32                         disposition = FILE_OPEN_IF;
33                 else {
34                         cFYI(1,("Create flag not set in create function"));
35 Index: linux-2.6.10/fs/nfs/nfs4proc.c
36 ===================================================================
37 --- linux-2.6.10.orig/fs/nfs/nfs4proc.c
38 +++ linux-2.6.10/fs/nfs/nfs4proc.c
39 @@ -775,17 +775,17 @@ nfs4_atomic_open(struct inode *dir, stru
40         struct nfs4_state *state;
41  
42         if (nd->flags & LOOKUP_CREATE) {
43 -               attr.ia_mode = nd->intent.open.create_mode;
44 +               attr.ia_mode = nd->intent.it_create_mode;
45                 attr.ia_valid = ATTR_MODE;
46                 if (!IS_POSIXACL(dir))
47                         attr.ia_mode &= ~current->fs->umask;
48         } else {
49                 attr.ia_valid = 0;
50 -               BUG_ON(nd->intent.open.flags & O_CREAT);
51 +               BUG_ON(nd->intent.it_flags & O_CREAT);
52         }
53  
54         cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
55 -       state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
56 +       state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
57         put_rpccred(cred);
58         if (IS_ERR(state))
59                 return (struct inode *)state;
60 Index: linux-2.6.10/fs/nfs/dir.c
61 ===================================================================
62 --- linux-2.6.10.orig/fs/nfs/dir.c
63 +++ linux-2.6.10/fs/nfs/dir.c
64 @@ -718,7 +718,7 @@ int nfs_is_exclusive_create(struct inode
65                 return 0;
66         if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
67                 return 0;
68 -       return (nd->intent.open.flags & O_EXCL) != 0;
69 +       return (nd->intent.it_flags & O_EXCL) != 0;
70  }
71  
72  static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
73 @@ -791,7 +791,7 @@ static int is_atomic_open(struct inode *
74         if (nd->flags & LOOKUP_DIRECTORY)
75                 return 0;
76         /* Are we trying to write to a read only partition? */
77 -       if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
78 +       if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
79                 return 0;
80         return 1;
81  }
82 @@ -812,7 +812,7 @@ static struct dentry *nfs_atomic_lookup(
83         dentry->d_op = NFS_PROTO(dir)->dentry_ops;
84  
85         /* Let vfs_create() deal with O_EXCL */
86 -       if (nd->intent.open.flags & O_EXCL)
87 +       if (nd->intent.it_flags & O_EXCL)
88                 goto no_entry;
89  
90         /* Open the file on the server */
91 @@ -820,7 +820,7 @@ static struct dentry *nfs_atomic_lookup(
92         /* Revalidate parent directory attribute cache */
93         nfs_revalidate_inode(NFS_SERVER(dir), dir);
94  
95 -       if (nd->intent.open.flags & O_CREAT) {
96 +       if (nd->intent.it_flags & O_CREAT) {
97                 nfs_begin_data_update(dir);
98                 inode = nfs4_atomic_open(dir, dentry, nd);
99                 nfs_end_data_update(dir);
100 @@ -836,7 +836,7 @@ static struct dentry *nfs_atomic_lookup(
101                                 break;
102                         /* This turned out not to be a regular file */
103                         case -ELOOP:
104 -                               if (!(nd->intent.open.flags & O_NOFOLLOW))
105 +                               if (!(nd->intent.it_flags & O_NOFOLLOW))
106                                         goto no_open;
107                         /* case -EISDIR: */
108                         /* case -EINVAL: */
109 @@ -875,7 +875,7 @@ static int nfs_open_revalidate(struct de
110         /* NFS only supports OPEN on regular files */
111         if (!S_ISREG(inode->i_mode))
112                 goto no_open;
113 -       openflags = nd->intent.open.flags;
114 +       openflags = nd->intent.it_flags;
115         /* We cannot do exclusive creation on a positive dentry */
116         if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
117                 goto no_open;
118 @@ -1043,7 +1043,8 @@ static int nfs_create(struct inode *dir,
119         attr.ia_valid = ATTR_MODE;
120  
121         if (nd && (nd->flags & LOOKUP_CREATE))
122 -               open_flags = nd->intent.open.flags;
123 +               open_flags = nd->intent.it_flags;
124 +
125  
126         /*
127          * The 0 argument passed into the create function should one day