Whamcloud - gitweb
738467551eccdf55ba8435d15ca4fc04ad9d72ab
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent-2.4.18-18.patch
1  fs/dcache.c            |    8 +
2  fs/namei.c             |  288 ++++++++++++++++++++++++++++++++++++++++---------
3  fs/nfsd/vfs.c          |    2 
4  fs/open.c              |   53 +++++++--
5  fs/stat.c              |    9 +
6  include/linux/dcache.h |   25 ++++
7  include/linux/fs.h     |   22 +++
8  kernel/ksyms.c         |    1 
9  8 files changed, 345 insertions(+), 63 deletions(-)
10
11 --- linux-2.4.18-49chaos-lustre9/fs/dcache.c~vfs_intent-2.4.18-18       Wed Jan 29 12:43:32 2003
12 +++ linux-2.4.18-49chaos-lustre9-root/fs/dcache.c       Wed Jan 29 12:43:32 2003
13 @@ -186,6 +186,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 @@ -645,6 +652,7 @@ struct dentry * d_alloc(struct dentry * 
28         dentry->d_fsdata = NULL;
29         dentry->d_extra_attributes = 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.18-49chaos-lustre9/fs/namei.c~vfs_intent-2.4.18-18        Wed Jan 29 12:43:32 2003
36 +++ linux-2.4.18-49chaos-lustre9-root/fs/namei.c        Wed Feb  5 16:23:06 2003
37 @@ -94,6 +94,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 +267,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 +297,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 +319,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 +343,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 @@ -334,7 +362,8 @@ int max_recursive_link = 5;
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 >= max_recursive_link)
121 @@ -348,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 @@ -449,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 @@ -526,12 +560,12 @@ 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                         err = -EWOULDBLOCKIO;
155                         if (atomic)
156                                 break;
157 -                       dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
158 +                       dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
159                         err = PTR_ERR(dentry);
160                         if (IS_ERR(dentry))
161                                 break;
162 @@ -548,8 +582,8 @@ int link_path_walk(const char * name, st
163                 if (!inode->i_op)
164                         goto out_dput;
165  
166 -               if (inode->i_op->follow_link) {
167 -                       err = do_follow_link(dentry, nd);
168 +               if (inode->i_op->follow_link || inode->i_op->follow_link2) {
169 +                       err = do_follow_link(dentry, nd, NULL);
170                         dput(dentry);
171                         if (err)
172                                 goto return_err;
173 @@ -565,7 +599,7 @@ int link_path_walk(const char * name, st
174                         nd->dentry = dentry;
175                 }
176                 err = -ENOTDIR; 
177 -               if (!inode->i_op->lookup)
178 +               if (!inode->i_op->lookup && !inode->i_op->lookup2)
179                         break;
180                 continue;
181                 /* here ends the main loop */
182 @@ -592,12 +626,12 @@ last_component:
183                         if (err < 0)
184                                 break;
185                 }
186 -               dentry = cached_lookup(nd->dentry, &this, 0);
187 +               dentry = cached_lookup(nd->dentry, &this, 0, it);
188                 if (!dentry) {
189                         err = -EWOULDBLOCKIO;
190                         if (atomic)
191                                 break;
192 -                       dentry = real_lookup(nd->dentry, &this, 0);
193 +                       dentry = real_lookup(nd->dentry, &this, 0, it);
194                         err = PTR_ERR(dentry);
195                         if (IS_ERR(dentry))
196                                 break;
197 @@ -606,8 +640,9 @@ last_component:
198                         ;
199                 inode = dentry->d_inode;
200                 if ((lookup_flags & LOOKUP_FOLLOW)
201 -                   && inode && inode->i_op && inode->i_op->follow_link) {
202 -                       err = do_follow_link(dentry, nd);
203 +                   && inode && inode->i_op &&
204 +                   (inode->i_op->follow_link || inode->i_op->follow_link2)) {
205 +                       err = do_follow_link(dentry, nd, it);
206                         dput(dentry);
207                         if (err)
208                                 goto return_err;
209 @@ -621,7 +656,8 @@ last_component:
210                         goto no_inode;
211                 if (lookup_flags & LOOKUP_DIRECTORY) {
212                         err = -ENOTDIR; 
213 -                       if (!inode->i_op || !inode->i_op->lookup)
214 +                       if (!inode->i_op ||
215 +                           (!inode->i_op->lookup && !inode->i_op->lookup2))
216                                 break;
217                 }
218                 goto return_base;
219 @@ -658,15 +694,28 @@ out_dput:
220                 dput(dentry);
221                 break;
222         }
223 +       if (err)
224 +               intent_release(nd->dentry, it);
225         path_release(nd);
226  return_err:
227         return err;
228  }
229  
230 +int link_path_walk(const char * name, struct nameidata *nd)
231 +{
232 +       return link_path_walk_it(name, nd, NULL);
233 +}
234 +
235 +int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it)
236 +{
237 +       current->total_link_count = 0;
238 +       return link_path_walk_it(name, nd, it);
239 +}
240 +
241  int path_walk(const char * name, struct nameidata *nd)
242  {
243         current->total_link_count = 0;
244 -       return link_path_walk(name, nd);
245 +       return link_path_walk_it(name, nd, NULL);
246  }
247  
248  /* SMP-safe */
249 @@ -751,6 +800,17 @@ walk_init_root(const char *name, struct 
250  }
251  
252  /* SMP-safe */
253 +int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
254 +                  struct lookup_intent *it)
255 +{
256 +       int error = 0;
257 +       if (path_init(path, flags, nd))
258 +               error = path_walk_it(path, nd, it);
259 +       return error;
260 +}
261 +
262 +
263 +/* SMP-safe */
264  int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
265  {
266         int error = 0;
267 @@ -779,7 +839,8 @@ int path_init(const char *name, unsigned
268   * needs parent already locked. Doesn't follow mounts.
269   * SMP-safe.
270   */
271 -struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
272 +struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
273 +                              struct lookup_intent *it)
274  {
275         struct dentry * dentry;
276         struct inode *inode;
277 @@ -802,13 +863,16 @@ struct dentry * lookup_hash(struct qstr 
278                         goto out;
279         }
280  
281 -       dentry = cached_lookup(base, name, 0);
282 +       dentry = cached_lookup(base, name, 0, it);
283         if (!dentry) {
284                 struct dentry *new = d_alloc(base, name);
285                 dentry = ERR_PTR(-ENOMEM);
286                 if (!new)
287                         goto out;
288                 lock_kernel();
289 +               if (inode->i_op->lookup2)
290 +                       dentry = inode->i_op->lookup2(inode, new, it);
291 +               else
292                 dentry = inode->i_op->lookup(inode, new);
293                 unlock_kernel();
294                 if (!dentry)
295 @@ -820,6 +884,12 @@ out:
296         return dentry;
297  }
298  
299 +struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
300 +{
301 +       return lookup_hash_it(name, base, NULL);
302 +}
303 +
304 +
305  /* SMP-safe */
306  struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
307  {
308 @@ -841,7 +911,7 @@ struct dentry * lookup_one_len(const cha
309         }
310         this.hash = end_name_hash(hash);
311  
312 -       return lookup_hash(&this, base);
313 +       return lookup_hash_it(&this, base, NULL);
314  access:
315         return ERR_PTR(-EACCES);
316  }
317 @@ -872,6 +942,23 @@ int __user_walk(const char *name, unsign
318         return err;
319  }
320  
321 +int __user_walk_it(const char *name, unsigned flags, struct nameidata *nd,
322 +                  struct lookup_intent *it)
323 +{
324 +       char *tmp;
325 +       int err;
326 +
327 +       tmp = getname(name);
328 +       err = PTR_ERR(tmp);
329 +       if (!IS_ERR(tmp)) {
330 +               err = 0;
331 +               if (path_init(tmp, flags, nd))
332 +                       err = path_walk_it(tmp, nd, it);
333 +               putname(tmp);
334 +       }
335 +       return err;
336 +}
337 +
338  /*
339   * It's inline, so penalty for filesystems that don't use sticky bit is
340   * minimal.
341 @@ -1045,14 +1132,17 @@ int may_open(struct nameidata *nd, int a
342          return get_lease(inode, flag);
343  }
344  
345 +extern struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
346 +                                  int flags, struct lookup_intent *it);
347 +
348  struct file *filp_open(const char * pathname, int open_flags, int mode)
349  {
350         int acc_mode, error = 0;
351 -       struct inode *inode;
352         struct dentry *dentry;
353         struct dentry *dir;
354         int flag = open_flags;
355         struct nameidata nd;
356 +       struct lookup_intent it = { .it_op = IT_OPEN, .it_flags = open_flags };
357         int count = 0;
358  
359         if ((flag+1) & O_ACCMODE)
360 @@ -1066,7 +1156,7 @@ struct file *filp_open(const char * path
361          * The simplest case - just a plain lookup.
362          */
363         if (!(flag & O_CREAT)) {
364 -               error = path_lookup(pathname, lookup_flags(flag), &nd);
365 +               error = path_lookup_it(pathname, lookup_flags(flag), &nd, &it);
366                 if (error)
367                         return ERR_PTR(error);
368                 dentry = nd.dentry;
369 @@ -1076,6 +1166,8 @@ struct file *filp_open(const char * path
370         /*
371          * Create - we need to know the parent.
372          */
373 +       it.it_mode = mode;
374 +       it.it_op |= IT_CREAT;
375         error = path_lookup(pathname, LOOKUP_PARENT, &nd);
376         if (error)
377                 return ERR_PTR(error);
378 @@ -1091,7 +1183,7 @@ struct file *filp_open(const char * path
379  
380         dir = nd.dentry;
381         down(&dir->d_inode->i_sem);
382 -       dentry = lookup_hash(&nd.last, nd.dentry);
383 +       dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
384  
385  do_last:
386         error = PTR_ERR(dentry);
387 @@ -1100,6 +1192,7 @@ do_last:
388                 goto exit;
389         }
390  
391 +       it.it_mode = mode;
392         /* Negative dentry, just create the file */
393         if (!dentry->d_inode) {
394                 error = vfs_create(dir->d_inode, dentry,
395 @@ -1134,7 +1227,8 @@ do_last:
396         error = -ENOENT;
397         if (!dentry->d_inode)
398                 goto exit_dput;
399 -       if (dentry->d_inode->i_op && dentry->d_inode->i_op->follow_link)
400 +       if (dentry->d_inode->i_op && (dentry->d_inode->i_op->follow_link ||
401 +                                     dentry->d_inode->i_op->follow_link2))
402                 goto do_link;
403  
404         dput(nd.dentry);
405 @@ -1149,11 +1243,13 @@ ok:
406         if (!S_ISREG(nd.dentry->d_inode->i_mode))
407                 open_flags &= ~O_TRUNC;
408  
409 -        return dentry_open(nd.dentry, nd.mnt, open_flags);
410 +       return dentry_open_it(nd.dentry, nd.mnt, open_flags, &it);
411  
412  exit_dput:
413 +       intent_release(dentry, &it);
414         dput(dentry);
415  exit:
416 +       intent_release(nd.dentry, &it);
417         path_release(&nd);
418         return ERR_PTR(error);
419  
420 @@ -1172,7 +1268,12 @@ do_link:
421          * are done. Procfs-like symlinks just set LAST_BIND.
422          */
423         UPDATE_ATIME(dentry->d_inode);
424 -       error = dentry->d_inode->i_op->follow_link(dentry, &nd);
425 +       if (dentry->d_inode->i_op->follow_link2)
426 +               error = dentry->d_inode->i_op->follow_link2(dentry, &nd, &it);
427 +       else
428 +               error = dentry->d_inode->i_op->follow_link(dentry, &nd);
429 +       if (error)
430 +               intent_release(dentry, &it);
431         dput(dentry);
432         if (error)
433                 return error;
434 @@ -1194,13 +1295,15 @@ do_link:
435         }
436         dir = nd.dentry;
437         down(&dir->d_inode->i_sem);
438 -       dentry = lookup_hash(&nd.last, nd.dentry);
439 +       dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
440         putname(nd.last.name);
441         goto do_last;
442  }
443  
444 +
445  /* SMP-safe */
446 -static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
447 +static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
448 +                                   struct lookup_intent *it)
449  {
450         struct dentry *dentry;
451  
452 @@ -1208,7 +1311,7 @@ static struct dentry *lookup_create(stru
453         dentry = ERR_PTR(-EEXIST);
454         if (nd->last_type != LAST_NORM)
455                 goto fail;
456 -       dentry = lookup_hash(&nd->last, nd->dentry);
457 +       dentry = lookup_hash_it(&nd->last, nd->dentry, it);
458         if (IS_ERR(dentry))
459                 goto fail;
460         if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
461 @@ -1264,7 +1367,19 @@ asmlinkage long sys_mknod(const char * f
462         error = path_lookup(tmp, LOOKUP_PARENT, &nd);
463         if (error)
464                 goto out;
465 -       dentry = lookup_create(&nd, 0);
466 +
467 +       if (nd.dentry->d_inode->i_op->mknod2) {
468 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
469 +               error = op->mknod2(nd.dentry->d_inode,
470 +                                  nd.last.name,
471 +                                  nd.last.len,
472 +                                  mode, dev);
473 +               /* the file system want to use normal vfs path now */
474 +               if (error != -EOPNOTSUPP)
475 +                       goto out2;
476 +       }
477 +
478 +       dentry = lookup_create(&nd, 0, NULL);
479         error = PTR_ERR(dentry);
480  
481         mode &= ~current->fs->umask;
482 @@ -1285,6 +1400,7 @@ asmlinkage long sys_mknod(const char * f
483                 dput(dentry);
484         }
485         up(&nd.dentry->d_inode->i_sem);
486 +out2:
487         path_release(&nd);
488  out:
489         putname(tmp);
490 @@ -1332,7 +1448,17 @@ asmlinkage long sys_mkdir(const char * p
491                 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
492                 if (error)
493                         goto out;
494 -               dentry = lookup_create(&nd, 1);
495 +               if (nd.dentry->d_inode->i_op->mkdir2) {
496 +                       struct inode_operations *op = nd.dentry->d_inode->i_op;
497 +                       error = op->mkdir2(nd.dentry->d_inode,
498 +                                          nd.last.name,
499 +                                          nd.last.len,
500 +                                          mode);
501 +                       /* the file system want to use normal vfs path now */
502 +                       if (error != -EOPNOTSUPP)
503 +                               goto out2;
504 +               }
505 +               dentry = lookup_create(&nd, 1, NULL);
506                 error = PTR_ERR(dentry);
507                 if (!IS_ERR(dentry)) {
508                         error = vfs_mkdir(nd.dentry->d_inode, dentry,
509 @@ -1340,6 +1466,7 @@ asmlinkage long sys_mkdir(const char * p
510                         dput(dentry);
511                 }
512                 up(&nd.dentry->d_inode->i_sem);
513 +out2:
514                 path_release(&nd);
515  out:
516                 putname(tmp);
517 @@ -1440,8 +1567,17 @@ asmlinkage long sys_rmdir(const char * p
518                         error = -EBUSY;
519                         goto exit1;
520         }
521 +       if (nd.dentry->d_inode->i_op->rmdir2) {
522 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
523 +               error = op->rmdir2(nd.dentry->d_inode,
524 +                                  nd.last.name,
525 +                                  nd.last.len);
526 +               /* the file system want to use normal vfs path now */
527 +               if (error != -EOPNOTSUPP)
528 +                       goto exit1;
529 +       }
530         down(&nd.dentry->d_inode->i_sem);
531 -       dentry = lookup_hash(&nd.last, nd.dentry);
532 +       dentry = lookup_hash_it(&nd.last, nd.dentry, NULL);
533         error = PTR_ERR(dentry);
534         if (!IS_ERR(dentry)) {
535                 error = vfs_rmdir(nd.dentry->d_inode, dentry);
536 @@ -1499,8 +1635,17 @@ asmlinkage long sys_unlink(const char * 
537         error = -EISDIR;
538         if (nd.last_type != LAST_NORM)
539                 goto exit1;
540 +       if (nd.dentry->d_inode->i_op->unlink2) {
541 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
542 +               error = op->unlink2(nd.dentry->d_inode,
543 +                                   nd.last.name,
544 +                                   nd.last.len);
545 +               /* the file system want to use normal vfs path now */
546 +               if (error != -EOPNOTSUPP)
547 +                       goto exit1;
548 +       }
549         down(&nd.dentry->d_inode->i_sem);
550 -       dentry = lookup_hash(&nd.last, nd.dentry);
551 +       dentry = lookup_hash_it(&nd.last, nd.dentry, NULL);
552         error = PTR_ERR(dentry);
553         if (!IS_ERR(dentry)) {
554                 /* Why not before? Because we want correct error value */
555 @@ -1567,15 +1712,26 @@ asmlinkage long sys_symlink(const char *
556                 error = path_lookup(to, LOOKUP_PARENT, &nd);
557                 if (error)
558                         goto out;
559 -               dentry = lookup_create(&nd, 0);
560 +               if (nd.dentry->d_inode->i_op->symlink2) {
561 +                       struct inode_operations *op = nd.dentry->d_inode->i_op;
562 +                       error = op->symlink2(nd.dentry->d_inode,
563 +                                            nd.last.name,
564 +                                            nd.last.len,
565 +                                            from);
566 +                       /* the file system want to use normal vfs path now */
567 +                       if (error != -EOPNOTSUPP)
568 +                               goto out2;
569 +               }
570 +               dentry = lookup_create(&nd, 0, NULL);
571                 error = PTR_ERR(dentry);
572                 if (!IS_ERR(dentry)) {
573                         error = vfs_symlink(nd.dentry->d_inode, dentry, from);
574                         dput(dentry);
575                 }
576                 up(&nd.dentry->d_inode->i_sem);
577 +       out2:
578                 path_release(&nd);
579 -out:
580 +       out:
581                 putname(to);
582         }
583         putname(from);
584 @@ -1642,7 +1798,7 @@ asmlinkage long sys_link(const char * ol
585                 struct dentry *new_dentry;
586                 struct nameidata nd, old_nd;
587  
588 -               error = __user_walk(oldname, LOOKUP_POSITIVE, &old_nd);
589 +               error = __user_walk_it(oldname, LOOKUP_POSITIVE, &old_nd, NULL);
590                 if (error)
591                         goto exit;
592                 error = path_lookup(to, LOOKUP_PARENT, &nd);
593 @@ -1651,7 +1807,17 @@ asmlinkage long sys_link(const char * ol
594                 error = -EXDEV;
595                 if (old_nd.mnt != nd.mnt)
596                         goto out_release;
597 -               new_dentry = lookup_create(&nd, 0);
598 +               if (nd.dentry->d_inode->i_op->link2) {
599 +                       struct inode_operations *op = nd.dentry->d_inode->i_op;
600 +                       error = op->link2(old_nd.dentry->d_inode,
601 +                                         nd.dentry->d_inode,
602 +                                         nd.last.name,
603 +                                         nd.last.len);
604 +                       /* the file system want to use normal vfs path now */
605 +                       if (error != -EOPNOTSUPP)
606 +                               goto out_release;
607 +               }
608 +               new_dentry = lookup_create(&nd, 0, NULL);
609                 error = PTR_ERR(new_dentry);
610                 if (!IS_ERR(new_dentry)) {
611                         error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
612 @@ -1695,7 +1861,8 @@ exit:
613   *        locking].
614   */
615  int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
616 -              struct inode *new_dir, struct dentry *new_dentry)
617 +                  struct inode *new_dir, struct dentry *new_dentry,
618 +                  struct lookup_intent *it)
619  {
620         int error;
621         struct inode *target;
622 @@ -1753,6 +1920,7 @@ int vfs_rename_dir(struct inode *old_dir
623                 error = -EBUSY;
624         else 
625                 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
626 +       intent_release(new_dentry, it);
627         if (target) {
628                 if (!error)
629                         target->i_flags |= S_DEAD;
630 @@ -1774,7 +1942,8 @@ out_unlock:
631  }
632  
633  int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
634 -              struct inode *new_dir, struct dentry *new_dentry)
635 +                    struct inode *new_dir, struct dentry *new_dentry,
636 +                    struct lookup_intent *it)
637  {
638         int error;
639  
640 @@ -1805,6 +1974,7 @@ int vfs_rename_other(struct inode *old_d
641                 error = -EBUSY;
642         else
643                 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
644 +       intent_release(new_dentry, it);
645         double_up(&old_dir->i_zombie, &new_dir->i_zombie);
646         if (error)
647                 return error;
648 @@ -1816,13 +1986,14 @@ int vfs_rename_other(struct inode *old_d
649  }
650  
651  int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
652 -              struct inode *new_dir, struct dentry *new_dentry)
653 +              struct inode *new_dir, struct dentry *new_dentry,
654 +              struct lookup_intent *it)
655  {
656         int error;
657         if (S_ISDIR(old_dentry->d_inode->i_mode))
658 -               error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry);
659 +               error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry,it);
660         else
661 -               error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry);
662 +               error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry,it);
663         if (!error) {
664                 if (old_dir == new_dir)
665                         inode_dir_notify(old_dir, DN_RENAME);
666 @@ -1862,9 +2033,23 @@ static inline int do_rename(const char *
667         if (newnd.last_type != LAST_NORM)
668                 goto exit2;
669  
670 +       if (old_dir->d_inode->i_op->rename2) {
671 +               lock_kernel();
672 +               error = old_dir->d_inode->i_op->rename2(old_dir->d_inode,
673 +                                                       new_dir->d_inode,
674 +                                                       oldnd.last.name,
675 +                                                       oldnd.last.len,
676 +                                                       newnd.last.name,
677 +                                                       newnd.last.len);
678 +               unlock_kernel();
679 +               /* the file system want to use normal vfs path now */
680 +               if (error != -EOPNOTSUPP)
681 +                       goto exit2;
682 +       }
683 +
684         double_lock(new_dir, old_dir);
685  
686 -       old_dentry = lookup_hash(&oldnd.last, old_dir);
687 +       old_dentry = lookup_hash_it(&oldnd.last, old_dir, NULL);
688         error = PTR_ERR(old_dentry);
689         if (IS_ERR(old_dentry))
690                 goto exit3;
691 @@ -1880,14 +2065,14 @@ static inline int do_rename(const char *
692                 if (newnd.last.name[newnd.last.len])
693                         goto exit4;
694         }
695 -       new_dentry = lookup_hash(&newnd.last, new_dir);
696 +       new_dentry = lookup_hash_it(&newnd.last, new_dir, NULL);
697         error = PTR_ERR(new_dentry);
698         if (IS_ERR(new_dentry))
699                 goto exit4;
700  
701         lock_kernel();
702         error = vfs_rename(old_dir->d_inode, old_dentry,
703 -                                  new_dir->d_inode, new_dentry);
704 +                                  new_dir->d_inode, new_dentry, NULL);
705         unlock_kernel();
706  
707         dput(new_dentry);
708 @@ -1940,7 +2125,8 @@ out:
709  }
710  
711  static inline int
712 -__vfs_follow_link(struct nameidata *nd, const char *link)
713 +__vfs_follow_link(struct nameidata *nd, const char *link,
714 +                 struct lookup_intent *it)
715  {
716         int res = 0;
717         char *name;
718 @@ -1953,7 +2139,7 @@ __vfs_follow_link(struct nameidata *nd, 
719                         /* weird __emul_prefix() stuff did it */
720                         goto out;
721         }
722 -       res = link_path_walk(link, nd);
723 +       res = link_path_walk_it(link, nd, it);
724  out:
725         if (current->link_count || res || nd->last_type!=LAST_NORM)
726                 return res;
727 @@ -1975,7 +2161,13 @@ fail:
728  
729  int vfs_follow_link(struct nameidata *nd, const char *link)
730  {
731 -       return __vfs_follow_link(nd, link);
732 +       return __vfs_follow_link(nd, link, NULL);
733 +}
734 +
735 +int vfs_follow_link_it(struct nameidata *nd, const char *link,
736 +                      struct lookup_intent *it)
737 +{
738 +       return __vfs_follow_link(nd, link, it);
739  }
740  
741  /* get the link contents into pagecache */
742 @@ -2017,7 +2209,7 @@ int page_follow_link(struct dentry *dent
743  {
744         struct page *page = NULL;
745         char *s = page_getlink(dentry, &page);
746 -       int res = __vfs_follow_link(nd, s);
747 +       int res = __vfs_follow_link(nd, s, NULL);
748         if (page) {
749                 kunmap(page);
750                 page_cache_release(page);
751 --- linux-2.4.18-49chaos-lustre9/fs/nfsd/vfs.c~vfs_intent-2.4.18-18     Wed Jan 29 12:43:32 2003
752 +++ linux-2.4.18-49chaos-lustre9-root/fs/nfsd/vfs.c     Wed Jan 29 12:43:32 2003
753 @@ -1298,7 +1298,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
754                         err = nfserr_perm;
755         } else
756  #endif
757 -       err = vfs_rename(fdir, odentry, tdir, ndentry);
758 +       err = vfs_rename(fdir, odentry, tdir, ndentry, NULL);
759         unlock_kernel();
760         if (!err && EX_ISSYNC(tfhp->fh_export)) {
761                 nfsd_sync_dir(tdentry);
762 --- linux-2.4.18-49chaos-lustre9/fs/open.c~vfs_intent-2.4.18-18 Wed Jan 29 12:43:32 2003
763 +++ linux-2.4.18-49chaos-lustre9-root/fs/open.c Wed Jan 29 12:43:32 2003
764 @@ -19,6 +19,9 @@
765  #include <asm/uaccess.h>
766  
767  #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
768 +extern int path_walk_it(const char *name, struct nameidata *nd,
769 +                       struct lookup_intent *it);
770 +extern void intent_release(struct dentry *de, struct lookup_intent *it);
771  
772  int vfs_statfs(struct super_block *sb, struct statfs *buf)
773  {
774 @@ -118,12 +121,13 @@ static inline long do_sys_truncate(const
775         struct nameidata nd;
776         struct inode * inode;
777         int error;
778 +       struct lookup_intent it = { .it_op = IT_TRUNC };
779  
780         error = -EINVAL;
781         if (length < 0) /* sorry, but loff_t says... */
782                 goto out;
783  
784 -       error = user_path_walk(path, &nd);
785 +       error = user_path_walk_it(path, &nd, &it);
786         if (error)
787                 goto out;
788         inode = nd.dentry->d_inode;
789 @@ -168,6 +172,7 @@ static inline long do_sys_truncate(const
790         put_write_access(inode);
791  
792  dput_and_out:
793 +       intent_release(nd.dentry, &it);
794         path_release(&nd);
795  out:
796         return error;
797 @@ -259,8 +264,9 @@ asmlinkage long sys_utime(char * filenam
798         struct nameidata nd;
799         struct inode * inode;
800         struct iattr newattrs;
801 +       struct lookup_intent it = { .it_op = IT_SETATTR };
802  
803 -       error = user_path_walk(filename, &nd);
804 +       error = user_path_walk_it(filename, &nd, &it);
805         if (error)
806                 goto out;
807         inode = nd.dentry->d_inode;
808 @@ -286,6 +292,7 @@ asmlinkage long sys_utime(char * filenam
809         }
810         error = notify_change(nd.dentry, &newattrs);
811  dput_and_out:
812 +       intent_release(nd.dentry, &it);
813         path_release(&nd);
814  out:
815         return error;
816 @@ -303,8 +310,9 @@ asmlinkage long sys_utimes(char * filena
817         struct nameidata nd;
818         struct inode * inode;
819         struct iattr newattrs;
820 +       struct lookup_intent it = { .it_op = IT_SETATTR };
821  
822 -       error = user_path_walk(filename, &nd);
823 +       error = user_path_walk_it(filename, &nd, &it);
824  
825         if (error)
826                 goto out;
827 @@ -331,6 +339,7 @@ asmlinkage long sys_utimes(char * filena
828         }
829         error = notify_change(nd.dentry, &newattrs);
830  dput_and_out:
831 +       intent_release(nd.dentry, &it);
832         path_release(&nd);
833  out:
834         return error;
835 @@ -347,6 +356,7 @@ asmlinkage long sys_access(const char * 
836         int old_fsuid, old_fsgid;
837         kernel_cap_t old_cap;
838         int res;
839 +       struct lookup_intent it = { .it_op = IT_GETATTR };
840  
841         if (mode & ~S_IRWXO)    /* where's F_OK, X_OK, W_OK, R_OK? */
842                 return -EINVAL;
843 @@ -364,13 +374,14 @@ asmlinkage long sys_access(const char * 
844         else
845                 current->cap_effective = current->cap_permitted;
846  
847 -       res = user_path_walk(filename, &nd);
848 +       res = user_path_walk_it(filename, &nd, &it);
849         if (!res) {
850                 res = permission(nd.dentry->d_inode, mode);
851                 /* SuS v2 requires we report a read only fs too */
852                 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
853                    && !special_file(nd.dentry->d_inode->i_mode))
854                         res = -EROFS;
855 +               intent_release(nd.dentry, &it);
856                 path_release(&nd);
857         }
858  
859 @@ -385,8 +396,11 @@ asmlinkage long sys_chdir(const char * f
860  {
861         int error;
862         struct nameidata nd;
863 +       struct lookup_intent it = { .it_op = IT_GETATTR };
864  
865 -       error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd);
866 +       error = __user_walk_it(filename,
867 +                              LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,
868 +                              &nd, &it);
869         if (error)
870                 goto out;
871  
872 @@ -397,6 +411,7 @@ asmlinkage long sys_chdir(const char * f
873         set_fs_pwd(current->fs, nd.mnt, nd.dentry);
874  
875  dput_and_out:
876 +       intent_release(nd.dentry, &it);
877         path_release(&nd);
878  out:
879         return error;
880 @@ -436,9 +451,10 @@ asmlinkage long sys_chroot(const char * 
881  {
882         int error;
883         struct nameidata nd;
884 +       struct lookup_intent it = { .it_op = IT_GETATTR };
885  
886 -       error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
887 -                     LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
888 +       error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
889 +                              LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
890         if (error)
891                 goto out;
892  
893 @@ -454,6 +470,7 @@ asmlinkage long sys_chroot(const char * 
894         set_fs_altroot();
895         error = 0;
896  dput_and_out:
897 +       intent_release(nd.dentry, &it);
898         path_release(&nd);
899  out:
900         return error;
901 @@ -498,8 +515,9 @@ asmlinkage long sys_chmod(const char * f
902         struct inode * inode;
903         int error;
904         struct iattr newattrs;
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                 goto out;
911         inode = nd.dentry->d_inode;
912 @@ -519,6 +537,7 @@ asmlinkage long sys_chmod(const char * f
913         error = notify_change(nd.dentry, &newattrs);
914  
915  dput_and_out:
916 +       intent_release(nd.dentry, &it);
917         path_release(&nd);
918  out:
919         return error;
920 @@ -588,10 +607,12 @@ asmlinkage long sys_chown(const char * f
921  {
922         struct nameidata nd;
923         int error;
924 +       struct lookup_intent it = { .it_op = IT_SETATTR };
925  
926 -       error = user_path_walk(filename, &nd);
927 +       error = user_path_walk_it(filename, &nd, &it);
928         if (!error) {
929                 error = chown_common(nd.dentry, user, group);
930 +               intent_release(nd.dentry, &it);
931                 path_release(&nd);
932         }
933         return error;
934 @@ -601,10 +622,12 @@ asmlinkage long sys_lchown(const char * 
935  {
936         struct nameidata nd;
937         int error;
938 +       struct lookup_intent it = { .it_op = IT_SETATTR };
939  
940 -       error = user_path_walk_link(filename, &nd);
941 +       error = user_path_walk_link_it(filename, &nd, &it);
942         if (!error) {
943                 error = chown_common(nd.dentry, user, group);
944 +               intent_release(nd.dentry, &it);
945                 path_release(&nd);
946         }
947         return error;
948 @@ -628,7 +651,8 @@ extern ssize_t do_readahead(struct file 
949  /* for files over a certains size it doesn't pay to do readahead on open */
950  #define READAHEAD_CUTOFF 48000
951  
952 -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
953 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
954 +                           int flags, struct lookup_intent *it)
955  {
956         struct file * f;
957         struct inode *inode;
958 @@ -693,6 +717,7 @@ struct file *dentry_open(struct dentry *
959                 do_readahead(f, 0, (48 * 1024) >> PAGE_SHIFT);
960         
961  
962 +       intent_release(dentry, it);
963         return f;
964  
965  cleanup_all:
966 @@ -707,11 +732,17 @@ cleanup_all:
967  cleanup_file:
968         put_filp(f);
969  cleanup_dentry:
970 +       intent_release(dentry, it);
971         dput(dentry);
972         mntput(mnt);
973         return ERR_PTR(error);
974  }
975  
976 +struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
977 +{
978 +       return dentry_open_it(dentry, mnt, flags, NULL);
979 +}
980 +
981  /*
982   * Find an empty file descriptor entry, and mark it busy.
983   */
984 --- linux-2.4.18-49chaos-lustre9/fs/stat.c~vfs_intent-2.4.18-18 Wed Jan 29 12:43:32 2003
985 +++ linux-2.4.18-49chaos-lustre9-root/fs/stat.c Wed Jan 29 12:43:32 2003
986 @@ -13,6 +13,7 @@
987  
988  #include <asm/uaccess.h>
989  
990 +extern void intent_release(struct dentry *de, struct lookup_intent *it);
991  /*
992   * Revalidate the inode. This is required for proper NFS attribute caching.
993   */
994 @@ -104,10 +105,12 @@ int vfs_stat(char *name, struct kstat *s
995  {
996         struct nameidata nd;
997         int error;
998 +       struct lookup_intent it = { .it_op = IT_GETATTR };
999  
1000 -       error = user_path_walk(name, &nd);
1001 +       error = user_path_walk_it(name, &nd, &it);
1002         if (!error) {
1003                 error = do_getattr(nd.mnt, nd.dentry, stat);
1004 +               intent_release(nd.dentry, &it);
1005                 path_release(&nd);
1006         }
1007         return error;
1008 @@ -117,10 +120,12 @@ int vfs_lstat(char *name, struct kstat *
1009  {
1010         struct nameidata nd;
1011         int error;
1012 +       struct lookup_intent it = { .it_op = IT_GETATTR };
1013  
1014 -       error = user_path_walk_link(name, &nd);
1015 +       error = user_path_walk_link_it(name, &nd, &it);
1016         if (!error) {
1017                 error = do_getattr(nd.mnt, nd.dentry, stat);
1018 +               intent_release(nd.dentry, &it);
1019                 path_release(&nd);
1020         }
1021         return error;
1022 --- linux-2.4.18-49chaos-lustre9/include/linux/dcache.h~vfs_intent-2.4.18-18    Wed Jan 29 12:43:32 2003
1023 +++ linux-2.4.18-49chaos-lustre9-root/include/linux/dcache.h    Wed Jan 29 12:43:32 2003
1024 @@ -6,6 +6,27 @@
1025  #include <asm/atomic.h>
1026  #include <linux/mount.h>
1027  
1028 +#define IT_OPEN     (1)
1029 +#define IT_CREAT    (1<<1)
1030 +#define IT_READDIR  (1<<2)
1031 +#define IT_GETATTR  (1<<3)
1032 +#define IT_SETATTR  (1<<4)
1033 +#define IT_TRUNC    (1<<5)
1034 +#define IT_READLINK (1<<6)
1035 +#define IT_LOOKUP   (1<<7)
1036 +
1037 +struct lookup_intent {
1038 +       int it_op;
1039 +       int it_mode;
1040 +       int it_flags;
1041 +       int it_disposition;
1042 +       int it_status;
1043 +       struct iattr *it_iattr;
1044 +       __u64 it_lock_handle[2];
1045 +       int it_lock_mode;
1046 +       void *it_data;
1047 +};
1048 +
1049  /*
1050   * linux/include/linux/dcache.h
1051   *
1052 @@ -78,6 +99,7 @@ struct dentry {
1053         unsigned long d_time;           /* used by d_revalidate */
1054         struct dentry_operations  *d_op;
1055         struct super_block * d_sb;      /* The root of the dentry tree */
1056 +       struct lookup_intent *d_it;
1057         unsigned long d_vfs_flags;
1058         void * d_fsdata;                /* fs-specific data */
1059         void * d_extra_attributes;      /* TUX-specific data */
1060 @@ -91,6 +113,8 @@ struct dentry_operations {
1061         int (*d_delete)(struct dentry *);
1062         void (*d_release)(struct dentry *);
1063         void (*d_iput)(struct dentry *, struct inode *);
1064 +       int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
1065 +       void (*d_intent_release)(struct dentry *, struct lookup_intent *);
1066  };
1067  
1068  /* the dentry parameter passed to d_hash and d_compare is the parent
1069 @@ -124,6 +148,7 @@ d_iput:             no              no              yes
1070                                          * s_nfsd_free_path semaphore will be down
1071                                          */
1072  #define DCACHE_REFERENCED      0x0008  /* Recently used, don't discard. */
1073 +#define DCACHE_LUSTRE_INVALID  0x0010  /* Lustre invalidated */
1074  
1075  extern spinlock_t dcache_lock;
1076  
1077 --- linux-2.4.18-49chaos-lustre9/include/linux/fs.h~vfs_intent-2.4.18-18        Wed Jan 29 12:43:32 2003
1078 +++ linux-2.4.18-49chaos-lustre9-root/include/linux/fs.h        Wed Jan 29 12:43:32 2003
1079 @@ -576,6 +576,7 @@ struct file {
1080  
1081         /* needed for tty driver, and maybe others */
1082         void                    *private_data;
1083 +       struct lookup_intent    *f_intent;
1084  
1085         /* preallocated helper kiobuf to speedup O_DIRECT */
1086         struct kiobuf           *f_iobuf;
1087 @@ -836,7 +837,9 @@ extern int vfs_symlink(struct inode *, s
1088  extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
1089  extern int vfs_rmdir(struct inode *, struct dentry *);
1090  extern int vfs_unlink(struct inode *, struct dentry *);
1091 -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
1092 +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1093 +               struct inode *new_dir, struct dentry *new_dentry,
1094 +               struct lookup_intent *it);
1095  
1096  /*
1097   * File types
1098 @@ -897,16 +900,28 @@ struct file_operations {
1099  struct inode_operations {
1100         int (*create) (struct inode *,struct dentry *,int);
1101         struct dentry * (*lookup) (struct inode *,struct dentry *);
1102 +       struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *);
1103         int (*link) (struct dentry *,struct inode *,struct dentry *);
1104 +       int (*link2) (struct inode *,struct inode *, const char *, int);
1105         int (*unlink) (struct inode *,struct dentry *);
1106 +       int (*unlink2) (struct inode *, const char *, int);
1107         int (*symlink) (struct inode *,struct dentry *,const char *);
1108 +       int (*symlink2) (struct inode *, const char *, int, const char *);
1109         int (*mkdir) (struct inode *,struct dentry *,int);
1110 +       int (*mkdir2) (struct inode *, const char *, int,int);
1111         int (*rmdir) (struct inode *,struct dentry *);
1112 +       int (*rmdir2) (struct inode *, const char *, int);
1113         int (*mknod) (struct inode *,struct dentry *,int,int);
1114 +       int (*mknod2) (struct inode *, const char *, int,int,int);
1115         int (*rename) (struct inode *, struct dentry *,
1116                         struct inode *, struct dentry *);
1117 +       int (*rename2) (struct inode *, struct inode *,
1118 +                       const char *oldname, int oldlen,
1119 +                       const char *newname, int newlen);
1120         int (*readlink) (struct dentry *, char *,int);
1121         int (*follow_link) (struct dentry *, struct nameidata *);
1122 +       int (*follow_link2) (struct dentry *, struct nameidata *,
1123 +                            struct lookup_intent *it);
1124         void (*truncate) (struct inode *);
1125         int (*permission) (struct inode *, int);
1126         int (*revalidate) (struct dentry *);
1127 @@ -1383,6 +1398,7 @@ typedef int (*read_actor_t)(read_descrip
1128  extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
1129  
1130  extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
1131 +extern int FASTCALL(__user_walk_it(const char *, unsigned, struct nameidata *, struct lookup_intent *it));
1132  extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
1133  extern int FASTCALL(path_walk(const char *, struct nameidata *));
1134  extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
1135 @@ -1394,6 +1410,8 @@ extern struct dentry * lookup_one_len(co
1136  extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
1137  #define user_path_walk(name,nd)         __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
1138  #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
1139 +#define user_path_walk_it(name,nd,it)  __user_walk_it(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd, it)
1140 +#define user_path_walk_link_it(name,nd,it) __user_walk_it(name, LOOKUP_POSITIVE, nd, it)
1141  
1142  extern void inode_init_once(struct inode *);
1143  extern void iput(struct inode *);
1144 @@ -1494,6 +1512,8 @@ extern struct file_operations generic_ro
1145  
1146  extern int vfs_readlink(struct dentry *, char *, int, const char *);
1147  extern int vfs_follow_link(struct nameidata *, const char *);
1148 +extern int vfs_follow_link_it(struct nameidata *, const char *,
1149 +                             struct lookup_intent *it);
1150  extern int page_readlink(struct dentry *, char *, int);
1151  extern int page_follow_link(struct dentry *, struct nameidata *);
1152  extern struct inode_operations page_symlink_inode_operations;
1153 --- linux-2.4.18-49chaos-lustre9/kernel/ksyms.c~vfs_intent-2.4.18-18    Wed Jan 29 12:43:32 2003
1154 +++ linux-2.4.18-49chaos-lustre9-root/kernel/ksyms.c    Wed Jan 29 12:43:32 2003
1155 @@ -294,6 +294,7 @@ EXPORT_SYMBOL(read_cache_page);
1156  EXPORT_SYMBOL(set_page_dirty);
1157  EXPORT_SYMBOL(vfs_readlink);
1158  EXPORT_SYMBOL(vfs_follow_link);
1159 +EXPORT_SYMBOL(vfs_follow_link_it);
1160  EXPORT_SYMBOL(page_readlink);
1161  EXPORT_SYMBOL(page_follow_link);
1162  EXPORT_SYMBOL(page_symlink_inode_operations);
1163
1164 _