Whamcloud - gitweb
63f09b37380cbbcc8409d0e1ade14951559312fb
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent_hp.patch
1  fs/dcache.c            |    3 
2  fs/namei.c             |  306 ++++++++++++++++++++++++++++++++++++++++---------
3  fs/nfsd/vfs.c          |    2 
4  fs/open.c              |   63 +++++++---
5  fs/stat.c              |   29 +++-
6  include/linux/dcache.h |   31 ++++
7  include/linux/fs.h     |   22 +++
8  kernel/ksyms.c         |    1 
9  8 files changed, 384 insertions(+), 73 deletions(-)
10
11 --- linux-2.4.19-hp2_pnnl2/fs/dcache.c~vfs_intent_hp    Sun Jan 19 19:04:47 2003
12 +++ linux-2.4.19-hp2_pnnl2-root/fs/dcache.c     Sun Jan 19 19:04:47 2003
13 @@ -186,6 +188,13 @@ int d_invalidate(struct dentry * dentry)
14                 spin_unlock(&dcache_lock);
15                 return 0;
16         }
17 +
18 +       /* network invalidation by Lustre */
19 +       if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
20 +               spin_unlock(&dcache_lock);
21 +               return 0;
22 +       }
23 +
24         /*
25          * Check whether to do a partial shrink_dcache
26          * to get rid of unused child entries.
27 @@ -616,6 +618,7 @@ struct dentry * d_alloc(struct dentry * 
28         dentry->d_op = NULL;
29         dentry->d_fsdata = NULL;
30         dentry->d_mounted = 0;
31 +       dentry->d_it = NULL;
32         INIT_LIST_HEAD(&dentry->d_hash);
33         INIT_LIST_HEAD(&dentry->d_lru);
34         INIT_LIST_HEAD(&dentry->d_subdirs);
35 --- linux-2.4.19-hp2_pnnl2/fs/namei.c~vfs_intent_hp     Sun Jan 19 19:04:47 2003
36 +++ linux-2.4.19-hp2_pnnl2-root/fs/namei.c      Sun Jan 19 19:35:55 2003
37 @@ -94,6 +97,13 @@
38   * XEmacs seems to be relying on it...
39   */
40  
41 +void intent_release(struct dentry *de, struct lookup_intent *it)
42 +{
43 +       if (it && de->d_op && de->d_op->d_intent_release)
44 +               de->d_op->d_intent_release(de, it);
45 +
46 +}
47 +
48  /* In order to reduce some races, while at the same time doing additional
49   * checking and hopefully speeding things up, we copy filenames to the
50   * kernel data space before using them..
51 @@ -260,10 +271,19 @@ void path_release(struct nameidata *nd)
52   * Internal lookup() using the new generic dcache.
53   * SMP-safe
54   */
55 -static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags)
56 +static struct dentry *cached_lookup(struct dentry *parent, struct qstr *name,
57 +                                   int flags, struct lookup_intent *it)
58  {
59         struct dentry * dentry = d_lookup(parent, name);
60  
61 +       if (dentry && dentry->d_op && dentry->d_op->d_revalidate2) {
62 +               if (!dentry->d_op->d_revalidate2(dentry, flags, it) &&
63 +                   !d_invalidate(dentry)) {
64 +                       dput(dentry);
65 +                       dentry = NULL;
66 +               }
67 +               return dentry;
68 +       } else
69         if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
70                 if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
71                         dput(dentry);
72 @@ -281,11 +301,14 @@ static struct dentry * cached_lookup(str
73   * make sure that nobody added the entry to the dcache in the meantime..
74   * SMP-safe
75   */
76 -static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, int flags)
77 +static struct dentry *real_lookup(struct dentry *parent, struct qstr *name,
78 +                                 int flags, struct lookup_intent *it)
79  {
80         struct dentry * result;
81         struct inode *dir = parent->d_inode;
82  
83 +again:
84 +
85         down(&dir->i_sem);
86         /*
87          * First re-do the cached lookup just in case it was created
88 @@ -300,6 +321,9 @@ static struct dentry * real_lookup(struc
89                 result = ERR_PTR(-ENOMEM);
90                 if (dentry) {
91                         lock_kernel();
92 +                       if (dir->i_op->lookup2)
93 +                               result = dir->i_op->lookup2(dir, dentry, it);
94 +                       else
95                         result = dir->i_op->lookup(dir, dentry);
96                         unlock_kernel();
97                         if (result)
98 @@ -321,6 +345,12 @@ static struct dentry * real_lookup(struc
99                         dput(result);
100                         result = ERR_PTR(-ENOENT);
101                 }
102 +       } else if (result->d_op && result->d_op->d_revalidate2) {
103 +               if (!result->d_op->d_revalidate2(result, flags, it) &&
104 +                   !d_invalidate(result)) {
105 +                       dput(result);
106 +                       goto again;
107 +               }
108         }
109         return result;
110  }
111 @@ -332,7 +362,8 @@ static struct dentry * real_lookup(struc
112   * Without that kind of total limit, nasty chains of consecutive
113   * symlinks can cause almost arbitrarily long lookups. 
114   */
115 -static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
116 +static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd,
117 +                                struct lookup_intent *it)
118  {
119         int err;
120         if (current->link_count >= 5)
121 @@ -346,10 +377,14 @@ static inline int do_follow_link(struct 
122         current->link_count++;
123         current->total_link_count++;
124         UPDATE_ATIME(dentry->d_inode);
125 -       err = dentry->d_inode->i_op->follow_link(dentry, nd);
126 +       if (dentry->d_inode->i_op->follow_link2)
127 +               err = dentry->d_inode->i_op->follow_link2(dentry, nd, it);
128 +       else
129 +               err = dentry->d_inode->i_op->follow_link(dentry, nd);
130         current->link_count--;
131         return err;
132  loop:
133 +       intent_release(dentry, it);
134         path_release(nd);
135         return -ELOOP;
136  }
137 @@ -447,7 +482,8 @@ static inline void follow_dotdot(struct 
138   *
139   * We expect 'base' to be positive and a directory.
140   */
141 -int link_path_walk(const char * name, struct nameidata *nd)
142 +int link_path_walk_it(const char *name, struct nameidata *nd,
143 +                     struct lookup_intent *it)
144  {
145         struct dentry *dentry;
146         struct inode *inode;
147 @@ -520,9 +556,9 @@ int link_path_walk(const char * name, st
148                                 break;
149                 }
150                 /* This does the actual lookups.. */
151 -               dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
152 +               dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
153                 if (!dentry) {
154 -                       dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
155 +                       dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
156                         err = PTR_ERR(dentry);
157                         if (IS_ERR(dentry))
158                                 break;
159 @@ -539,8 +575,8 @@ int link_path_walk(const char * name, st
160                 if (!inode->i_op)
161                         goto out_dput;
162  
163 -               if (inode->i_op->follow_link) {
164 -                       err = do_follow_link(dentry, nd);
165 +               if (inode->i_op->follow_link || inode->i_op->follow_link2) {
166 +                       err = do_follow_link(dentry, nd, NULL);
167                         dput(dentry);
168                         if (err)
169                                 goto return_err;
170 @@ -556,7 +592,7 @@ int link_path_walk(const char * name, st
171                         nd->dentry = dentry;
172                 }
173                 err = -ENOTDIR; 
174 -               if (!inode->i_op->lookup)
175 +               if (!inode->i_op->lookup && !inode->i_op->lookup2)
176                         break;
177                 continue;
178                 /* here ends the main loop */
179 @@ -583,9 +619,9 @@ last_component:
180                         if (err < 0)
181                                 break;
182                 }
183 -               dentry = cached_lookup(nd->dentry, &this, 0);
184 +               dentry = cached_lookup(nd->dentry, &this, 0, it);
185                 if (!dentry) {
186 -                       dentry = real_lookup(nd->dentry, &this, 0);
187 +                       dentry = real_lookup(nd->dentry, &this, 0, it);
188                         err = PTR_ERR(dentry);
189                         if (IS_ERR(dentry))
190                                 break;
191 @@ -594,8 +630,9 @@ last_component:
192                         ;
193                 inode = dentry->d_inode;
194                 if ((lookup_flags & LOOKUP_FOLLOW)
195 -                   && inode && inode->i_op && inode->i_op->follow_link) {
196 -                       err = do_follow_link(dentry, nd);
197 +                   && inode && inode->i_op &&
198 +                   (inode->i_op->follow_link || inode->i_op->follow_link2)) {
199 +                       err = do_follow_link(dentry, nd, it);
200                         dput(dentry);
201                         if (err)
202                                 goto return_err;
203 @@ -609,7 +647,8 @@ last_component:
204                         goto no_inode;
205                 if (lookup_flags & LOOKUP_DIRECTORY) {
206                         err = -ENOTDIR; 
207 -                       if (!inode->i_op || !inode->i_op->lookup)
208 +                       if (!inode->i_op ||
209 +                           (!inode->i_op->lookup && !inode->i_op->lookup2))
210                                 break;
211                 }
212                 goto return_base;
213 @@ -646,15 +685,28 @@ out_dput:
214                 dput(dentry);
215                 break;
216         }
217 +       if (err)
218 +               intent_release(nd->dentry, it);
219         path_release(nd);
220  return_err:
221         return err;
222  }
223  
224 +int link_path_walk(const char * name, struct nameidata *nd)
225 +{
226 +       return link_path_walk_it(name, nd, NULL);
227 +}
228 +
229 +int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it)
230 +{
231 +       current->total_link_count = 0;
232 +       return link_path_walk_it(name, nd, it);
233 +}
234 +
235  int path_walk(const char * name, struct nameidata *nd)
236  {
237         current->total_link_count = 0;
238 -       return link_path_walk(name, nd);
239 +       return link_path_walk_it(name, nd, NULL);
240  }
241  
242  /* SMP-safe */
243 @@ -757,7 +809,8 @@ int path_init(const char *name, unsigned
244   * needs parent already locked. Doesn't follow mounts.
245   * SMP-safe.
246   */
247 -struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
248 +struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
249 +                              struct lookup_intent *it)
250  {
251         struct dentry * dentry;
252         struct inode *inode;
253 @@ -780,13 +833,16 @@ struct dentry * lookup_hash(struct qstr 
254                         goto out;
255         }
256  
257 -       dentry = cached_lookup(base, name, 0);
258 +       dentry = cached_lookup(base, name, 0, it);
259         if (!dentry) {
260                 struct dentry *new = d_alloc(base, name);
261                 dentry = ERR_PTR(-ENOMEM);
262                 if (!new)
263                         goto out;
264                 lock_kernel();
265 +               if (inode->i_op->lookup2)
266 +                       dentry = inode->i_op->lookup2(inode, new, it);
267 +               else
268                 dentry = inode->i_op->lookup(inode, new);
269                 unlock_kernel();
270                 if (!dentry)
271 @@ -798,6 +854,12 @@ out:
272         return dentry;
273  }
274  
275 +struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
276 +{
277 +       return lookup_hash_it(name, base, NULL);
278 +}
279 +
280 +
281  /* SMP-safe */
282  struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
283  {
284 @@ -819,7 +881,7 @@ struct dentry * lookup_one_len(const cha
285         }
286         this.hash = end_name_hash(hash);
287  
288 -       return lookup_hash(&this, base);
289 +       return lookup_hash_it(&this, base, NULL);
290  access:
291         return ERR_PTR(-EACCES);
292  }
293 @@ -851,6 +913,23 @@ int __user_walk(const char *name, unsign
294         return err;
295  }
296  
297 +int __user_walk_it(const char *name, unsigned flags, struct nameidata *nd,
298 +                  struct lookup_intent *it)
299 +{
300 +       char *tmp;
301 +       int err;
302 +
303 +       tmp = getname(name);
304 +       err = PTR_ERR(tmp);
305 +       if (!IS_ERR(tmp)) {
306 +               err = 0;
307 +               if (path_init(tmp, flags, nd))
308 +                       err = path_walk_it(tmp, nd, it);
309 +               putname(tmp);
310 +       }
311 +       return err;
312 +}
313 +
314  /*
315   * It's inline, so penalty for filesystems that don't use sticky bit is
316   * minimal.
317 @@ -987,7 +1066,8 @@ exit_lock:
318   * for symlinks (where the permissions are checked later).
319   * SMP-safe
320   */
321 -int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
322 +int open_namei_it(const char *pathname, int flag, int mode,
323 +                 struct nameidata *nd, struct lookup_intent *it)
324  {
325         int acc_mode, error = 0;
326         struct inode *inode;
327 @@ -1002,7 +1082,7 @@ int open_namei(const char * pathname, in
328          */
329         if (!(flag & O_CREAT)) {
330                 if (path_init(pathname, lookup_flags(flag), nd))
331 -                       error = path_walk(pathname, nd);
332 +                       error = path_walk_it(pathname, nd, it);
333                 if (error)
334                         return error;
335                 dentry = nd->dentry;
336 @@ -1012,6 +1092,10 @@ int open_namei(const char * pathname, in
337         /*
338          * Create - we need to know the parent.
339          */
340 +       if (it) {
341 +               it->it_mode = mode;
342 +               it->it_op |= IT_CREAT;
343 +       }
344         if (path_init(pathname, LOOKUP_PARENT, nd))
345                 error = path_walk(pathname, nd);
346         if (error)
347 @@ -1028,7 +1112,7 @@ int open_namei(const char * pathname, in
348  
349         dir = nd->dentry;
350         down(&dir->d_inode->i_sem);
351 -       dentry = lookup_hash(&nd->last, nd->dentry);
352 +       dentry = lookup_hash_it(&nd->last, nd->dentry, it);
353  
354  do_last:
355         error = PTR_ERR(dentry);
356 @@ -1037,6 +1121,7 @@ do_last:
357                 goto exit;
358         }
359  
360 +       it->it_mode = mode;
361         /* Negative dentry, just create the file */
362         if (!dentry->d_inode) {
363                 if (!IS_POSIXACL(dir->d_inode))
364 @@ -1071,7 +1156,8 @@ do_last:
365         error = -ENOENT;
366         if (!dentry->d_inode)
367                 goto exit_dput;
368 -       if (dentry->d_inode->i_op && dentry->d_inode->i_op->follow_link)
369 +       if (dentry->d_inode->i_op && (dentry->d_inode->i_op->follow_link ||
370 +                                     dentry->d_inode->i_op->follow_link2))
371                 goto do_link;
372  
373         dput(nd->dentry);
374 @@ -1157,8 +1243,10 @@ ok:
375         return 0;
376  
377  exit_dput:
378 +       intent_release(dentry, it);
379         dput(dentry);
380  exit:
381 +       intent_release(nd->dentry, it);
382         path_release(nd);
383         return error;
384  
385 @@ -1177,7 +1265,12 @@ do_link:
386          * are done. Procfs-like symlinks just set LAST_BIND.
387          */
388         UPDATE_ATIME(dentry->d_inode);
389 -       error = dentry->d_inode->i_op->follow_link(dentry, nd);
390 +       if (dentry->d_inode->i_op->follow_link2)
391 +               error = dentry->d_inode->i_op->follow_link2(dentry, nd, it);
392 +       else
393 +               error = dentry->d_inode->i_op->follow_link(dentry, nd);
394 +       if (error)
395 +               intent_release(dentry, it);
396         dput(dentry);
397         if (error)
398                 return error;
399 @@ -1199,13 +1292,20 @@ do_link:
400         }
401         dir = nd->dentry;
402         down(&dir->d_inode->i_sem);
403 -       dentry = lookup_hash(&nd->last, nd->dentry);
404 +       dentry = lookup_hash_it(&nd->last, nd->dentry, it);
405         putname(nd->last.name);
406         goto do_last;
407  }
408  
409 +int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd)
410 +{
411 +       return open_namei_it(pathname, flag, mode, nd, NULL);
412 +}
413 +
414 +
415  /* SMP-safe */
416 -static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
417 +static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
418 +                                   struct lookup_intent *it)
419  {
420         struct dentry *dentry;
421  
422 @@ -1213,7 +1313,7 @@ static struct dentry *lookup_create(stru
423         dentry = ERR_PTR(-EEXIST);
424         if (nd->last_type != LAST_NORM)
425                 goto fail;
426 -       dentry = lookup_hash(&nd->last, nd->dentry);
427 +       dentry = lookup_hash_it(&nd->last, nd->dentry, it);
428         if (IS_ERR(dentry))
429                 goto fail;
430         if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
431 @@ -1270,7 +1371,19 @@ asmlinkage long sys_mknod(const char * f
432                 error = path_walk(tmp, &nd);
433         if (error)
434                 goto out;
435 -       dentry = lookup_create(&nd, 0);
436 +
437 +       if (nd.dentry->d_inode->i_op->mknod2) {
438 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
439 +               error = op->mknod2(nd.dentry->d_inode,
440 +                                  nd.last.name,
441 +                                  nd.last.len,
442 +                                  mode, dev);
443 +               /* the file system want to use normal vfs path now */
444 +               if (error != -EOPNOTSUPP)
445 +                       goto out2;
446 +       }
447 +
448 +       dentry = lookup_create(&nd, 0, NULL);
449         error = PTR_ERR(dentry);
450  
451         if (!IS_POSIXACL(nd.dentry->d_inode))
452 @@ -1289,6 +1402,7 @@ asmlinkage long sys_mknod(const char * f
453                 dput(dentry);
454         }
455         up(&nd.dentry->d_inode->i_sem);
456 +out2:
457         path_release(&nd);
458  out:
459         putname(tmp);
460 @@ -1340,15 +1456,25 @@ asmlinkage long sys_mkdir(const char * p
461                         error = path_walk(tmp, &nd);
462                 if (error)
463                         goto out;
464 -               dentry = lookup_create(&nd, 1);
465 +               if (nd.dentry->d_inode->i_op->mkdir2) {
466 +                       struct inode_operations *op = nd.dentry->d_inode->i_op;
467 +                       error = op->mkdir2(nd.dentry->d_inode,
468 +                                          nd.last.name,
469 +                                          nd.last.len,
470 +                                          mode);
471 +                       /* the file system want to use normal vfs path now */
472 +                       if (error != -EOPNOTSUPP)
473 +                               goto out2;
474 +               }
475 +               dentry = lookup_create(&nd, 1, NULL);
476                 error = PTR_ERR(dentry);
477                 if (!IS_ERR(dentry)) {
478 -                       if (!IS_POSIXACL(nd.dentry->d_inode))
479 -                               mode &= ~current->fs->umask;
480 -                       error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
481 +                       error = vfs_mkdir(nd.dentry->d_inode, dentry,
482 +                                         mode & ~current->fs->umask);
483                         dput(dentry);
484                 }
485                 up(&nd.dentry->d_inode->i_sem);
486 +out2:
487                 path_release(&nd);
488  out:
489                 putname(tmp);
490 @@ -1450,8 +1578,17 @@ asmlinkage long sys_rmdir(const char * p
491                         error = -EBUSY;
492                         goto exit1;
493         }
494 +       if (nd.dentry->d_inode->i_op->rmdir2) {
495 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
496 +               error = op->rmdir2(nd.dentry->d_inode,
497 +                                  nd.last.name,
498 +                                  nd.last.len);
499 +               /* the file system want to use normal vfs path now */
500 +               if (error != -EOPNOTSUPP)
501 +                       goto exit1;
502 +       }
503         down(&nd.dentry->d_inode->i_sem);
504 -       dentry = lookup_hash(&nd.last, nd.dentry);
505 +       dentry = lookup_hash_it(&nd.last, nd.dentry, NULL);
506         error = PTR_ERR(dentry);
507         if (!IS_ERR(dentry)) {
508                 error = vfs_rmdir(nd.dentry->d_inode, dentry);
509 @@ -1510,8 +1649,17 @@ asmlinkage long sys_unlink(const char * 
510         error = -EISDIR;
511         if (nd.last_type != LAST_NORM)
512                 goto exit1;
513 +       if (nd.dentry->d_inode->i_op->unlink2) {
514 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
515 +               error = op->unlink2(nd.dentry->d_inode,
516 +                                   nd.last.name,
517 +                                   nd.last.len);
518 +               /* the file system want to use normal vfs path now */
519 +               if (error != -EOPNOTSUPP)
520 +                       goto exit1;
521 +       }
522         down(&nd.dentry->d_inode->i_sem);
523 -       dentry = lookup_hash(&nd.last, nd.dentry);
524 +       dentry = lookup_hash_it(&nd.last, nd.dentry, NULL);
525         error = PTR_ERR(dentry);
526         if (!IS_ERR(dentry)) {
527                 /* Why not before? Because we want correct error value */
528 @@ -1579,15 +1729,26 @@ asmlinkage long sys_symlink(const char *
529                         error = path_walk(to, &nd);
530                 if (error)
531                         goto out;
532 -               dentry = lookup_create(&nd, 0);
533 +               if (nd.dentry->d_inode->i_op->symlink2) {
534 +                       struct inode_operations *op = nd.dentry->d_inode->i_op;
535 +                       error = op->symlink2(nd.dentry->d_inode,
536 +                                            nd.last.name,
537 +                                            nd.last.len,
538 +                                            from);
539 +                       /* the file system want to use normal vfs path now */
540 +                       if (error != -EOPNOTSUPP)
541 +                               goto out2;
542 +               }
543 +               dentry = lookup_create(&nd, 0, NULL);
544                 error = PTR_ERR(dentry);
545                 if (!IS_ERR(dentry)) {
546                         error = vfs_symlink(nd.dentry->d_inode, dentry, from);
547                         dput(dentry);
548                 }
549                 up(&nd.dentry->d_inode->i_sem);
550 +       out2:
551                 path_release(&nd);
552 -out:
553 +       out:
554                 putname(to);
555         }
556         putname(from);
557 @@ -1660,7 +1824,7 @@ asmlinkage long sys_link(const char * ol
558  
559                 error = 0;
560                 if (path_init(from, LOOKUP_POSITIVE, &old_nd))
561 -                       error = path_walk(from, &old_nd);
562 +                       error = path_walk_it(from, &old_nd, NULL);
563                 if (error)
564                         goto exit;
565                 if (path_init(to, LOOKUP_PARENT, &nd))
566 @@ -1670,7 +1834,17 @@ asmlinkage long sys_link(const char * ol
567                 error = -EXDEV;
568                 if (old_nd.mnt != nd.mnt)
569                         goto out_release;
570 -               new_dentry = lookup_create(&nd, 0);
571 +               if (nd.dentry->d_inode->i_op->link2) {
572 +                       struct inode_operations *op = nd.dentry->d_inode->i_op;
573 +                       error = op->link2(old_nd.dentry->d_inode,
574 +                                         nd.dentry->d_inode,
575 +                                         nd.last.name,
576 +                                         nd.last.len);
577 +                       /* the file system want to use normal vfs path now */
578 +                       if (error != -EOPNOTSUPP)
579 +                               goto out_release;
580 +               }
581 +               new_dentry = lookup_create(&nd, 0, NULL);
582                 error = PTR_ERR(new_dentry);
583                 if (!IS_ERR(new_dentry)) {
584                         error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
585 @@ -1716,7 +1892,8 @@ exit:
586   *        locking].
587   */
588  int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
589 -              struct inode *new_dir, struct dentry *new_dentry)
590 +                  struct inode *new_dir, struct dentry *new_dentry,
591 +                  struct lookup_intent *it)
592  {
593         int error;
594         struct inode *target;
595 @@ -1753,6 +1923,7 @@ int vfs_rename_dir(struct inode *old_dir
596                 error = -EBUSY;
597         else 
598                 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
599 +       intent_release(new_dentry, it);
600         if (target) {
601                 if (!error)
602                         target->i_flags |= S_DEAD;
603 @@ -1795,7 +1973,8 @@ out_unlock:
604  }
605  
606  int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
607 -              struct inode *new_dir, struct dentry *new_dentry)
608 +                    struct inode *new_dir, struct dentry *new_dentry,
609 +                    struct lookup_intent *it)
610  {
611         int error;
612  
613 @@ -1826,6 +2005,7 @@ int vfs_rename_other(struct inode *old_d
614                 error = -EBUSY;
615         else
616                 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
617 +       intent_release(new_dentry, it);
618         double_up(&old_dir->i_zombie, &new_dir->i_zombie);
619         if (error)
620                 return error;
621 @@ -1837,13 +2017,14 @@ int vfs_rename_other(struct inode *old_d
622  }
623  
624  int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
625 -              struct inode *new_dir, struct dentry *new_dentry)
626 +              struct inode *new_dir, struct dentry *new_dentry,
627 +              struct lookup_intent *it)
628  {
629         int error;
630         if (S_ISDIR(old_dentry->d_inode->i_mode))
631 -               error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry);
632 +               error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry,it);
633         else
634 -               error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry);
635 +               error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry,it);
636         if (!error) {
637                 if (old_dir == new_dir)
638                         inode_dir_notify(old_dir, DN_RENAME);
639 @@ -1886,9 +2068,23 @@ static inline int do_rename(const char *
640         if (newnd.last_type != LAST_NORM)
641                 goto exit2;
642  
643 +       if (old_dir->d_inode->i_op->rename2) {
644 +               lock_kernel();
645 +               error = old_dir->d_inode->i_op->rename2(old_dir->d_inode,
646 +                                                       new_dir->d_inode,
647 +                                                       oldnd.last.name,
648 +                                                       oldnd.last.len,
649 +                                                       newnd.last.name,
650 +                                                       newnd.last.len);
651 +               unlock_kernel();
652 +               /* the file system want to use normal vfs path now */
653 +               if (error != -EOPNOTSUPP)
654 +                       goto exit2;
655 +       }
656 +
657         double_lock(new_dir, old_dir);
658  
659 -       old_dentry = lookup_hash(&oldnd.last, old_dir);
660 +       old_dentry = lookup_hash_it(&oldnd.last, old_dir, NULL);
661         error = PTR_ERR(old_dentry);
662         if (IS_ERR(old_dentry))
663                 goto exit3;
664 @@ -1904,14 +2100,14 @@ static inline int do_rename(const char *
665                 if (newnd.last.name[newnd.last.len])
666                         goto exit4;
667         }
668 -       new_dentry = lookup_hash(&newnd.last, new_dir);
669 +       new_dentry = lookup_hash_it(&newnd.last, new_dir, NULL);
670         error = PTR_ERR(new_dentry);
671         if (IS_ERR(new_dentry))
672                 goto exit4;
673  
674         lock_kernel();
675         error = vfs_rename(old_dir->d_inode, old_dentry,
676 -                                  new_dir->d_inode, new_dentry);
677 +                                  new_dir->d_inode, new_dentry, NULL);
678         unlock_kernel();
679  
680         dput(new_dentry);
681 @@ -1964,7 +2163,8 @@ out:
682  }
683  
684  static inline int
685 -__vfs_follow_link(struct nameidata *nd, const char *link)
686 +__vfs_follow_link(struct nameidata *nd, const char *link,
687 +                 struct lookup_intent *it)
688  {
689         int res = 0;
690         char *name;
691 @@ -1977,7 +2177,7 @@ __vfs_follow_link(struct nameidata *nd, 
692                         /* weird __emul_prefix() stuff did it */
693                         goto out;
694         }
695 -       res = link_path_walk(link, nd);
696 +       res = link_path_walk_it(link, nd, it);
697  out:
698         if (current->link_count || res || nd->last_type!=LAST_NORM)
699                 return res;
700 @@ -1999,7 +2199,13 @@ fail:
701  
702  int vfs_follow_link(struct nameidata *nd, const char *link)
703  {
704 -       return __vfs_follow_link(nd, link);
705 +       return __vfs_follow_link(nd, link, NULL);
706 +}
707 +
708 +int vfs_follow_link_it(struct nameidata *nd, const char *link,
709 +                      struct lookup_intent *it)
710 +{
711 +       return __vfs_follow_link(nd, link, it);
712  }
713  
714  /* get the link contents into pagecache */
715 @@ -2041,7 +2247,7 @@ int page_follow_link(struct dentry *dent
716  {
717         struct page *page = NULL;
718         char *s = page_getlink(dentry, &page);
719 -       int res = __vfs_follow_link(nd, s);
720 +       int res = __vfs_follow_link(nd, s, NULL);
721         if (page) {
722                 kunmap(page);
723                 page_cache_release(page);
724 --- linux-2.4.19-hp2_pnnl2/fs/nfsd/vfs.c~vfs_intent_hp  Sun Jan 19 19:04:47 2003
725 +++ linux-2.4.19-hp2_pnnl2-root/fs/nfsd/vfs.c   Sun Jan 19 19:37:57 2003
726 @@ -1295,7 +1295,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
727                         err = nfserr_perm;
728         } else
729  #endif
730 -       err = vfs_rename(fdir, odentry, tdir, ndentry);
731 +       err = vfs_rename(fdir, odentry, tdir, ndentry, NULL);
732         if (!err && EX_ISSYNC(tfhp->fh_export)) {
733                 nfsd_sync_dir(tdentry);
734                 nfsd_sync_dir(fdentry);
735 --- linux-2.4.19-hp2_pnnl2/fs/open.c~vfs_intent_hp      Sun Jan 19 19:04:47 2003
736 +++ linux-2.4.19-hp2_pnnl2-root/fs/open.c       Sun Jan 19 19:41:00 2003
737 @@ -19,6 +19,9 @@
738  #include <asm/uaccess.h>
739  
740  #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
741 +extern int path_walk_it(const char *name, struct nameidata *nd,
742 +                       struct lookup_intent *it);
743 +extern void intent_release(struct dentry *de, struct lookup_intent *it);
744  
745  int vfs_statfs(struct super_block *sb, struct statfs *buf)
746  {
747 @@ -118,12 +121,13 @@ static inline long do_sys_truncate(const
748         struct nameidata nd;
749         struct inode * inode;
750         int error;
751 +       struct lookup_intent it = { .it_op = IT_TRUNC };
752  
753         error = -EINVAL;
754         if (length < 0) /* sorry, but loff_t says... */
755                 goto out;
756  
757 -       error = user_path_walk(path, &nd);
758 +       error = user_path_walk_it(path, &nd, &it);
759         if (error)
760                 goto out;
761         inode = nd.dentry->d_inode;
762 @@ -168,6 +172,7 @@ static inline long do_sys_truncate(const
763         put_write_access(inode);
764  
765  dput_and_out:
766 +       intent_release(nd.dentry, &it);
767         path_release(&nd);
768  out:
769         return error;
770 @@ -259,8 +264,9 @@ asmlinkage long sys_utime(char * filenam
771         struct nameidata nd;
772         struct inode * inode;
773         struct iattr newattrs;
774 +       struct lookup_intent it = { .it_op = IT_SETATTR };
775  
776 -       error = user_path_walk(filename, &nd);
777 +       error = user_path_walk_it(filename, &nd, &it);
778         if (error)
779                 goto out;
780         inode = nd.dentry->d_inode;
781 @@ -286,6 +292,7 @@ asmlinkage long sys_utime(char * filenam
782         }
783         error = notify_change(nd.dentry, &newattrs);
784  dput_and_out:
785 +       intent_release(nd.dentry, &it);
786         path_release(&nd);
787  out:
788         return error;
789 @@ -303,8 +310,9 @@ asmlinkage long sys_utimes(char * filena
790         struct nameidata nd;
791         struct inode * inode;
792         struct iattr newattrs;
793 +       struct lookup_intent it = { .it_op = IT_SETATTR };
794  
795 -       error = user_path_walk(filename, &nd);
796 +       error = user_path_walk_it(filename, &nd, &it);
797  
798         if (error)
799                 goto out;
800 @@ -331,6 +339,7 @@ asmlinkage long sys_utimes(char * filena
801         }
802         error = notify_change(nd.dentry, &newattrs);
803  dput_and_out:
804 +       intent_release(nd.dentry, &it);
805         path_release(&nd);
806  out:
807         return error;
808 @@ -347,6 +356,7 @@ asmlinkage long sys_access(const char * 
809         int old_fsuid, old_fsgid;
810         kernel_cap_t old_cap;
811         int res;
812 +       struct lookup_intent it = { .it_op = IT_GETATTR };
813  
814         if (mode & ~S_IRWXO)    /* where's F_OK, X_OK, W_OK, R_OK? */
815                 return -EINVAL;
816 @@ -364,13 +374,14 @@ asmlinkage long sys_access(const char * 
817         else
818                 current->cap_effective = current->cap_permitted;
819  
820 -       res = user_path_walk(filename, &nd);
821 +       res = user_path_walk_it(filename, &nd, &it);
822         if (!res) {
823                 res = permission(nd.dentry->d_inode, mode);
824                 /* SuS v2 requires we report a read only fs too */
825                 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
826                    && !special_file(nd.dentry->d_inode->i_mode))
827                         res = -EROFS;
828 +               intent_release(nd.dentry, &it);
829                 path_release(&nd);
830         }
831  
832 @@ -386,6 +397,7 @@ asmlinkage long sys_chdir(const char * f
833         int error;
834         struct nameidata nd;
835         char *name;
836 +       struct lookup_intent it = { .it_op = IT_GETATTR };
837  
838         name = getname(filename);
839         error = PTR_ERR(name);
840 @@ -394,7 +406,7 @@ asmlinkage long sys_chdir(const char * f
841  
842         error = 0;
843         if (path_init(name,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd))
844 -               error = path_walk(name, &nd);
845 +               error = path_walk_it(name, &nd, &it);
846         putname(name);
847         if (error)
848                 goto out;
849 @@ -406,6 +418,7 @@ asmlinkage long sys_chdir(const char * f
850         set_fs_pwd(current->fs, nd.mnt, nd.dentry);
851  
852  dput_and_out:
853 +       intent_release(nd.dentry, &it);
854         path_release(&nd);
855  out:
856         return error;
857 @@ -446,6 +459,7 @@ asmlinkage long sys_chroot(const char * 
858         int error;
859         struct nameidata nd;
860         char *name;
861 +       struct lookup_intent it = { .it_op = IT_GETATTR };
862  
863         name = getname(filename);
864         error = PTR_ERR(name);
865 @@ -454,7 +468,7 @@ asmlinkage long sys_chroot(const char * 
866  
867         path_init(name, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
868                       LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
869 -       error = path_walk(name, &nd);   
870 +       error = path_walk_it(name, &nd, &it);
871         putname(name);
872         if (error)
873                 goto out;
874 @@ -471,6 +485,7 @@ asmlinkage long sys_chroot(const char * 
875         set_fs_altroot();
876         error = 0;
877  dput_and_out:
878 +       intent_release(nd.dentry, &it);
879         path_release(&nd);
880  out:
881         return error;
882 @@ -515,8 +530,9 @@ asmlinkage long sys_chmod(const char * f
883         struct inode * inode;
884         int error;
885         struct iattr newattrs;
886 +       struct lookup_intent it = { .it_op = IT_SETATTR };
887  
888 -       error = user_path_walk(filename, &nd);
889 +       error = user_path_walk_it(filename, &nd, &it);
890         if (error)
891                 goto out;
892         inode = nd.dentry->d_inode;
893 @@ -536,6 +552,7 @@ asmlinkage long sys_chmod(const char * f
894         error = notify_change(nd.dentry, &newattrs);
895  
896  dput_and_out:
897 +       intent_release(nd.dentry, &it);
898         path_release(&nd);
899  out:
900         return error;
901 @@ -605,10 +622,12 @@ asmlinkage long sys_chown(const char * f
902  {
903         struct nameidata nd;
904         int error;
905 +       struct lookup_intent it = { .it_op = IT_SETATTR };
906  
907 -       error = user_path_walk(filename, &nd);
908 +       error = user_path_walk_it(filename, &nd, &it);
909         if (!error) {
910                 error = chown_common(nd.dentry, user, group);
911 +               intent_release(nd.dentry, &it);
912                 path_release(&nd);
913         }
914         return error;
915 @@ -618,10 +637,12 @@ asmlinkage long sys_lchown(const char * 
916  {
917         struct nameidata nd;
918         int error;
919 +       struct lookup_intent it = { .it_op = IT_SETATTR };
920  
921 -       error = user_path_walk_link(filename, &nd);
922 +       error = user_path_walk_link_it(filename, &nd, &it);
923         if (!error) {
924                 error = chown_common(nd.dentry, user, group);
925 +               intent_release(nd.dentry, &it);
926                 path_release(&nd);
927         }
928         return error;
929 @@ -655,10 +676,16 @@ asmlinkage long sys_fchown(unsigned int 
930   * for the internal routines (ie open_namei()/follow_link() etc). 00 is
931   * used by symlinks.
932   */
933 +extern int open_namei_it(const char *filename, int namei_flags, int mode,
934 +                        struct nameidata *nd, struct lookup_intent *it);
935 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
936 +                           int flags, struct lookup_intent *it);
937 +
938  struct file *filp_open(const char * filename, int flags, int mode)
939  {
940         int namei_flags, error;
941         struct nameidata nd;
942 +       struct lookup_intent it = { .it_op = IT_OPEN, .it_flags = flags };
943  
944         namei_flags = flags;
945         if ((namei_flags+1) & O_ACCMODE)
946 @@ -666,14 +693,15 @@ struct file *filp_open(const char * file
947         if (namei_flags & O_TRUNC)
948                 namei_flags |= 2;
949  
950 -       error = open_namei(filename, namei_flags, mode, &nd);
951 -       if (!error)
952 -               return dentry_open(nd.dentry, nd.mnt, flags);
953 +       error = open_namei_it(filename, namei_flags, mode, &nd, &it);
954 +       if (error)
955 +               return ERR_PTR(error);
956  
957 -       return ERR_PTR(error);
958 +       return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
959  }
960  
961 -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
962 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
963 +                           int flags, struct lookup_intent *it)
964  {
965         struct file * f;
966         struct inode *inode;
967 @@ -716,6 +744,7 @@ struct file *dentry_open(struct dentry *
968         }
969         f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
970  
971 +       intent_release(dentry, it);
972         return f;
973  
974  cleanup_all:
975 @@ -730,11 +759,17 @@ cleanup_all:
976  cleanup_file:
977         put_filp(f);
978  cleanup_dentry:
979 +       intent_release(dentry, it);
980         dput(dentry);
981         mntput(mnt);
982         return ERR_PTR(error);
983  }
984  
985 +struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
986 +{
987 +       return dentry_open_it(dentry, mnt, flags, NULL);
988 +}
989 +
990  /*
991   * Find an empty file descriptor entry, and mark it busy.
992   */
993 --- linux-2.4.19-hp2_pnnl2/fs/stat.c~vfs_intent_hp      Sun Jan 19 19:04:47 2003
994 +++ linux-2.4.19-hp2_pnnl2-root/fs/stat.c       Sun Jan 19 19:44:51 2003
995 @@ -13,6 +13,7 @@
996  
997  #include <asm/uaccess.h>
998  
999 +extern void intent_release(struct dentry *de, struct lookup_intent *it);
1000  /*
1001   * Revalidate the inode. This is required for proper NFS attribute caching.
1002   */
1003 @@ -135,13 +136,15 @@ static int cp_new_stat(struct inode * in
1004  asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
1005  {
1006         struct nameidata nd;
1007 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1008         int error;
1009  
1010 -       error = user_path_walk(filename, &nd);
1011 +       error = user_path_walk_it(filename, &nd, &it);
1012         if (!error) {
1013                 error = do_revalidate(nd.dentry);
1014                 if (!error)
1015                         error = cp_old_stat(nd.dentry->d_inode, statbuf);
1016 +               intent_release(nd.dentry, &it);
1017                 path_release(&nd);
1018         }
1019         return error;
1020 @@ -151,13 +154,15 @@ asmlinkage long sys_stat(char * filename
1021  asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
1022  {
1023         struct nameidata nd;
1024 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1025         int error;
1026  
1027 -       error = user_path_walk(filename, &nd);
1028 +       error = user_path_walk_it(filename, &nd, &it);
1029         if (!error) {
1030                 error = do_revalidate(nd.dentry);
1031                 if (!error)
1032                         error = cp_new_stat(nd.dentry->d_inode, statbuf);
1033 +               intent_release(nd.dentry, &it);
1034                 path_release(&nd);
1035         }
1036         return error;
1037 @@ -172,13 +177,15 @@ asmlinkage long sys_newstat(char * filen
1038  asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
1039  {
1040         struct nameidata nd;
1041 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1042         int error;
1043  
1044 -       error = user_path_walk_link(filename, &nd);
1045 +       error = user_path_walk_link_it(filename, &nd, &it);
1046         if (!error) {
1047                 error = do_revalidate(nd.dentry);
1048                 if (!error)
1049                         error = cp_old_stat(nd.dentry->d_inode, statbuf);
1050 +               intent_release(nd.dentry, &it);
1051                 path_release(&nd);
1052         }
1053         return error;
1054 @@ -189,13 +196,15 @@ asmlinkage long sys_lstat(char * filenam
1055  asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
1056  {
1057         struct nameidata nd;
1058 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1059         int error;
1060  
1061 -       error = user_path_walk_link(filename, &nd);
1062 +       error = user_path_walk_link_it(filename, &nd, &it);
1063         if (!error) {
1064                 error = do_revalidate(nd.dentry);
1065                 if (!error)
1066                         error = cp_new_stat(nd.dentry->d_inode, statbuf);
1067 +               intent_release(nd.dentry, &it);
1068                 path_release(&nd);
1069         }
1070         return error;
1071 @@ -247,11 +256,12 @@ asmlinkage long sys_readlink(const char 
1072  {
1073         struct nameidata nd;
1074         int error;
1075 +       struct lookup_intent it = { .it_op = IT_READLINK };
1076  
1077         if (bufsiz <= 0)
1078                 return -EINVAL;
1079  
1080 -       error = user_path_walk_link(path, &nd);
1081 +       error = user_path_walk_link_it(path, &nd, &it);
1082         if (!error) {
1083                 struct inode * inode = nd.dentry->d_inode;
1084  
1085 @@ -261,6 +271,7 @@ asmlinkage long sys_readlink(const char 
1086                         UPDATE_ATIME(inode);
1087                         error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
1088                 }
1089 +               intent_release(nd.dentry, &it);
1090                 path_release(&nd);
1091         }
1092         return error;
1093 @@ -333,12 +344,14 @@ asmlinkage long sys_stat64(char * filena
1094  {
1095         struct nameidata nd;
1096         int error;
1097 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1098  
1099 -       error = user_path_walk(filename, &nd);
1100 +       error = user_path_walk_it(filename, &nd, &it);
1101         if (!error) {
1102                 error = do_revalidate(nd.dentry);
1103                 if (!error)
1104                         error = cp_new_stat64(nd.dentry->d_inode, statbuf);
1105 +               intent_release(nd.dentry, &it);
1106                 path_release(&nd);
1107         }
1108         return error;
1109 @@ -348,12 +361,14 @@ asmlinkage long sys_lstat64(char * filen
1110  {
1111         struct nameidata nd;
1112         int error;
1113 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1114  
1115 -       error = user_path_walk_link(filename, &nd);
1116 +       error = user_path_walk_link_it(filename, &nd, &it);
1117         if (!error) {
1118                 error = do_revalidate(nd.dentry);
1119                 if (!error)
1120                         error = cp_new_stat64(nd.dentry->d_inode, statbuf);
1121 +               intent_release(nd.dentry, &it);
1122                 path_release(&nd);
1123         }
1124         return error;
1125 --- linux-2.4.19-hp2_pnnl2/include/linux/dcache.h~vfs_intent_hp Sun Jan 19 19:04:47 2003
1126 +++ linux-2.4.19-hp2_pnnl2-root/include/linux/dcache.h  Sun Jan 19 19:04:48 2003
1127 @@ -6,6 +6,27 @@
1128  #include <asm/atomic.h>
1129  #include <linux/mount.h>
1130  
1131 +#define IT_OPEN     (1)
1132 +#define IT_CREAT    (1<<1)
1133 +#define IT_READDIR  (1<<2)
1134 +#define IT_GETATTR  (1<<3)
1135 +#define IT_SETATTR  (1<<4)
1136 +#define IT_TRUNC    (1<<5)
1137 +#define IT_READLINK (1<<6)
1138 +#define IT_LOOKUP   (1<<7)
1139 +
1140 +struct lookup_intent {
1141 +       int it_op;
1142 +       int it_mode;
1143 +       int it_flags;
1144 +       int it_disposition;
1145 +       int it_status;
1146 +       struct iattr *it_iattr;
1147 +       __u64 it_lock_handle[2];
1148 +       int it_lock_mode;
1149 +       void *it_data;
1150 +};
1151 +
1152  /*
1153   * linux/include/linux/dcache.h
1154   *
1155 @@ -78,6 +106,7 @@ struct dentry {
1156         unsigned long d_time;           /* used by d_revalidate */
1157         struct dentry_operations  *d_op;
1158         struct super_block * d_sb;      /* The root of the dentry tree */
1159 +       struct lookup_intent *d_it;
1160         unsigned long d_vfs_flags;
1161         void * d_fsdata;                /* fs-specific data */
1162         unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
1163 @@ -90,6 +119,8 @@ struct dentry_operations {
1164         int (*d_delete)(struct dentry *);
1165         void (*d_release)(struct dentry *);
1166         void (*d_iput)(struct dentry *, struct inode *);
1167 +       int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
1168 +       void (*d_intent_release)(struct dentry *, struct lookup_intent *);
1169  };
1170  
1171  /* the dentry parameter passed to d_hash and d_compare is the parent
1172 @@ -124,6 +148,7 @@ d_iput:             no              no              yes
1173                                          * s_nfsd_free_path semaphore will be down
1174                                          */
1175  #define DCACHE_REFERENCED      0x0008  /* Recently used, don't discard. */
1176 +#define DCACHE_LUSTRE_INVALID  0x0010  /* Lustre invalidated */
1177  
1178  extern spinlock_t dcache_lock;
1179  
1180 --- linux-2.4.19-hp2_pnnl2/include/linux/fs.h~vfs_intent_hp     Sun Jan 19 19:04:47 2003
1181 +++ linux-2.4.19-hp2_pnnl2-root/include/linux/fs.h      Sun Jan 19 19:04:48 2003
1182 @@ -575,6 +575,7 @@ struct file {
1183  
1184         /* needed for tty driver, and maybe others */
1185         void                    *private_data;
1186 +       struct lookup_intent    *f_intent;
1187  
1188         /* preallocated helper kiobuf to speedup O_DIRECT */
1189         struct kiobuf           *f_iobuf;
1190 @@ -815,7 +816,9 @@ extern int vfs_symlink(struct inode *, s
1191  extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
1192  extern int vfs_rmdir(struct inode *, struct dentry *);
1193  extern int vfs_unlink(struct inode *, struct dentry *);
1194 -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
1195 +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1196 +               struct inode *new_dir, struct dentry *new_dentry,
1197 +               struct lookup_intent *it);
1198  
1199  /*
1200   * File types
1201 @@ -876,16 +879,28 @@ struct file_operations {
1202  struct inode_operations {
1203         int (*create) (struct inode *,struct dentry *,int);
1204         struct dentry * (*lookup) (struct inode *,struct dentry *);
1205 +       struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *);
1206         int (*link) (struct dentry *,struct inode *,struct dentry *);
1207 +       int (*link2) (struct inode *,struct inode *, const char *, int);
1208         int (*unlink) (struct inode *,struct dentry *);
1209 +       int (*unlink2) (struct inode *, const char *, int);
1210         int (*symlink) (struct inode *,struct dentry *,const char *);
1211 +       int (*symlink2) (struct inode *, const char *, int, const char *);
1212         int (*mkdir) (struct inode *,struct dentry *,int);
1213 +       int (*mkdir2) (struct inode *, const char *, int,int);
1214         int (*rmdir) (struct inode *,struct dentry *);
1215 +       int (*rmdir2) (struct inode *, const char *, int);
1216         int (*mknod) (struct inode *,struct dentry *,int,int);
1217 +       int (*mknod2) (struct inode *, const char *, int,int,int);
1218         int (*rename) (struct inode *, struct dentry *,
1219                         struct inode *, struct dentry *);
1220 +       int (*rename2) (struct inode *, struct inode *,
1221 +                       const char *oldname, int oldlen,
1222 +                       const char *newname, int newlen);
1223         int (*readlink) (struct dentry *, char *,int);
1224         int (*follow_link) (struct dentry *, struct nameidata *);
1225 +       int (*follow_link2) (struct dentry *, struct nameidata *,
1226 +                            struct lookup_intent *it);
1227         void (*truncate) (struct inode *);
1228         int (*permission) (struct inode *, int);
1229         int (*revalidate) (struct dentry *);
1230 @@ -1354,6 +1369,7 @@ typedef int (*read_actor_t)(read_descrip
1231  extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
1232  
1233  extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
1234 +extern int FASTCALL(__user_walk_it(const char *, unsigned, struct nameidata *, struct lookup_intent *it));
1235  extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
1236  extern int FASTCALL(path_walk(const char *, struct nameidata *));
1237  extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
1238 @@ -1364,6 +1380,8 @@ extern struct dentry * lookup_one_len(co
1239  extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
1240  #define user_path_walk(name,nd)         __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
1241  #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
1242 +#define user_path_walk_it(name,nd,it)  __user_walk_it(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd, it)
1243 +#define user_path_walk_link_it(name,nd,it) __user_walk_it(name, LOOKUP_POSITIVE, nd, it)
1244  
1245  extern void inode_init_once(struct inode *);
1246  extern void iput(struct inode *);
1247 @@ -1499,6 +1517,8 @@ extern struct file_operations generic_ro
1248  
1249  extern int vfs_readlink(struct dentry *, char *, int, const char *);
1250  extern int vfs_follow_link(struct nameidata *, const char *);
1251 +extern int vfs_follow_link_it(struct nameidata *, const char *,
1252 +                             struct lookup_intent *it);
1253  extern int page_readlink(struct dentry *, char *, int);
1254  extern int page_follow_link(struct dentry *, struct nameidata *);
1255  extern struct inode_operations page_symlink_inode_operations;
1256 --- linux-2.4.19-hp2_pnnl2/kernel/ksyms.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
1257 +++ linux-2.4.19-hp2_pnnl2-root/kernel/ksyms.c  Sun Jan 19 19:04:48 2003
1258 @@ -293,6 +293,7 @@ EXPORT_SYMBOL(read_cache_page);
1259  EXPORT_SYMBOL(set_page_dirty);
1260  EXPORT_SYMBOL(vfs_readlink);
1261  EXPORT_SYMBOL(vfs_follow_link);
1262 +EXPORT_SYMBOL(vfs_follow_link_it);
1263  EXPORT_SYMBOL(page_readlink);
1264  EXPORT_SYMBOL(page_follow_link);
1265  EXPORT_SYMBOL(page_symlink_inode_operations);
1266
1267 _