Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / nfs-cifs-intent-2.6-suse.patch
1 Index: linux-2.6.5-7.108/fs/nfs/dir.c
2 ===================================================================
3 --- linux-2.6.5-7.108.orig/fs/nfs/dir.c 2004-09-15 19:26:43.012732408 +0300
4 +++ linux-2.6.5-7.108/fs/nfs/dir.c      2004-09-15 20:03:32.882781096 +0300
5 @@ -709,7 +709,7 @@
6                 return 0;
7         if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
8                 return 0;
9 -       return (nd->intent.open.flags & O_EXCL) != 0;
10 +       return (nd->intent.it_flags & O_EXCL) != 0;
11  }
12  
13  static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
14 @@ -782,7 +782,7 @@
15         if (nd->flags & LOOKUP_DIRECTORY)
16                 return 0;
17         /* Are we trying to write to a read only partition? */
18 -       if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
19 +       if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
20                 return 0;
21         return 1;
22  }
23 @@ -803,7 +803,7 @@
24         dentry->d_op = NFS_PROTO(dir)->dentry_ops;
25  
26         /* Let vfs_create() deal with O_EXCL */
27 -       if (nd->intent.open.flags & O_EXCL)
28 +       if (nd->intent.it_flags & O_EXCL)
29                 goto no_entry;
30  
31         /* Open the file on the server */
32 @@ -811,7 +811,7 @@
33         /* Revalidate parent directory attribute cache */
34         nfs_revalidate_inode(NFS_SERVER(dir), dir);
35  
36 -       if (nd->intent.open.flags & O_CREAT) {
37 +       if (nd->intent.it_flags & O_CREAT) {
38                 nfs_begin_data_update(dir);
39                 inode = nfs4_atomic_open(dir, dentry, nd);
40                 nfs_end_data_update(dir);
41 @@ -827,7 +827,7 @@
42                                 break;
43                         /* This turned out not to be a regular file */
44                         case -ELOOP:
45 -                               if (!(nd->intent.open.flags & O_NOFOLLOW))
46 +                               if (!(nd->intent.it_flags & O_NOFOLLOW))
47                                         goto no_open;
48                         /* case -EISDIR: */
49                         /* case -EINVAL: */
50 @@ -861,7 +861,7 @@
51         dir = parent->d_inode;
52         if (!is_atomic_open(dir, nd))
53                 goto no_open;
54 -       openflags = nd->intent.open.flags;
55 +       openflags = nd->intent.it_flags;
56         if (openflags & O_CREAT) {
57                 /* If this is a negative dentry, just drop it */
58                 if (!inode)
59 @@ -1026,7 +1026,7 @@
60         attr.ia_valid = ATTR_MODE;
61  
62         if (nd && (nd->flags & LOOKUP_CREATE))
63 -               open_flags = nd->intent.open.flags;
64 +               open_flags = nd->intent.it_flags;
65  
66         /*
67          * The 0 argument passed into the create function should one day
68 Index: linux-2.6.5-7.108/fs/nfs/nfs4proc.c
69 ===================================================================
70 --- linux-2.6.5-7.108.orig/fs/nfs/nfs4proc.c    2004-04-04 06:37:39.000000000 +0300
71 +++ linux-2.6.5-7.108/fs/nfs/nfs4proc.c 2004-09-15 20:03:32.885780640 +0300
72 @@ -792,17 +792,17 @@
73         struct nfs4_state *state;
74  
75         if (nd->flags & LOOKUP_CREATE) {
76 -               attr.ia_mode = nd->intent.open.create_mode;
77 +               attr.ia_mode = nd->intent.it_create_mode;
78                 attr.ia_valid = ATTR_MODE;
79                 if (!IS_POSIXACL(dir))
80                         attr.ia_mode &= ~current->fs->umask;
81         } else {
82                 attr.ia_valid = 0;
83 -               BUG_ON(nd->intent.open.flags & O_CREAT);
84 +               BUG_ON(nd->intent.it_flags & O_CREAT);
85         }
86  
87         cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
88 -       state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
89 +       state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
90         put_rpccred(cred);
91         if (IS_ERR(state))
92                 return (struct inode *)state;
93 Index: linux-2.6.5-7.108/fs/cifs/dir.c
94 ===================================================================
95 --- linux-2.6.5-7.108.orig/fs/cifs/dir.c        2004-09-04 13:28:22.000000000 +0300
96 +++ linux-2.6.5-7.108/fs/cifs/dir.c     2004-09-15 20:03:40.065689128 +0300
97 @@ -173,23 +173,23 @@
98         }
99  
100         if(nd) {
101 -               if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY)
102 +               if ((nd->intent.it_flags & O_ACCMODE) == O_RDONLY)
103                         desiredAccess = GENERIC_READ;
104 -               else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY) {
105 +               else if ((nd->intent.it_flags & O_ACCMODE) == O_WRONLY) {
106                         desiredAccess = GENERIC_WRITE;
107                         write_only = TRUE;
108 -               } else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
109 +               } else if ((nd->intent.it_flags & O_ACCMODE) == O_RDWR) {
110                         /* GENERIC_ALL is too much permission to request */
111                         /* can cause unnecessary access denied on create */
112                         /* desiredAccess = GENERIC_ALL; */
113                         desiredAccess = GENERIC_READ | GENERIC_WRITE;
114                 }
115  
116 -               if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
117 +               if((nd->intent.it_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
118                         disposition = FILE_CREATE;
119 -               else if((nd->intent.open.flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
120 +               else if((nd->intent.it_flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
121                         disposition = FILE_OVERWRITE_IF;
122 -               else if((nd->intent.open.flags & O_CREAT) == O_CREAT)
123 +               else if((nd->intent.it_flags & O_CREAT) == O_CREAT)
124                         disposition = FILE_OPEN_IF;
125                 else {
126                         cFYI(1,("Create flag not set in create function"));
127 @@ -359,7 +359,7 @@
128               parent_dir_inode, direntry->d_name.name, direntry));
129  
130         if(nd) {  /* BB removeme */
131 -               cFYI(1,("In lookup nd flags 0x%x open intent flags 0x%x",nd->flags,nd->intent.open.flags));
132 +               cFYI(1,("In lookup nd flags 0x%x open intent flags 0x%x",nd->flags,nd->intent.it_flags));
133         } /* BB removeme BB */
134         /* BB Add check of incoming data - e.g. frame not longer than maximum SMB - let server check the namelen BB */
135