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