Whamcloud - gitweb
- merge 0.7rc1 from b_devel to HEAD (20030612 merge point)
[fs/lustre-release.git] / lustre / kernel_patches / patches / lustre-2.5.63.patch
1  arch/um/kernel/mem.c   |   18 ++++++
2  fs/dcache.c            |   12 +++-
3  fs/namei.c             |  132 ++++++++++++++++++++++++++++++++++++++-----------
4  fs/namespace.c         |    1 
5  fs/nfsd/vfs.c          |    2 
6  fs/open.c              |   39 ++++++++++++--
7  fs/stat.c              |    2 
8  fs/sysfs/inode.c       |    2 
9  include/linux/dcache.h |   28 ++++++++++
10  include/linux/fs.h     |   20 +++++++
11  include/linux/namei.h  |    3 -
12  include/linux/slab.h   |    1 
13  kernel/ksyms.c         |    7 ++
14  mm/slab.c              |    5 +
15  net/unix/af_unix.c     |    2 
16  15 files changed, 231 insertions(+), 43 deletions(-)
17
18 --- linux-2.5.63-nointent/arch/um/kernel/mem.c~lustre-2.5.63    Tue Mar 18 15:02:10 2003
19 +++ linux-2.5.63-nointent-root/arch/um/kernel/mem.c     Tue Mar 18 15:02:10 2003
20 @@ -660,6 +660,22 @@ struct page *pte_mem_map(pte_t pte)
21         return(phys_mem_map(pte_val(pte)));
22  }
23  
24 +struct page *check_get_page(unsigned long kaddr)
25 +{
26 +        struct page *page;
27 +        struct mem_region *mr;
28 +        unsigned long phys = __pa(kaddr);
29 +       unsigned int n = phys_region_index(phys);
30 +
31 +       if(regions[n] == NULL) 
32 +                return NULL; 
33 +
34 +        mr = regions[n];
35 +        page = (struct page *) mr->mem_map;
36 +       return page + ((phys_addr(phys)) >> PAGE_SHIFT);
37 +}
38 +
39 +
40  struct mem_region *page_region(struct page *page, int *index_out)
41  {
42         int i;
43 @@ -747,7 +763,7 @@ extern unsigned long region_pa(void *vir
44                    (addr <= region->start + region->len))
45                         return(mk_phys(addr - region->start, i));
46         }
47 -       panic("region_pa : no region for virtual address");
48 +       //panic("region_pa : no region for virtual address");
49         return(0);
50  }
51  
52 --- linux-2.5.63-nointent/fs/namei.c~lustre-2.5.63      Tue Mar 18 15:02:10 2003
53 +++ linux-2.5.63-nointent-root/fs/namei.c       Mon Mar 24 17:08:18 2003
54 @@ -101,6 +101,14 @@
55   * any extra contention...
56   */
57  
58 +void intent_release(struct dentry *de, struct lookup_intent *it)
59 +{
60 +       if (it && de->d_op && de->d_op->d_intent_release)
61 +               de->d_op->d_intent_release(de, it);
62 +
63 +}
64 +
65 +
66  /* In order to reduce some races, while at the same time doing additional
67   * checking and hopefully speeding things up, we copy filenames to the
68   * kernel data space before using them..
69 @@ -273,10 +281,18 @@ void path_release(struct nameidata *nd)
70   * Internal lookup() using the new generic dcache.
71   * SMP-safe
72   */
73 -static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags)
74 +static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags, struct lookup_intent *it)
75  {
76         struct dentry * dentry = d_lookup(parent, name);
77         
78 +       if (dentry && dentry->d_op && dentry->d_op->d_revalidate2) {
79 +               if (!dentry->d_op->d_revalidate2(dentry, flags, it) &&
80 +                   !d_invalidate(dentry)) {
81 +                       dput(dentry);
82 +                       dentry = NULL;
83 +               }
84 +               return dentry;
85 +       } else
86         if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
87                 if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
88                         dput(dentry);
89 @@ -330,7 +346,7 @@ ok:
90   * make sure that nobody added the entry to the dcache in the meantime..
91   * SMP-safe
92   */
93 -static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, int flags)
94 +static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, int flags, struct lookup_intent *it)
95  {
96         struct dentry * result;
97         struct inode *dir = parent->d_inode;
98 @@ -348,7 +364,10 @@ static struct dentry * real_lookup(struc
99                 struct dentry * dentry = d_alloc(parent, name);
100                 result = ERR_PTR(-ENOMEM);
101                 if (dentry) {
102 -                       result = dir->i_op->lookup(dir, dentry);
103 +                       if (dir->i_op->lookup2)
104 +                               result = dir->i_op->lookup2(dir, dentry, it);
105 +                       else
106 +                                result = dir->i_op->lookup(dir, dentry);
107                         if (result)
108                                 dput(dentry);
109                         else {
110 @@ -370,6 +389,12 @@ static struct dentry * real_lookup(struc
111                         dput(result);
112                         result = ERR_PTR(-ENOENT);
113                 }
114 +       } else if (result->d_op && result->d_op->d_revalidate2) {
115 +               if (!result->d_op->d_revalidate2(result, flags, it) &&
116 +                   !d_invalidate(result)) {
117 +                       dput(result);
118 +                       result = ERR_PTR(-ENOENT);
119 +               }
120         }
121         return result;
122  }
123 @@ -402,6 +427,7 @@ static inline int do_follow_link(struct 
124         current->link_count--;
125         return err;
126  loop:
127 +       intent_release(dentry, &nd->it);
128         path_release(nd);
129         return err;
130  }
131 @@ -447,15 +473,26 @@ static int follow_mount(struct vfsmount 
132         return res;
133  }
134  
135 -static inline int __follow_down(struct vfsmount **mnt, struct dentry **dentry)
136 +static inline int __follow_down(struct vfsmount **mnt, struct dentry **dentry,
137 +                              struct lookup_intent *it)
138  {
139         struct vfsmount *mounted;
140  
141         spin_lock(&dcache_lock);
142         mounted = lookup_mnt(*mnt, *dentry);
143         if (mounted) {
144 +               int opc = 0, mode = 0;
145                 *mnt = mntget(mounted);
146                 spin_unlock(&dcache_lock);
147 +               if (it) {
148 +                       opc = it->it_op;
149 +                       mode = it->it_mode;
150 +               }
151 +               intent_release(*dentry, it);
152 +               if (it) {
153 +                       it->it_op = opc;
154 +                       it->it_mode = mode;
155 +               }
156                 dput(*dentry);
157                 mntput(mounted->mnt_parent);
158                 *dentry = dget(mounted->mnt_root);
159 @@ -467,7 +504,7 @@ static inline int __follow_down(struct v
160  
161  int follow_down(struct vfsmount **mnt, struct dentry **dentry)
162  {
163 -       return __follow_down(mnt,dentry);
164 +       return __follow_down(mnt,dentry,NULL);
165  }
166   
167  static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
168 @@ -531,7 +568,7 @@ done:
169         return 0;
170  
171  need_lookup:
172 -       dentry = real_lookup(nd->dentry, name, LOOKUP_CONTINUE);
173 +       dentry = real_lookup(nd->dentry, name, LOOKUP_CONTINUE, &nd->it);
174         if (IS_ERR(dentry))
175                 goto fail;
176         goto done;
177 @@ -665,7 +702,7 @@ int link_path_walk(const char * name, st
178                         nd->dentry = next.dentry;
179                 }
180                 err = -ENOTDIR; 
181 -               if (!inode->i_op->lookup)
182 +               if (!inode->i_op->lookup && !inode->i_op->lookup2)
183                         break;
184                 continue;
185                 /* here ends the main loop */
186 @@ -716,7 +753,8 @@ last_component:
187                         break;
188                 if (lookup_flags & LOOKUP_DIRECTORY) {
189                         err = -ENOTDIR; 
190 -                       if (!inode->i_op || !inode->i_op->lookup)
191 +                       if (!inode->i_op || 
192 +                            (!inode->i_op->lookup && !inode->i_op->lookup2))
193                                 break;
194                 }
195                 goto return_base;
196 @@ -735,6 +773,7 @@ out_dput:
197                 dput(next.dentry);
198                 break;
199         }
200 +       intent_release(nd->dentry, &nd->it);
201         path_release(nd);
202  return_err:
203         return err;
204 @@ -857,7 +896,8 @@ int path_lookup(const char *name, unsign
205   * needs parent already locked. Doesn't follow mounts.
206   * SMP-safe.
207   */
208 -struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
209 +struct dentry * lookup_hash(struct qstr *name, struct dentry * base, 
210 +                            struct lookup_intent *it)
211  {
212         struct dentry * dentry;
213         struct inode *inode;
214 @@ -880,13 +920,16 @@ struct dentry * lookup_hash(struct qstr 
215                         goto out;
216         }
217  
218 -       dentry = cached_lookup(base, name, 0);
219 +       dentry = cached_lookup(base, name, 0, it);
220         if (!dentry) {
221                 struct dentry *new = d_alloc(base, name);
222                 dentry = ERR_PTR(-ENOMEM);
223                 if (!new)
224                         goto out;
225 -               dentry = inode->i_op->lookup(inode, new);
226 +                if (inode->i_op->lookup2) 
227 +                        dentry = inode->i_op->lookup2(inode, new, it);
228 +                else 
229 +                        dentry = inode->i_op->lookup(inode, new);
230                 if (!dentry) {
231                         dentry = new;
232                         security_inode_post_lookup(inode, dentry);
233 @@ -898,7 +941,7 @@ out:
234  }
235  
236  /* SMP-safe */
237 -struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
238 +struct dentry * lookup_one_len_it(const char * name, struct dentry * base, int len, struct lookup_intent *it)
239  {
240         unsigned long hash;
241         struct qstr this;
242 @@ -918,11 +961,16 @@ struct dentry * lookup_one_len(const cha
243         }
244         this.hash = end_name_hash(hash);
245  
246 -       return lookup_hash(&this, base);
247 +       return lookup_hash(&this, base, it);
248  access:
249         return ERR_PTR(-EACCES);
250  }
251  
252 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
253 +{
254 +        return lookup_one_len_it(name, base, len, NULL);
255 +}
256 +
257  /*
258   *     namei()
259   *
260 @@ -1224,6 +1272,9 @@ int open_namei(const char * pathname, in
261         /*
262          * Create - we need to know the parent.
263          */
264 +       nd->it.it_mode = mode;
265 +       nd->it.it_op |= IT_CREAT;
266 +               
267         error = path_lookup(pathname, LOOKUP_PARENT, nd);
268         if (error)
269                 return error;
270 @@ -1239,7 +1290,7 @@ int open_namei(const char * pathname, in
271  
272         dir = nd->dentry;
273         down(&dir->d_inode->i_sem);
274 -       dentry = lookup_hash(&nd->last, nd->dentry);
275 +       dentry = lookup_hash(&nd->last, nd->dentry, &nd->it);
276  
277  do_last:
278         error = PTR_ERR(dentry);
279 @@ -1247,7 +1298,8 @@ do_last:
280                 up(&dir->d_inode->i_sem);
281                 goto exit;
282         }
283 -
284 +        
285 +       nd->it.it_mode = mode;
286         /* Negative dentry, just create the file */
287         if (!dentry->d_inode) {
288                 if (!IS_POSIXACL(dir->d_inode))
289 @@ -1277,7 +1329,7 @@ do_last:
290                 error = -ELOOP;
291                 if (flag & O_NOFOLLOW)
292                         goto exit_dput;
293 -               while (__follow_down(&nd->mnt,&dentry) && d_mountpoint(dentry));
294 +               while (__follow_down(&nd->mnt,&dentry,&nd->it) && d_mountpoint(dentry));
295         }
296         error = -ENOENT;
297         if (!dentry->d_inode)
298 @@ -1297,8 +1349,10 @@ ok:
299         return 0;
300  
301  exit_dput:
302 +       intent_release(dentry, &nd->it);
303         dput(dentry);
304  exit:
305 +       intent_release(nd->dentry, &nd->it);
306         path_release(nd);
307         return error;
308  
309 @@ -1320,7 +1374,12 @@ do_link:
310         if (error)
311                 goto exit_dput;
312         UPDATE_ATIME(dentry->d_inode);
313 -       error = dentry->d_inode->i_op->follow_link(dentry, nd);
314 +       if (dentry->d_inode->i_op->follow_link2)
315 +               error = dentry->d_inode->i_op->follow_link2(dentry, nd, &nd->it);
316 +       else
317 +               error = dentry->d_inode->i_op->follow_link(dentry, nd);
318 +        if (error)
319 +               intent_release(dentry, &nd->it);
320         dput(dentry);
321         if (error)
322                 return error;
323 @@ -1342,7 +1401,7 @@ do_link:
324         }
325         dir = nd->dentry;
326         down(&dir->d_inode->i_sem);
327 -       dentry = lookup_hash(&nd->last, nd->dentry);
328 +       dentry = lookup_hash(&nd->last, nd->dentry, &nd->it);
329         putname(nd->last.name);
330         goto do_last;
331  }
332 @@ -1356,7 +1415,7 @@ static struct dentry *lookup_create(stru
333         dentry = ERR_PTR(-EEXIST);
334         if (nd->last_type != LAST_NORM)
335                 goto fail;
336 -       dentry = lookup_hash(&nd->last, nd->dentry);
337 +       dentry = lookup_hash(&nd->last, nd->dentry, &nd->it);
338         if (IS_ERR(dentry))
339                 goto fail;
340         if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
341 @@ -1588,7 +1647,7 @@ asmlinkage long sys_rmdir(const char * p
342                         goto exit1;
343         }
344         down(&nd.dentry->d_inode->i_sem);
345 -       dentry = lookup_hash(&nd.last, nd.dentry);
346 +       dentry = lookup_hash(&nd.last, nd.dentry, &nd.it);
347         error = PTR_ERR(dentry);
348         if (!IS_ERR(dentry)) {
349                 error = vfs_rmdir(nd.dentry->d_inode, dentry);
350 @@ -1654,8 +1713,18 @@ asmlinkage long sys_unlink(const char * 
351         error = -EISDIR;
352         if (nd.last_type != LAST_NORM)
353                 goto exit1;
354 +       if (nd.dentry->d_inode->i_op->unlink2) {
355 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
356 +               error = op->unlink2(nd.dentry->d_inode,
357 +                               nd.last.name,
358 +                               nd.last.len);
359 +               /* the file system wants to use normal vfs path now */
360 +               if (error != -EOPNOTSUPP)
361 +                       goto exit1;
362 +       }
363         down(&nd.dentry->d_inode->i_sem);
364 -       dentry = lookup_hash(&nd.last, nd.dentry);
365 +//     dentry = lookup_hash(&nd.last, nd.dentry, &nd.it);
366 +       dentry = lookup_hash(&nd.last, nd.dentry, NULL);
367         error = PTR_ERR(dentry);
368         if (!IS_ERR(dentry)) {
369                 /* Why not before? Because we want correct error value */
370 @@ -1859,7 +1928,8 @@ exit:
371   *        locking].
372   */
373  int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
374 -              struct inode *new_dir, struct dentry *new_dentry)
375 +              struct inode *new_dir, struct dentry *new_dentry,
376 +                                 struct lookup_intent *it)
377  {
378         int error = 0;
379         struct inode *target;
380 @@ -1887,6 +1957,7 @@ int vfs_rename_dir(struct inode *old_dir
381                 error = -EBUSY;
382         else 
383                 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
384 +       intent_release(new_dentry, it);
385         if (target) {
386                 if (!error)
387                         target->i_flags |= S_DEAD;
388 @@ -1904,7 +1975,8 @@ int vfs_rename_dir(struct inode *old_dir
389  }
390  
391  int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
392 -              struct inode *new_dir, struct dentry *new_dentry)
393 +              struct inode *new_dir, struct dentry *new_dentry,
394 +               struct lookup_intent *it)
395  {
396         struct inode *target;
397         int error;
398 @@ -1921,6 +1993,7 @@ int vfs_rename_other(struct inode *old_d
399                 error = -EBUSY;
400         else
401                 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
402 +        intent_release(new_dentry, it);
403         if (!error) {
404                 /* The following d_move() should become unconditional */
405                 if (!(old_dir->i_sb->s_type->fs_flags & FS_ODD_RENAME))
406 @@ -1934,7 +2007,8 @@ int vfs_rename_other(struct inode *old_d
407  }
408  
409  int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
410 -              struct inode *new_dir, struct dentry *new_dentry)
411 +              struct inode *new_dir, struct dentry *new_dentry, 
412 +               struct lookup_intent *it)
413  {
414         int error;
415         int is_dir = S_ISDIR(old_dentry->d_inode->i_mode);
416 @@ -1960,9 +2034,9 @@ int vfs_rename(struct inode *old_dir, st
417         DQUOT_INIT(new_dir);
418  
419         if (is_dir)
420 -               error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry);
421 +               error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry, it);
422         else
423 -               error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry);
424 +               error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry, it);
425         if (!error) {
426                 if (old_dir == new_dir)
427                         inode_dir_notify(old_dir, DN_RENAME);
428 @@ -2005,7 +2079,7 @@ static inline int do_rename(const char *
429  
430         trap = lock_rename(new_dir, old_dir);
431  
432 -       old_dentry = lookup_hash(&oldnd.last, old_dir);
433 +       old_dentry = lookup_hash(&oldnd.last, old_dir, &oldnd.it);
434         error = PTR_ERR(old_dentry);
435         if (IS_ERR(old_dentry))
436                 goto exit3;
437 @@ -2025,7 +2099,7 @@ static inline int do_rename(const char *
438         error = -EINVAL;
439         if (old_dentry == trap)
440                 goto exit4;
441 -       new_dentry = lookup_hash(&newnd.last, new_dir);
442 +       new_dentry = lookup_hash(&newnd.last, new_dir, &newnd.it);
443         error = PTR_ERR(new_dentry);
444         if (IS_ERR(new_dentry))
445                 goto exit4;
446 @@ -2035,7 +2109,7 @@ static inline int do_rename(const char *
447                 goto exit5;
448  
449         error = vfs_rename(old_dir->d_inode, old_dentry,
450 -                                  new_dir->d_inode, new_dentry);
451 +                                  new_dir->d_inode, new_dentry, NULL);
452  exit5:
453         dput(new_dentry);
454  exit4:
455 --- linux-2.5.63-nointent/fs/nfsd/vfs.c~lustre-2.5.63   Tue Mar 18 15:02:10 2003
456 +++ linux-2.5.63-nointent-root/fs/nfsd/vfs.c    Tue Mar 18 15:02:10 2003
457 @@ -1337,7 +1337,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
458                         err = nfserr_perm;
459         } else
460  #endif
461 -       err = vfs_rename(fdir, odentry, tdir, ndentry);
462 +       err = vfs_rename(fdir, odentry, tdir, ndentry, NULL);
463         if (!err && EX_ISSYNC(tfhp->fh_export)) {
464                 nfsd_sync_dir(tdentry);
465                 nfsd_sync_dir(fdentry);
466 --- linux-2.5.63-nointent/fs/sysfs/inode.c~lustre-2.5.63        Tue Mar 18 15:02:10 2003
467 +++ linux-2.5.63-nointent-root/fs/sysfs/inode.c Tue Mar 18 15:02:10 2003
468 @@ -540,7 +540,7 @@ static struct dentry * get_dentry(struct
469         qstr.name = name;
470         qstr.len = strlen(name);
471         qstr.hash = full_name_hash(name,qstr.len);
472 -       return lookup_hash(&qstr,parent);
473 +       return lookup_hash(&qstr,parent,NULL);
474  }
475  
476  
477 --- linux-2.5.63-nointent/include/linux/dcache.h~lustre-2.5.63  Tue Mar 18 15:02:10 2003
478 +++ linux-2.5.63-nointent-root/include/linux/dcache.h   Tue Mar 18 15:02:10 2003
479 @@ -12,6 +12,27 @@
480  
481  struct vfsmount;
482  
483 +#define IT_OPEN     (1)
484 +#define IT_CREAT    (1<<1)
485 +#define IT_READDIR  (1<<2)
486 +#define IT_GETATTR  (1<<3)
487 +#define IT_LOOKUP   (1<<4)
488 +#define IT_UNLINK   (1<<5)
489 +
490 +
491 +struct lookup_intent {
492 +       int it_op;
493 +       int it_mode;
494 +       int it_flags;
495 +       int it_disposition;
496 +       int it_status;
497 +       struct iattr *it_iattr;
498 +       __u64 it_lock_handle[2];
499 +       int it_lock_mode;
500 +       void *it_data;
501 +};
502 +
503 +
504  /*
505   * linux/include/linux/dcache.h
506   *
507 @@ -34,6 +55,8 @@ struct qstr {
508         char name_str[0];
509  };
510  
511 +#include <linux/namei.h>
512 +
513  struct dentry_stat_t {
514         int nr_dentry;
515         int nr_unused;
516 @@ -87,6 +110,7 @@ struct dentry {
517         struct list_head d_subdirs;     /* our children */
518         struct list_head d_alias;       /* inode alias list */
519         int d_mounted;
520 +        struct lookup_intent *d_it;
521         struct qstr d_name;
522         struct qstr * d_qstr;           /* quick str ptr used in lockless lookup and concurrent d_move */
523         unsigned long d_time;           /* used by d_revalidate */
524 @@ -107,6 +131,8 @@ struct dentry_operations {
525         int (*d_delete)(struct dentry *);
526         void (*d_release)(struct dentry *);
527         void (*d_iput)(struct dentry *, struct inode *);
528 +       int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
529 +       void (*d_intent_release)(struct  dentry *, struct lookup_intent *);
530  };
531  
532  /* the dentry parameter passed to d_hash and d_compare is the parent
533 @@ -147,6 +173,8 @@ d_iput:             no              no              yes
534  
535  #define DCACHE_REFERENCED      0x0008  /* Recently used, don't discard. */
536  #define DCACHE_UNHASHED                0x0010  
537 +#define DCACHE_LUSTRE_INVALID     0x0011  /* Lustre invalidated */
538 +
539  
540  extern spinlock_t dcache_lock;
541  extern rwlock_t dparent_lock;
542 --- linux-2.5.63-nointent/include/linux/fs.h~lustre-2.5.63      Tue Mar 18 15:02:10 2003
543 +++ linux-2.5.63-nointent-root/include/linux/fs.h       Tue Mar 18 15:02:10 2003
544 @@ -234,6 +234,9 @@ typedef int (get_blocks_t)(struct inode 
545  #define ATTR_ATTR_FLAG 1024
546  #define ATTR_KILL_SUID 2048
547  #define ATTR_KILL_SGID 4096
548 +#define ATTR_RAW               8192    /* file system, not vfs will massage attrs */
549 +#define ATTR_FROM_OPEN         16384    /* called from open path, ie O_TRUNC */
550 +
551  
552  /*
553   * This is the Inode Attributes structure, used for notify_change().  It
554 @@ -642,7 +645,7 @@ extern int vfs_symlink(struct inode *, s
555  extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
556  extern int vfs_rmdir(struct inode *, struct dentry *);
557  extern int vfs_unlink(struct inode *, struct dentry *);
558 -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
559 +extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct lookup_intent *it);
560  
561  /*
562   * File types
563 @@ -728,19 +731,33 @@ struct file_operations {
564  struct inode_operations {
565         int (*create) (struct inode *,struct dentry *,int);
566         struct dentry * (*lookup) (struct inode *,struct dentry *);
567 +       struct dentry * (*lookup2) (struct inode *,struct dentry *, 
568 +                                    struct lookup_intent *);
569         int (*link) (struct dentry *,struct inode *,struct dentry *);
570 +       int (*link2) (struct inode *,struct inode *, const char *, int);
571         int (*unlink) (struct inode *,struct dentry *);
572 +       int (*unlink2) (struct inode *, const char *, int);
573         int (*symlink) (struct inode *,struct dentry *,const char *);
574 +       int (*symlink2) (struct inode *, const char *, int, const char *);
575         int (*mkdir) (struct inode *,struct dentry *,int);
576 +       int (*mkdir2) (struct inode *, const char *, int,int);
577         int (*rmdir) (struct inode *,struct dentry *);
578 +       int (*rmdir2) (struct inode *, const char *, int);
579         int (*mknod) (struct inode *,struct dentry *,int,dev_t);
580 +       int (*mknod2) (struct inode *, const char *, int,int,int);
581         int (*rename) (struct inode *, struct dentry *,
582                         struct inode *, struct dentry *);
583 +       int (*rename2) (struct inode *, struct inode *,
584 +                       const char *oldname, int oldlen,
585 +                       const char *newname, int newlen);
586         int (*readlink) (struct dentry *, char *,int);
587         int (*follow_link) (struct dentry *, struct nameidata *);
588 +       int (*follow_link2) (struct dentry *, struct nameidata *,
589 +                               struct lookup_intent *it);
590         void (*truncate) (struct inode *);
591         int (*permission) (struct inode *, int);
592         int (*setattr) (struct dentry *, struct iattr *);
593 +       int (*setattr_raw) (struct inode *, struct iattr *);
594         int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
595         int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
596         ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t,int);
597 @@ -953,6 +970,7 @@ extern int register_filesystem(struct fi
598  extern int unregister_filesystem(struct file_system_type *);
599  extern struct vfsmount *kern_mount(struct file_system_type *);
600  extern int may_umount(struct vfsmount *);
601 +struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
602  extern long do_mount(char *, char *, char *, unsigned long, void *);
603  
604  extern int vfs_statfs(struct super_block *, struct statfs *);
605 --- linux-2.5.63-nointent/include/linux/namei.h~lustre-2.5.63   Tue Mar 18 15:02:10 2003
606 +++ linux-2.5.63-nointent-root/include/linux/namei.h    Tue Mar 18 15:02:10 2003
607 @@ -11,6 +11,7 @@ struct nameidata {
608         struct qstr     last;
609         unsigned int    flags;
610         int             last_type;
611 +   struct lookup_intent it;
612  };
613  
614  /*
615 @@ -44,7 +45,7 @@ extern int FASTCALL(link_path_walk(const
616  extern void path_release(struct nameidata *);
617  
618  extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
619 -extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
620 +extern struct dentry * lookup_hash(struct qstr *, struct dentry *, struct lookup_intent *);
621  
622  extern int follow_down(struct vfsmount **, struct dentry **);
623  extern int follow_up(struct vfsmount **, struct dentry **);
624 --- linux-2.5.63-nointent/include/linux/slab.h~lustre-2.5.63    Tue Mar 18 15:02:10 2003
625 +++ linux-2.5.63-nointent-root/include/linux/slab.h     Tue Mar 18 15:02:10 2003
626 @@ -55,6 +55,7 @@ extern int kmem_cache_destroy(kmem_cache
627  extern int kmem_cache_shrink(kmem_cache_t *);
628  extern void *kmem_cache_alloc(kmem_cache_t *, int);
629  extern void kmem_cache_free(kmem_cache_t *, void *);
630 +extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp);
631  extern unsigned int kmem_cache_size(kmem_cache_t *);
632  
633  extern void *kmalloc(size_t, int);
634 --- linux-2.5.63-nointent/kernel/ksyms.c~lustre-2.5.63  Tue Mar 18 15:02:10 2003
635 +++ linux-2.5.63-nointent-root/kernel/ksyms.c   Tue Mar 18 15:02:10 2003
636 @@ -377,6 +377,7 @@ EXPORT_SYMBOL(unregister_filesystem);
637  EXPORT_SYMBOL(kern_mount);
638  EXPORT_SYMBOL(__mntput);
639  EXPORT_SYMBOL(may_umount);
640 +EXPORT_SYMBOL(reparent_to_init);
641  
642  /* executable format registration */
643  EXPORT_SYMBOL(register_binfmt);
644 @@ -407,6 +408,12 @@ EXPORT_SYMBOL(request_irq);
645  EXPORT_SYMBOL(free_irq);
646  EXPORT_SYMBOL(irq_stat);
647  
648 +/* lustre */
649 +EXPORT_SYMBOL(do_kern_mount);
650 +EXPORT_SYMBOL(exit_files);
651 +EXPORT_SYMBOL(kmem_cache_validate);
652 +
653 +
654  /* waitqueue handling */
655  EXPORT_SYMBOL(add_wait_queue);
656  EXPORT_SYMBOL(add_wait_queue_exclusive);
657 --- linux-2.5.63-nointent/mm/slab.c~lustre-2.5.63       Tue Mar 18 15:02:10 2003
658 +++ linux-2.5.63-nointent-root/mm/slab.c        Tue Mar 18 15:02:10 2003
659 @@ -1792,6 +1792,11 @@ static inline void __cache_free (kmem_ca
660         }
661  }
662  
663 +int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
664 +{
665 +       return 1;
666 +}
667 +
668  /**
669   * kmem_cache_alloc - Allocate an object
670   * @cachep: The cache to allocate from.
671 --- linux-2.5.63-nointent/net/unix/af_unix.c~lustre-2.5.63      Tue Mar 18 15:02:10 2003
672 +++ linux-2.5.63-nointent-root/net/unix/af_unix.c       Tue Mar 18 15:02:10 2003
673 @@ -720,7 +720,7 @@ static int unix_bind(struct socket *sock
674                 /*
675                  * Do the final lookup.
676                  */
677 -               dentry = lookup_hash(&nd.last, nd.dentry);
678 +               dentry = lookup_hash(&nd.last, nd.dentry, NULL);
679                 err = PTR_ERR(dentry);
680                 if (IS_ERR(dentry))
681                         goto out_mknod_unlock;
682 --- linux-2.5.63-nointent/fs/dcache.c~lustre-2.5.63     Tue Mar 18 15:02:10 2003
683 +++ linux-2.5.63-nointent-root/fs/dcache.c      Tue Mar 18 15:02:10 2003
684 @@ -1111,15 +1111,21 @@ void d_delete(struct dentry * dentry)
685   * Adds a dentry to the hash according to its name.
686   */
687   
688 -void d_rehash(struct dentry * entry)
689 +void __d_rehash(struct dentry * entry, int lock)
690  {
691         struct list_head *list = d_hash(entry->d_parent, entry->d_name.hash);
692 -       spin_lock(&dcache_lock);
693 +       if (lock) spin_lock(&dcache_lock);
694         if (!list_empty(&entry->d_hash) && !d_unhashed(entry)) BUG();
695         entry->d_vfs_flags &= ~DCACHE_UNHASHED;
696         entry->d_bucket = list;
697         list_add_rcu(&entry->d_hash, list);
698 -       spin_unlock(&dcache_lock);
699 +       if (lock) spin_unlock(&dcache_lock);
700 +}
701 +EXPORT_SYMBOL(__d_rehash);
702 +
703 +void d_rehash(struct dentry * entry)
704 +{
705 +       __d_rehash(entry, 1);
706  }
707  
708  #define do_switch(x,y) do { \
709 --- linux-2.5.63-nointent/fs/namespace.c~lustre-2.5.63  Tue Mar 18 15:02:10 2003
710 +++ linux-2.5.63-nointent-root/fs/namespace.c   Tue Mar 18 15:02:10 2003
711 @@ -925,6 +925,7 @@ void set_fs_pwd(struct fs_struct *fs, st
712                 mntput(old_pwdmnt);
713         }
714  }
715 +EXPORT_SYMBOL(set_fs_pwd);
716  
717  static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd)
718  {
719 --- linux-2.5.63-nointent/fs/open.c~lustre-2.5.63       Thu Mar 20 12:43:39 2003
720 +++ linux-2.5.63-nointent-root/fs/open.c        Mon Mar 24 16:25:47 2003
721 @@ -97,7 +97,8 @@ static inline long do_sys_truncate(const
722         struct nameidata nd;
723         struct inode * inode;
724         int error;
725 -
726 +        struct lookup_intent it = { .it_op = IT_GETATTR };
727 +       nd.it=it;
728         error = -EINVAL;
729         if (length < 0) /* sorry, but loff_t says... */
730                 goto out;
731 @@ -142,11 +143,13 @@ static inline long do_sys_truncate(const
732         error = locks_verify_truncate(inode, NULL, length);
733         if (!error) {
734                 DQUOT_INIT(inode);
735 +               intent_release(nd.dentry, &nd.it);
736                 error = do_truncate(nd.dentry, length);
737         }
738         put_write_access(inode);
739  
740  dput_and_out:
741 +       intent_release(nd.dentry, &nd.it);
742         path_release(&nd);
743  out:
744         return error;
745 @@ -340,6 +343,8 @@ asmlinkage long sys_access(const char * 
746         int old_fsuid, old_fsgid;
747         kernel_cap_t old_cap;
748         int res;
749 +       struct lookup_intent it = { .it_op = IT_GETATTR };
750 +       nd.it=it;       
751  
752         if (mode & ~S_IRWXO)    /* where's F_OK, X_OK, W_OK, R_OK? */
753                 return -EINVAL;
754 @@ -371,6 +376,8 @@ asmlinkage long sys_access(const char * 
755                 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
756                    && !special_file(nd.dentry->d_inode->i_mode))
757                         res = -EROFS;
758 +                               
759 +               intent_release(nd.dentry, &nd.it);
760                 path_release(&nd);
761         }
762  
763 @@ -385,6 +392,8 @@ asmlinkage long sys_chdir(const char * f
764  {
765         struct nameidata nd;
766         int error;
767 +       struct lookup_intent it = { .it_op = IT_GETATTR };
768 +       nd.it=it;       
769  
770         error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
771         if (error)
772 @@ -397,6 +406,7 @@ asmlinkage long sys_chdir(const char * f
773         set_fs_pwd(current->fs, nd.mnt, nd.dentry);
774  
775  dput_and_out:
776 +       intent_release(nd.dentry, &nd.it);
777         path_release(&nd);
778  out:
779         return error;
780 @@ -436,6 +446,8 @@ asmlinkage long sys_chroot(const char * 
781  {
782         struct nameidata nd;
783         int error;
784 +        struct lookup_intent it = { .it_op = IT_GETATTR };
785 +       nd.it=it;
786  
787         error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
788         if (error)
789 @@ -508,6 +520,18 @@ asmlinkage long sys_chmod(const char * f
790         error = -EROFS;
791         if (IS_RDONLY(inode))
792                 goto dput_and_out;
793 +       
794 +       if (inode->i_op->setattr_raw) {
795 +               struct inode_operations *op = nd.dentry->d_inode->i_op;
796 +
797 +               newattrs.ia_mode = mode;
798 +               newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
799 +               newattrs.ia_valid |= ATTR_RAW;
800 +               error = op->setattr_raw(inode, &newattrs);
801 +               /* the file system wants to use normal vfs path now */
802 +               if (error != -EOPNOTSUPP)
803 +                       goto dput_and_out;
804 +       }
805  
806         error = -EPERM;
807         if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
808 @@ -619,7 +643,10 @@ asmlinkage long sys_fchown(unsigned int 
809  struct file *filp_open(const char * filename, int flags, int mode)
810  {
811         int namei_flags, error;
812 +       struct file * temp_filp;
813         struct nameidata nd;
814 +       struct lookup_intent it = { .it_op = IT_OPEN, .it_flags = flags };
815 +       nd.it=it;       
816  
817         namei_flags = flags;
818         if ((namei_flags+1) & O_ACCMODE)
819 @@ -628,9 +655,11 @@ struct file *filp_open(const char * file
820                 namei_flags |= 2;
821  
822         error = open_namei(filename, namei_flags, mode, &nd);
823 -       if (!error)
824 -               return dentry_open(nd.dentry, nd.mnt, flags);
825 -
826 +       if (!error) {
827 +               temp_filp = dentry_open(nd.dentry, nd.mnt, flags);
828 +               intent_release(nd.dentry,&nd.it);
829 +               return temp_filp;
830 +       }       
831         return ERR_PTR(error);
832  }
833  
834 @@ -675,7 +704,7 @@ struct file *dentry_open(struct dentry *
835                                 goto cleanup_all;
836                 }
837         }
838 -
839 +        
840         return f;
841  
842  cleanup_all:
843 --- linux-2.5.63-nointent/fs/stat.c~lustre-2.5.63       Fri Mar 21 21:15:40 2003
844 +++ linux-2.5.63-nointent-root/fs/stat.c        Fri Mar 21 21:16:53 2003
845 @@ -65,6 +65,7 @@ int vfs_stat(char *name, struct kstat *s
846         error = user_path_walk(name, &nd);
847         if (!error) {
848                 error = vfs_getattr(nd.mnt, nd.dentry, stat);
849 +               intent_release(nd.dentry, &nd.it);
850                 path_release(&nd);
851         }
852         return error;
853 @@ -80,6 +81,7 @@ int vfs_lstat(char *name, struct kstat *
854         error = user_path_walk_link(name, &nd);
855         if (!error) {
856                 error = vfs_getattr(nd.mnt, nd.dentry, stat);
857 +               intent_release(nd.dentry, &nd.it);
858                 path_release(&nd);
859         }
860         return error;
861
862 _