1 arch/um/kernel/mem.c | 18 ++++++
3 fs/namei.c | 132 ++++++++++++++++++++++++++++++++++++++-----------
6 fs/open.c | 39 ++++++++++++--
9 include/linux/dcache.h | 28 ++++++++++
10 include/linux/fs.h | 20 +++++++
11 include/linux/namei.h | 3 -
12 include/linux/slab.h | 1
15 net/unix/af_unix.c | 2
16 15 files changed, 231 insertions(+), 43 deletions(-)
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)));
24 +struct page *check_get_page(unsigned long kaddr)
27 + struct mem_region *mr;
28 + unsigned long phys = __pa(kaddr);
29 + unsigned int n = phys_region_index(phys);
31 + if(regions[n] == NULL)
35 + page = (struct page *) mr->mem_map;
36 + return page + ((phys_addr(phys)) >> PAGE_SHIFT);
40 struct mem_region *page_region(struct page *page, int *index_out)
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));
47 - panic("region_pa : no region for virtual address");
48 + //panic("region_pa : no region for virtual address");
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
55 * any extra contention...
58 +void intent_release(struct dentry *de, struct lookup_intent *it)
60 + if (it && de->d_op && de->d_op->d_intent_release)
61 + de->d_op->d_intent_release(de, it);
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.
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)
76 struct dentry * dentry = d_lookup(parent, name);
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)) {
86 if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
87 if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
89 @@ -330,7 +346,7 @@ ok:
90 * make sure that nobody added the entry to the dcache in the meantime..
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)
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);
102 - result = dir->i_op->lookup(dir, dentry);
103 + if (dir->i_op->lookup2)
104 + result = dir->i_op->lookup2(dir, dentry, it);
106 + result = dir->i_op->lookup(dir, dentry);
110 @@ -370,6 +389,12 @@ static struct dentry * real_lookup(struc
112 result = ERR_PTR(-ENOENT);
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)) {
118 + result = ERR_PTR(-ENOENT);
123 @@ -402,6 +427,7 @@ static inline int do_follow_link(struct
124 current->link_count--;
127 + intent_release(dentry, &nd->it);
131 @@ -447,15 +473,26 @@ static int follow_mount(struct vfsmount
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)
139 struct vfsmount *mounted;
141 spin_lock(&dcache_lock);
142 mounted = lookup_mnt(*mnt, *dentry);
144 + int opc = 0, mode = 0;
145 *mnt = mntget(mounted);
146 spin_unlock(&dcache_lock);
149 + mode = it->it_mode;
151 + intent_release(*dentry, it);
154 + it->it_mode = mode;
157 mntput(mounted->mnt_parent);
158 *dentry = dget(mounted->mnt_root);
159 @@ -467,7 +504,7 @@ static inline int __follow_down(struct v
161 int follow_down(struct vfsmount **mnt, struct dentry **dentry)
163 - return __follow_down(mnt,dentry);
164 + return __follow_down(mnt,dentry,NULL);
167 static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
168 @@ -531,7 +568,7 @@ done:
172 - dentry = real_lookup(nd->dentry, name, LOOKUP_CONTINUE);
173 + dentry = real_lookup(nd->dentry, name, LOOKUP_CONTINUE, &nd->it);
177 @@ -665,7 +702,7 @@ int link_path_walk(const char * name, st
178 nd->dentry = next.dentry;
181 - if (!inode->i_op->lookup)
182 + if (!inode->i_op->lookup && !inode->i_op->lookup2)
185 /* here ends the main loop */
186 @@ -716,7 +753,8 @@ last_component:
188 if (lookup_flags & LOOKUP_DIRECTORY) {
190 - if (!inode->i_op || !inode->i_op->lookup)
191 + if (!inode->i_op ||
192 + (!inode->i_op->lookup && !inode->i_op->lookup2))
196 @@ -735,6 +773,7 @@ out_dput:
200 + intent_release(nd->dentry, &nd->it);
204 @@ -857,7 +896,8 @@ int path_lookup(const char *name, unsign
205 * needs parent already locked. Doesn't follow mounts.
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)
212 struct dentry * dentry;
214 @@ -880,13 +920,16 @@ struct dentry * lookup_hash(struct qstr
218 - dentry = cached_lookup(base, name, 0);
219 + dentry = cached_lookup(base, name, 0, it);
221 struct dentry *new = d_alloc(base, name);
222 dentry = ERR_PTR(-ENOMEM);
225 - dentry = inode->i_op->lookup(inode, new);
226 + if (inode->i_op->lookup2)
227 + dentry = inode->i_op->lookup2(inode, new, it);
229 + dentry = inode->i_op->lookup(inode, new);
232 security_inode_post_lookup(inode, dentry);
233 @@ -898,7 +941,7 @@ out:
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)
242 @@ -918,11 +961,16 @@ struct dentry * lookup_one_len(const cha
244 this.hash = end_name_hash(hash);
246 - return lookup_hash(&this, base);
247 + return lookup_hash(&this, base, it);
249 return ERR_PTR(-EACCES);
252 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
254 + return lookup_one_len_it(name, base, len, NULL);
260 @@ -1224,6 +1272,9 @@ int open_namei(const char * pathname, in
262 * Create - we need to know the parent.
264 + nd->it.it_mode = mode;
265 + nd->it.it_op |= IT_CREAT;
267 error = path_lookup(pathname, LOOKUP_PARENT, nd);
270 @@ -1239,7 +1290,7 @@ int open_namei(const char * pathname, in
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);
278 error = PTR_ERR(dentry);
279 @@ -1247,7 +1298,8 @@ do_last:
280 up(&dir->d_inode->i_sem);
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:
291 if (flag & O_NOFOLLOW)
293 - while (__follow_down(&nd->mnt,&dentry) && d_mountpoint(dentry));
294 + while (__follow_down(&nd->mnt,&dentry,&nd->it) && d_mountpoint(dentry));
297 if (!dentry->d_inode)
298 @@ -1297,8 +1349,10 @@ ok:
302 + intent_release(dentry, &nd->it);
305 + intent_release(nd->dentry, &nd->it);
309 @@ -1320,7 +1374,12 @@ do_link:
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);
317 + error = dentry->d_inode->i_op->follow_link(dentry, nd);
319 + intent_release(dentry, &nd->it);
323 @@ -1342,7 +1401,7 @@ do_link:
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);
332 @@ -1356,7 +1415,7 @@ static struct dentry *lookup_create(stru
333 dentry = ERR_PTR(-EEXIST);
334 if (nd->last_type != LAST_NORM)
336 - dentry = lookup_hash(&nd->last, nd->dentry);
337 + dentry = lookup_hash(&nd->last, nd->dentry, &nd->it);
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
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 *
352 if (nd.last_type != LAST_NORM)
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,
359 + /* the file system wants to use normal vfs path now */
360 + if (error != -EOPNOTSUPP)
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:
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)
379 struct inode *target;
380 @@ -1887,6 +1957,7 @@ int vfs_rename_dir(struct inode *old_dir
383 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
384 + intent_release(new_dentry, it);
387 target->i_flags |= S_DEAD;
388 @@ -1904,7 +1975,8 @@ int vfs_rename_dir(struct inode *old_dir
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)
396 struct inode *target;
398 @@ -1921,6 +1993,7 @@ int vfs_rename_other(struct inode *old_d
401 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
402 + intent_release(new_dentry, it);
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
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)
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
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);
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);
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 *
430 trap = lock_rename(new_dir, old_dir);
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))
437 @@ -2025,7 +2099,7 @@ static inline int do_rename(const char *
439 if (old_dentry == trap)
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))
446 @@ -2035,7 +2109,7 @@ static inline int do_rename(const char *
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);
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
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
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);
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
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)
491 +struct lookup_intent {
495 + int it_disposition;
497 + struct iattr *it_iattr;
498 + __u64 it_lock_handle[2];
505 * linux/include/linux/dcache.h
507 @@ -34,6 +55,8 @@ struct qstr {
511 +#include <linux/namei.h>
513 struct dentry_stat_t {
516 @@ -87,6 +110,7 @@ struct dentry {
517 struct list_head d_subdirs; /* our children */
518 struct list_head d_alias; /* inode alias list */
520 + struct lookup_intent *d_it;
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 *);
532 /* the dentry parameter passed to d_hash and d_compare is the parent
533 @@ -147,6 +173,8 @@ d_iput: no no yes
535 #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
536 #define DCACHE_UNHASHED 0x0010
537 +#define DCACHE_LUSTRE_INVALID 0x0011 /* Lustre invalidated */
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 */
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);
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 *);
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 {
611 + struct lookup_intent it;
615 @@ -44,7 +45,7 @@ extern int FASTCALL(link_path_walk(const
616 extern void path_release(struct nameidata *);
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 *);
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 *);
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);
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);
649 +EXPORT_SYMBOL(do_kern_mount);
650 +EXPORT_SYMBOL(exit_files);
651 +EXPORT_SYMBOL(kmem_cache_validate);
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
663 +int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
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
675 * Do the final lookup.
677 - dentry = lookup_hash(&nd.last, nd.dentry);
678 + dentry = lookup_hash(&nd.last, nd.dentry, NULL);
679 err = PTR_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.
688 -void d_rehash(struct dentry * entry)
689 +void __d_rehash(struct dentry * entry, int lock)
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);
701 +EXPORT_SYMBOL(__d_rehash);
703 +void d_rehash(struct dentry * entry)
705 + __d_rehash(entry, 1);
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
715 +EXPORT_SYMBOL(set_fs_pwd);
717 static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd)
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
723 struct inode * inode;
726 + struct lookup_intent it = { .it_op = IT_GETATTR };
729 if (length < 0) /* sorry, but loff_t says... */
731 @@ -142,11 +143,13 @@ static inline long do_sys_truncate(const
732 error = locks_verify_truncate(inode, NULL, length);
735 + intent_release(nd.dentry, &nd.it);
736 error = do_truncate(nd.dentry, length);
738 put_write_access(inode);
741 + intent_release(nd.dentry, &nd.it);
745 @@ -340,6 +343,8 @@ asmlinkage long sys_access(const char *
746 int old_fsuid, old_fsgid;
747 kernel_cap_t old_cap;
749 + struct lookup_intent it = { .it_op = IT_GETATTR };
752 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
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))
759 + intent_release(nd.dentry, &nd.it);
763 @@ -385,6 +392,8 @@ asmlinkage long sys_chdir(const char * f
767 + struct lookup_intent it = { .it_op = IT_GETATTR };
770 error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
772 @@ -397,6 +406,7 @@ asmlinkage long sys_chdir(const char * f
773 set_fs_pwd(current->fs, nd.mnt, nd.dentry);
776 + intent_release(nd.dentry, &nd.it);
780 @@ -436,6 +446,8 @@ asmlinkage long sys_chroot(const char *
784 + struct lookup_intent it = { .it_op = IT_GETATTR };
787 error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
789 @@ -508,6 +520,18 @@ asmlinkage long sys_chmod(const char * f
791 if (IS_RDONLY(inode))
794 + if (inode->i_op->setattr_raw) {
795 + struct inode_operations *op = nd.dentry->d_inode->i_op;
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)
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)
811 int namei_flags, error;
812 + struct file * temp_filp;
814 + struct lookup_intent it = { .it_op = IT_OPEN, .it_flags = flags };
818 if ((namei_flags+1) & O_ACCMODE)
819 @@ -628,9 +655,11 @@ struct file *filp_open(const char * file
822 error = open_namei(filename, namei_flags, mode, &nd);
824 - return dentry_open(nd.dentry, nd.mnt, flags);
827 + temp_filp = dentry_open(nd.dentry, nd.mnt, flags);
828 + intent_release(nd.dentry,&nd.it);
831 return ERR_PTR(error);
834 @@ -675,7 +704,7 @@ struct file *dentry_open(struct dentry *
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);
848 error = vfs_getattr(nd.mnt, nd.dentry, stat);
849 + intent_release(nd.dentry, &nd.it);
853 @@ -80,6 +81,7 @@ int vfs_lstat(char *name, struct kstat *
854 error = user_path_walk_link(name, &nd);
856 error = vfs_getattr(nd.mnt, nd.dentry, stat);
857 + intent_release(nd.dentry, &nd.it);