1 --- linux-2.4.18-12-uml-pristine/arch/ia64/mm/init.c Mon Sep 9 14:41:40 2002
2 +++ linux-2.4.18-12-uml/arch/ia64/mm/init.c Mon Sep 9 16:08:12 2002
5 static unsigned long totalram_pages;
7 +struct page *check_get_page(unsigned long kaddr)
9 +#warning FIXME: Lustre team, is this solid?
10 + return virt_to_page(kaddr);
14 do_check_pgt_cache (int low, int high)
16 --- linux-2.4.18-12-uml-pristine/arch/i386/mm/init.c Mon Sep 9 14:41:54 2002
17 +++ linux-2.4.18-12-uml/arch/i386/mm/init.c Mon Sep 9 16:08:12 2002
19 static unsigned long totalram_pages;
20 static unsigned long totalhigh_pages;
22 +struct page *check_get_page(unsigned long kaddr)
24 +#warning FIXME: Lustre team, is this solid?
25 + return virt_to_page(kaddr);
28 int do_check_pgt_cache(int low, int high)
31 --- linux-2.4.18-12-uml-pristine/drivers/block/blkpg.c Mon Sep 9 14:41:58 2002
32 +++ linux-2.4.18-12-uml/drivers/block/blkpg.c Mon Sep 9 16:08:12 2002
36 EXPORT_SYMBOL(blk_ioctl);
38 +#define NUM_DEV_NO_WRITE 16
39 +static int dev_no_write[NUM_DEV_NO_WRITE];
42 + * Debug code for turning block devices "read-only" (will discard writes
43 + * silently). This is for filesystem crash/recovery testing.
45 +void dev_set_rdonly(kdev_t dev, int no_write)
48 + printk(KERN_WARNING "Turning device %s read-only\n",
50 + dev_no_write[no_write] = 0xdead0000 + dev;
54 +int dev_check_rdonly(kdev_t dev) {
57 + for (i = 0; i < NUM_DEV_NO_WRITE; i++) {
58 + if ((dev_no_write[i] & 0xffff0000) == 0xdead0000 &&
59 + dev == (dev_no_write[i] & 0xffff))
65 +void dev_clear_rdonly(int no_write) {
66 + dev_no_write[no_write] = 0;
69 +EXPORT_SYMBOL(dev_set_rdonly);
70 +EXPORT_SYMBOL(dev_check_rdonly);
71 +EXPORT_SYMBOL(dev_clear_rdonly);
72 --- linux-2.4.18-12-uml-pristine/drivers/block/loop.c Mon Sep 9 14:41:58 2002
73 +++ linux-2.4.18-12-uml/drivers/block/loop.c Mon Sep 9 16:08:12 2002
75 spin_unlock_irq(&lo->lo_lock);
78 +#ifdef CONFIG_DEV_RDONLY
79 + if (dev_check_rdonly(rbh->b_rdev))
83 if (lo->lo_flags & LO_FLAGS_READ_ONLY)
85 } else if (rw == READA) {
86 --- linux-2.4.18-12-uml-pristine/drivers/ide/ide-disk.c Mon Sep 9 14:41:57 2002
87 +++ linux-2.4.18-12-uml/drivers/ide/ide-disk.c Mon Sep 9 16:08:12 2002
90 static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block)
92 +#ifdef CONFIG_DEV_RDONLY
93 + if (rq->cmd == WRITE && dev_check_rdonly(rq->rq_dev)) {
94 + ide_end_request(1, HWGROUP(drive));
99 OUT_BYTE(drive->ctl,IDE_CONTROL_REG);
101 --- linux-2.4.18-12-uml-pristine/fs/ext3/Makefile Fri Dec 21 10:41:55 2001
102 +++ linux-2.4.18-12-uml/fs/ext3/Makefile Mon Sep 9 16:08:12 2002
107 +export-objs := super.o
109 obj-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
110 ioctl.o namei.o super.o symlink.o
112 --- linux-2.4.18-12-uml-pristine/fs/ext3/super.c Mon Sep 9 14:41:50 2002
113 +++ linux-2.4.18-12-uml/fs/ext3/super.c Mon Sep 9 16:08:12 2002
114 @@ -1746,7 +1746,7 @@
115 unregister_filesystem(&ext3_fs_type);
119 +EXPORT_SYMBOL(ext3_bread);
121 MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
122 MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
123 --- linux-2.4.18-12-uml-pristine/fs/jbd/commit.c Mon Sep 9 14:41:57 2002
124 +++ linux-2.4.18-12-uml/fs/jbd/commit.c Mon Sep 9 16:08:12 2002
126 descriptor = journal_get_descriptor_buffer(journal);
128 __journal_abort_hard(journal);
129 - unlock_journal(journal);
133 --- linux-2.4.18-12-uml-pristine/fs/jbd/transaction.c Mon Sep 9 14:41:57 2002
134 +++ linux-2.4.18-12-uml/fs/jbd/transaction.c Mon Sep 9 16:29:50 2002
139 +/* Allocate a new handle. This should probably be in a slab... */
140 +static handle_t *get_handle(int nblocks)
142 + handle_t *handle = jbd_kmalloc(sizeof (handle_t), GFP_NOFS);
145 + memset(handle, 0, sizeof (handle_t));
146 + handle->h_buffer_credits = nblocks;
148 + INIT_LIST_HEAD(&handle->h_jcb);
154 * Obtain a new handle.
156 --- linux-2.4.18-12-uml-pristine/include/linux/blkdev.h Wed Sep 11 12:32:08 2002
157 +++ linux-2.4.18-12-uml/include/linux/blkdev.h Wed Sep 18 15:52:17 2002
163 +#define CONFIG_DEV_RDONLY
164 +void dev_set_rdonly(kdev_t, int);
165 +int dev_check_rdonly(kdev_t);
166 +void dev_clear_rdonly(int);
169 --- linux-2.4.18-12-uml-pristine/include/linux/slab.h Wed Sep 11 12:32:08 2002
170 +++ linux-2.4.18-12-uml/include/linux/slab.h Wed Sep 18 15:52:16 2002
172 extern int kmem_cache_shrink(kmem_cache_t *);
173 extern void *kmem_cache_alloc(kmem_cache_t *, int);
174 extern void kmem_cache_free(kmem_cache_t *, void *);
175 +extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp);
177 extern void *kmalloc(size_t, int);
178 extern void kfree(const void *);
179 --- linux-2.4.18-12-uml-pristine/kernel/ksyms.c Mon Sep 9 14:41:58 2002
180 +++ linux-2.4.18-12-uml/kernel/ksyms.c Mon Sep 9 16:08:12 2002
182 EXPORT_SYMBOL_GPL(nr_free_pages);
183 EXPORT_SYMBOL_GPL(page_cache_size);
186 +EXPORT_SYMBOL(panic_notifier_list);
187 +EXPORT_SYMBOL(pagecache_lock_cacheline);
188 +EXPORT_SYMBOL(do_kern_mount);
189 +EXPORT_SYMBOL(kmem_cache_validate);
191 /* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */
192 EXPORT_SYMBOL(default_llseek);
193 EXPORT_SYMBOL(dentry_open);
194 --- linux-2.4.18-12-uml-pristine/include/linux/dcache.h Wed Sep 11 12:32:08 2002
195 +++ linux-2.4.18-12-uml/include/linux/dcache.h Wed Sep 18 14:21:14 2002
197 #include <asm/atomic.h>
198 #include <linux/mount.h>
201 +#define IT_CREAT (1<<1)
202 +#define IT_MKDIR (1<<2)
203 +#define IT_LINK (1<<3)
204 +#define IT_LINK2 (1<<4)
205 +#define IT_SYMLINK (1<<5)
206 +#define IT_UNLINK (1<<6)
207 +#define IT_RMDIR (1<<7)
208 +#define IT_RENAME (1<<8)
209 +#define IT_RENAME2 (1<<9)
210 +#define IT_READDIR (1<<10)
211 +#define IT_GETATTR (1<<11)
212 +#define IT_SETATTR (1<<12)
213 +#define IT_READLINK (1<<13)
214 +#define IT_MKNOD (1<<14)
215 +#define IT_LOOKUP (1<<15)
217 +struct lookup_intent {
220 + int it_disposition;
222 + struct iattr *it_iattr;
223 + __u64 it_lock_handle[2];
229 * linux/include/linux/dcache.h
232 unsigned long d_time; /* used by d_revalidate */
233 struct dentry_operations *d_op;
234 struct super_block * d_sb; /* The root of the dentry tree */
235 + struct lookup_intent *d_it;
236 unsigned long d_vfs_flags;
237 void * d_fsdata; /* fs-specific data */
238 void * d_extra_attributes; /* TUX-specific data */
240 int (*d_delete)(struct dentry *);
241 void (*d_release)(struct dentry *);
242 void (*d_iput)(struct dentry *, struct inode *);
243 + int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
244 + void (*d_intent_release)(struct dentry *);
247 /* the dentry parameter passed to d_hash and d_compare is the parent
248 --- linux-2.4.18-12-uml-pristine/include/linux/fs.h Wed Sep 11 12:32:08 2002
249 +++ linux-2.4.18-12-uml/include/linux/fs.h Wed Sep 18 15:52:16 2002
252 /* needed for tty driver, and maybe others */
254 + struct lookup_intent *f_intent;
256 /* preallocated helper kiobuf to speedup O_DIRECT */
257 struct kiobuf *f_iobuf;
259 extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
260 extern int vfs_rmdir(struct inode *, struct dentry *);
261 extern int vfs_unlink(struct inode *, struct dentry *);
262 -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
263 +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
264 + struct inode *new_dir, struct dentry *new_dentry,
265 + struct lookup_intent *it);
270 struct inode_operations {
271 int (*create) (struct inode *,struct dentry *,int);
272 struct dentry * (*lookup) (struct inode *,struct dentry *);
273 + struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *);
274 int (*link) (struct dentry *,struct inode *,struct dentry *);
275 int (*unlink) (struct inode *,struct dentry *);
276 int (*symlink) (struct inode *,struct dentry *,const char *);
277 @@ -1046,6 +1050,7 @@
278 extern struct vfsmount *kern_mount(struct file_system_type *);
279 extern int may_umount(struct vfsmount *);
280 extern long do_mount(char *, char *, char *, unsigned long, void *);
281 +struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
282 extern void umount_tree(struct vfsmount *);
284 #define kern_umount mntput
285 @@ -1380,6 +1385,7 @@
286 extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
288 extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
289 +extern int FASTCALL(__user_walk_it(const char *, unsigned, struct nameidata *, struct lookup_intent *it));
290 extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
291 extern int FASTCALL(path_walk(const char *, struct nameidata *));
292 extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
293 @@ -1391,6 +1397,8 @@
294 extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
295 #define user_path_walk(name,nd) __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
296 #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
297 +#define user_path_walk_it(name,nd,it) __user_walk_it(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd, it)
298 +#define user_path_walk_link_it(name,nd,it) __user_walk_it(name, LOOKUP_POSITIVE, nd, it)
300 extern void inode_init_once(struct inode *);
301 extern void iput(struct inode *);
302 --- linux-2.4.18-12-uml-pristine/fs/dcache.c Mon Sep 9 14:41:54 2002
303 +++ linux-2.4.18-12-uml/fs/dcache.c Mon Sep 9 16:08:12 2002
305 dentry->d_fsdata = NULL;
306 dentry->d_extra_attributes = NULL;
307 dentry->d_mounted = 0;
308 + dentry->d_it = NULL;
309 INIT_LIST_HEAD(&dentry->d_hash);
310 INIT_LIST_HEAD(&dentry->d_lru);
311 INIT_LIST_HEAD(&dentry->d_subdirs);
312 --- linux-2.4.18-12-uml-pristine/fs/nfsd/vfs.c Mon Sep 9 14:41:50 2002
313 +++ linux-2.4.18-12-uml/fs/nfsd/vfs.c Mon Sep 9 16:08:12 2002
314 @@ -1298,7 +1298,7 @@
318 - err = vfs_rename(fdir, odentry, tdir, ndentry);
319 + err = vfs_rename(fdir, odentry, tdir, ndentry, NULL);
321 if (!err && EX_ISSYNC(tfhp->fh_export)) {
322 nfsd_sync_dir(tdentry);
323 --- linux-2.4.18-12-uml-pristine/fs/namei.c Mon Sep 9 14:41:56 2002
324 +++ linux-2.4.18-12-uml/fs/namei.c Wed Sep 18 16:59:58 2002
326 * XEmacs seems to be relying on it...
329 +void intent_release(struct dentry *de)
331 + if (de->d_op && de->d_op->d_intent_release)
332 + de->d_op->d_intent_release(de);
337 /* In order to reduce some races, while at the same time doing additional
338 * checking and hopefully speeding things up, we copy filenames to the
339 * kernel data space before using them..
340 @@ -260,10 +268,19 @@
341 * Internal lookup() using the new generic dcache.
344 -static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags)
345 +static struct dentry *cached_lookup(struct dentry *parent, struct qstr *name,
346 + int flags, struct lookup_intent *it)
348 struct dentry * dentry = d_lookup(parent, name);
350 + if (dentry && dentry->d_op && dentry->d_op->d_revalidate2) {
351 + if (!dentry->d_op->d_revalidate2(dentry, flags, it) &&
352 + !d_invalidate(dentry)) {
358 if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
359 if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
362 * make sure that nobody added the entry to the dcache in the meantime..
365 -static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, int flags)
366 +static struct dentry *real_lookup(struct dentry *parent, struct qstr *name,
367 + int flags, struct lookup_intent *it)
369 struct dentry * result;
370 struct inode *dir = parent->d_inode;
372 result = ERR_PTR(-ENOMEM);
375 + if (dir->i_op->lookup2)
376 + result = dir->i_op->lookup2(dir, dentry, it);
378 result = dir->i_op->lookup(dir, dentry);
383 result = ERR_PTR(-ENOENT);
385 + } else if (result->d_op && result->d_op->d_revalidate2) {
386 + if (!result->d_op->d_revalidate2(result, flags, it) &&
387 + !d_invalidate(result)) {
389 + result = ERR_PTR(-ENOENT);
396 * We expect 'base' to be positive and a directory.
398 -int link_path_walk(const char * name, struct nameidata *nd)
399 +int link_path_walk_it(const char *name, struct nameidata *nd,
400 + struct lookup_intent *it)
402 struct dentry *dentry;
404 @@ -526,12 +554,12 @@
407 /* This does the actual lookups.. */
408 - dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
409 + dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
411 err = -EWOULDBLOCKIO;
414 - dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
415 + dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
416 err = PTR_ERR(dentry);
423 - if (!inode->i_op->lookup)
424 + if (!inode->i_op->lookup && !inode->i_op->lookup2)
427 /* here ends the main loop */
428 @@ -592,12 +620,12 @@
432 - dentry = cached_lookup(nd->dentry, &this, 0);
433 + dentry = cached_lookup(nd->dentry, &this, 0, it);
435 err = -EWOULDBLOCKIO;
438 - dentry = real_lookup(nd->dentry, &this, 0);
439 + dentry = real_lookup(nd->dentry, &this, 0, it);
440 err = PTR_ERR(dentry);
445 if (lookup_flags & LOOKUP_DIRECTORY) {
447 - if (!inode->i_op || !inode->i_op->lookup)
448 + if (!inode->i_op || (!inode->i_op->lookup &&
449 + !inode->i_op->lookup2))
457 + nd->dentry->d_it = it;
461 @@ -660,15 +690,29 @@
466 + nd->dentry->d_it = it;
470 +int link_path_walk(const char * name, struct nameidata *nd)
472 + return link_path_walk_it(name, nd, NULL);
475 +int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it)
477 + current->total_link_count = 0;
478 + return link_path_walk_it(name, nd, it);
481 int path_walk(const char * name, struct nameidata *nd)
483 current->total_link_count = 0;
484 - return link_path_walk(name, nd);
485 + return link_path_walk_it(name, nd, NULL);
490 /* returns 1 if everything is done */
491 static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
496 +int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
497 + struct lookup_intent *it)
500 + if (path_init(path, flags, nd))
501 + error = path_walk_it(path, nd, it);
507 int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
511 * needs parent already locked. Doesn't follow mounts.
514 -struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
515 +struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
516 + struct lookup_intent *it)
518 struct dentry * dentry;
520 @@ -802,13 +858,16 @@
524 - dentry = cached_lookup(base, name, 0);
525 + dentry = cached_lookup(base, name, 0, it);
527 struct dentry *new = d_alloc(base, name);
528 dentry = ERR_PTR(-ENOMEM);
532 + if (inode->i_op->lookup2)
533 + dentry = inode->i_op->lookup2(inode, new, it);
535 dentry = inode->i_op->lookup(inode, new);
542 +struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
544 + return lookup_hash_it(name, base, NULL);
549 struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
553 this.hash = end_name_hash(hash);
555 - return lookup_hash(&this, base);
556 + return lookup_hash_it(&this, base, NULL);
558 return ERR_PTR(-EACCES);
564 +int __user_walk_it(const char *name, unsigned flags, struct nameidata *nd,
565 + struct lookup_intent *it)
570 + tmp = getname(name);
571 + err = PTR_ERR(tmp);
572 + if (!IS_ERR(tmp)) {
574 + if (path_init(tmp, flags, nd))
575 + err = path_walk_it(tmp, nd, it);
582 * It's inline, so penalty for filesystems that don't use sticky bit is
584 @@ -1010,7 +1092,8 @@
585 * for symlinks (where the permissions are checked later).
588 -int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
589 +int open_namei_it(const char *pathname, int flag, int mode,
590 + struct nameidata *nd, struct lookup_intent *it)
592 int acc_mode, error = 0;
594 @@ -1024,16 +1107,21 @@
595 * The simplest case - just a plain lookup.
597 if (!(flag & O_CREAT)) {
598 - error = path_lookup(pathname, lookup_flags(flag), nd);
599 + error = path_lookup_it(pathname, lookup_flags(flag), nd, it);
608 * Create - we need to know the parent.
611 + it->it_mode = mode;
612 + it->it_op |= IT_CREAT;
614 error = path_lookup(pathname, LOOKUP_PARENT, nd);
617 @@ -1049,7 +1137,7 @@
620 down(&dir->d_inode->i_sem);
621 - dentry = lookup_hash(&nd->last, nd->dentry);
622 + dentry = lookup_hash_it(&nd->last, nd->dentry, it);
625 error = PTR_ERR(dentry);
626 @@ -1058,6 +1146,8 @@
631 + dentry->d_it->it_mode = mode;
632 /* Negative dentry, just create the file */
633 if (!dentry->d_inode) {
634 error = vfs_create(dir->d_inode, dentry,
635 @@ -1177,8 +1267,10 @@
639 + intent_release(dentry);
642 + intent_release(nd->dentry);
646 @@ -1198,6 +1290,8 @@
648 UPDATE_ATIME(dentry->d_inode);
649 error = dentry->d_inode->i_op->follow_link(dentry, nd);
651 + intent_release(dentry);
655 @@ -1219,13 +1313,20 @@
658 down(&dir->d_inode->i_sem);
659 - dentry = lookup_hash(&nd->last, nd->dentry);
660 + dentry = lookup_hash_it(&nd->last, nd->dentry, NULL);
661 putname(nd->last.name);
665 +int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd)
667 + return open_namei_it(pathname, flag, mode, nd, NULL);
672 -static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
673 +static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
674 + struct lookup_intent *it)
676 struct dentry *dentry;
678 @@ -1233,7 +1334,7 @@
679 dentry = ERR_PTR(-EEXIST);
680 if (nd->last_type != LAST_NORM)
682 - dentry = lookup_hash(&nd->last, nd->dentry);
683 + dentry = lookup_hash_it(&nd->last, nd->dentry, it);
686 if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
687 @@ -1279,6 +1380,7 @@
689 struct dentry * dentry;
691 + struct lookup_intent it = { .it_op = IT_MKNOD, .it_mode = mode };
695 @@ -1289,11 +1391,12 @@
696 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
699 - dentry = lookup_create(&nd, 0);
700 + dentry = lookup_create(&nd, 0, &it);
701 error = PTR_ERR(dentry);
703 mode &= ~current->fs->umask;
704 if (!IS_ERR(dentry)) {
705 + dentry->d_it = ⁢
706 switch (mode & S_IFMT) {
707 case 0: case S_IFREG:
708 error = vfs_create(nd.dentry->d_inode,dentry,mode);
709 @@ -1307,6 +1410,7 @@
713 + intent_release(dentry);
716 up(&nd.dentry->d_inode->i_sem);
717 @@ -1347,6 +1451,7 @@
721 + struct lookup_intent it = { .it_op = IT_MKDIR, .it_mode = mode };
723 tmp = getname(pathname);
724 error = PTR_ERR(tmp);
725 @@ -1357,11 +1462,13 @@
726 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
729 - dentry = lookup_create(&nd, 1);
730 + dentry = lookup_create(&nd, 1, &it);
731 error = PTR_ERR(dentry);
732 if (!IS_ERR(dentry)) {
733 + dentry->d_it = ⁢
734 error = vfs_mkdir(nd.dentry->d_inode, dentry,
735 mode & ~current->fs->umask);
736 + intent_release(dentry);
739 up(&nd.dentry->d_inode->i_sem);
740 @@ -1445,6 +1552,7 @@
742 struct dentry *dentry;
744 + struct lookup_intent it = { .it_op = IT_RMDIR };
746 name = getname(pathname);
748 @@ -1466,10 +1574,12 @@
751 down(&nd.dentry->d_inode->i_sem);
752 - dentry = lookup_hash(&nd.last, nd.dentry);
753 + dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
754 error = PTR_ERR(dentry);
755 if (!IS_ERR(dentry)) {
756 + dentry->d_it = ⁢
757 error = vfs_rmdir(nd.dentry->d_inode, dentry);
758 + intent_release(dentry);
761 up(&nd.dentry->d_inode->i_sem);
762 @@ -1513,6 +1623,7 @@
764 struct dentry *dentry;
766 + struct lookup_intent it = { .it_op = IT_UNLINK };
768 name = getname(pathname);
770 @@ -1525,14 +1636,16 @@
771 if (nd.last_type != LAST_NORM)
773 down(&nd.dentry->d_inode->i_sem);
774 - dentry = lookup_hash(&nd.last, nd.dentry);
775 + dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
776 error = PTR_ERR(dentry);
777 if (!IS_ERR(dentry)) {
778 + dentry->d_it = ⁢
779 /* Why not before? Because we want correct error value */
780 if (nd.last.name[nd.last.len])
782 error = vfs_unlink(nd.dentry->d_inode, dentry);
784 + intent_release(dentry);
787 up(&nd.dentry->d_inode->i_sem);
788 @@ -1579,6 +1692,7 @@
792 + struct lookup_intent it = { .it_op = IT_SYMLINK };
794 from = getname(oldname);
796 @@ -1592,10 +1706,13 @@
797 error = path_lookup(to, LOOKUP_PARENT, &nd);
800 - dentry = lookup_create(&nd, 0);
802 + dentry = lookup_create(&nd, 0, &it);
803 error = PTR_ERR(dentry);
804 if (!IS_ERR(dentry)) {
805 + dentry->d_it = ⁢
806 error = vfs_symlink(nd.dentry->d_inode, dentry, from);
807 + intent_release(dentry);
810 up(&nd.dentry->d_inode->i_sem);
811 @@ -1660,6 +1777,7 @@
815 + struct lookup_intent it = { .it_op = IT_LINK };
817 to = getname(newname);
819 @@ -1667,7 +1785,7 @@
820 struct dentry *new_dentry;
821 struct nameidata nd, old_nd;
823 - error = __user_walk(oldname, LOOKUP_POSITIVE, &old_nd);
824 + error = __user_walk_it(oldname, LOOKUP_POSITIVE, &old_nd, &it);
827 error = path_lookup(to, LOOKUP_PARENT, &nd);
828 @@ -1676,10 +1794,13 @@
830 if (old_nd.mnt != nd.mnt)
832 - new_dentry = lookup_create(&nd, 0);
833 + it.it_op = IT_LINK2;
834 + new_dentry = lookup_create(&nd, 0, &it);
835 error = PTR_ERR(new_dentry);
836 if (!IS_ERR(new_dentry)) {
837 + new_dentry->d_it = ⁢
838 error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
839 + intent_release(new_dentry);
842 up(&nd.dentry->d_inode->i_sem);
843 @@ -1720,7 +1841,8 @@
846 int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
847 - struct inode *new_dir, struct dentry *new_dentry)
848 + struct inode *new_dir, struct dentry *new_dentry,
849 + struct lookup_intent *it)
852 struct inode *target;
853 @@ -1774,10 +1896,12 @@
855 double_down(&old_dir->i_zombie,
857 + new_dentry->d_it = it;
858 if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry))
861 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
862 + intent_release(new_dentry);
865 target->i_flags |= S_DEAD;
866 @@ -1799,7 +1923,8 @@
869 int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
870 - struct inode *new_dir, struct dentry *new_dentry)
871 + struct inode *new_dir, struct dentry *new_dentry,
872 + struct lookup_intent *it)
876 @@ -1826,10 +1951,12 @@
879 double_down(&old_dir->i_zombie, &new_dir->i_zombie);
880 + new_dentry->d_it = it;
881 if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry))
884 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
885 + intent_release(new_dentry);
886 double_up(&old_dir->i_zombie, &new_dir->i_zombie);
889 @@ -1841,13 +1968,14 @@
892 int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
893 - struct inode *new_dir, struct dentry *new_dentry)
894 + struct inode *new_dir, struct dentry *new_dentry,
895 + struct lookup_intent *it)
898 if (S_ISDIR(old_dentry->d_inode->i_mode))
899 - error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry);
900 + error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry,it);
902 - error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry);
903 + error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry,it);
905 if (old_dir == new_dir)
906 inode_dir_notify(old_dir, DN_RENAME);
907 @@ -1864,6 +1992,7 @@
909 struct dentry * old_dir, * new_dir;
910 struct dentry * old_dentry, *new_dentry;
911 + struct lookup_intent it = { .it_op = IT_RENAME };
912 struct nameidata oldnd, newnd;
914 error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
915 @@ -1889,7 +2018,7 @@
917 double_lock(new_dir, old_dir);
919 - old_dentry = lookup_hash(&oldnd.last, old_dir);
920 + old_dentry = lookup_hash_it(&oldnd.last, old_dir, &it);
921 error = PTR_ERR(old_dentry);
922 if (IS_ERR(old_dentry))
924 @@ -1905,18 +2034,21 @@
925 if (newnd.last.name[newnd.last.len])
928 - new_dentry = lookup_hash(&newnd.last, new_dir);
929 + it.it_op = IT_RENAME2;
930 + new_dentry = lookup_hash_it(&newnd.last, new_dir, &it);
931 error = PTR_ERR(new_dentry);
932 if (IS_ERR(new_dentry))
936 error = vfs_rename(old_dir->d_inode, old_dentry,
937 - new_dir->d_inode, new_dentry);
938 + new_dir->d_inode, new_dentry, &it);
941 + intent_release(new_dentry);
944 + intent_release(old_dentry);
947 double_up(&new_dir->d_inode->i_sem, &old_dir->d_inode->i_sem);
948 --- linux-2.4.18-12-uml-pristine/fs/open.c Mon Sep 9 14:41:56 2002
949 +++ linux-2.4.18-12-uml/fs/open.c Mon Sep 9 16:11:20 2002
951 #include <asm/uaccess.h>
953 #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
954 +extern int path_walk_it(const char *name, struct nameidata *nd,
955 + struct lookup_intent *it);
956 +extern void intent_release(struct dentry *de);
958 int vfs_statfs(struct super_block *sb, struct statfs *buf)
960 @@ -118,14 +121,16 @@
962 struct inode * inode;
964 + struct lookup_intent it = { .it_op = IT_SETATTR };
967 if (length < 0) /* sorry, but loff_t says... */
970 - error = user_path_walk(path, &nd);
971 + error = user_path_walk_it(path, &nd, &it);
974 + nd.dentry->d_it = ⁢
975 inode = nd.dentry->d_inode;
977 /* For directories it's -EISDIR, for other non-regulars - -EINVAL */
979 put_write_access(inode);
982 + intent_release(nd.dentry);
986 @@ -259,10 +265,12 @@
988 struct inode * inode;
989 struct iattr newattrs;
990 + struct lookup_intent it = { .it_op = IT_SETATTR };
992 - error = user_path_walk(filename, &nd);
993 + error = user_path_walk_it(filename, &nd, &it);
996 + nd.dentry->d_it = ⁢
997 inode = nd.dentry->d_inode;
1002 error = notify_change(nd.dentry, &newattrs);
1004 + intent_release(nd.dentry);
1008 @@ -303,11 +312,13 @@
1009 struct nameidata nd;
1010 struct inode * inode;
1011 struct iattr newattrs;
1012 + struct lookup_intent it = { .it_op = IT_SETATTR };
1014 - error = user_path_walk(filename, &nd);
1015 + error = user_path_walk_it(filename, &nd, &it);
1019 + nd.dentry->d_it = ⁢
1020 inode = nd.dentry->d_inode;
1025 error = notify_change(nd.dentry, &newattrs);
1027 + intent_release(nd.dentry);
1032 int old_fsuid, old_fsgid;
1033 kernel_cap_t old_cap;
1035 + struct lookup_intent it = { .it_op = IT_GETATTR };
1037 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
1039 @@ -364,13 +377,14 @@
1041 current->cap_effective = current->cap_permitted;
1043 - res = user_path_walk(filename, &nd);
1044 + res = user_path_walk_it(filename, &nd, &it);
1046 res = permission(nd.dentry->d_inode, mode);
1047 /* SuS v2 requires we report a read only fs too */
1048 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
1049 && !special_file(nd.dentry->d_inode->i_mode))
1051 + intent_release(nd.dentry);
1055 @@ -385,11 +399,15 @@
1058 struct nameidata nd;
1059 + struct lookup_intent it = { .it_op = IT_GETATTR };
1061 - error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd);
1062 + error = __user_walk_it(filename,
1063 + LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,
1068 + nd.dentry->d_it = ⁢
1069 error = permission(nd.dentry->d_inode,MAY_EXEC);
1073 set_fs_pwd(current->fs, nd.mnt, nd.dentry);
1076 + intent_release(nd.dentry);
1080 @@ -436,12 +455,14 @@
1083 struct nameidata nd;
1084 + struct lookup_intent it = { .it_op = IT_GETATTR };
1086 - error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
1087 - LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
1088 + error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
1089 + LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
1093 + nd.dentry->d_it = ⁢
1094 error = permission(nd.dentry->d_inode,MAY_EXEC);
1101 + intent_release(nd.dentry);
1105 @@ -498,12 +520,14 @@
1106 struct inode * inode;
1108 struct iattr newattrs;
1109 + struct lookup_intent it = { .it_op = IT_SETATTR };
1111 - error = user_path_walk(filename, &nd);
1112 + error = user_path_walk_it(filename, &nd, &it);
1115 inode = nd.dentry->d_inode;
1117 + nd.dentry->d_it = ⁢
1119 if (IS_RDONLY(inode))
1122 error = notify_change(nd.dentry, &newattrs);
1125 + intent_release(nd.dentry);
1129 @@ -588,10 +613,13 @@
1131 struct nameidata nd;
1133 + struct lookup_intent it = { .it_op = IT_SETATTR };
1135 - error = user_path_walk(filename, &nd);
1136 + error = user_path_walk_it(filename, &nd, &it);
1138 + nd.dentry->d_it = ⁢
1139 error = chown_common(nd.dentry, user, group);
1140 + intent_release(nd.dentry);
1144 @@ -601,10 +629,13 @@
1146 struct nameidata nd;
1148 + struct lookup_intent it = { .it_op = IT_SETATTR };
1150 - error = user_path_walk_link(filename, &nd);
1151 + error = user_path_walk_link_it(filename, &nd, &it);
1153 + nd.dentry->d_it = ⁢
1154 error = chown_common(nd.dentry, user, group);
1155 + intent_release(nd.dentry);
1159 @@ -638,10 +669,16 @@
1160 * for the internal routines (ie open_namei()/follow_link() etc). 00 is
1163 +extern int open_namei_it(const char *filename, int namei_flags, int mode,
1164 + struct nameidata *nd, struct lookup_intent *it);
1165 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
1166 + int flags, struct lookup_intent *it);
1168 struct file *filp_open(const char * filename, int flags, int mode)
1170 int namei_flags, error;
1171 struct nameidata nd;
1172 + struct lookup_intent it = { .it_op = IT_OPEN };
1174 namei_flags = flags;
1175 if ((namei_flags+1) & O_ACCMODE)
1176 @@ -649,18 +686,19 @@
1177 if (namei_flags & O_TRUNC)
1180 - error = open_namei(filename, namei_flags, mode, &nd);
1182 - return dentry_open(nd.dentry, nd.mnt, flags);
1184 - return ERR_PTR(error);
1185 + error = open_namei_it(filename, namei_flags, mode, &nd, &it);
1187 + return ERR_PTR(error);
1189 + return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
1192 extern ssize_t do_readahead(struct file *file, unsigned long index, unsigned long nr);
1193 /* for files over a certains size it doesn't pay to do readahead on open */
1194 #define READAHEAD_CUTOFF 48000
1196 -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1197 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
1198 + int flags, struct lookup_intent *it)
1201 struct inode *inode;
1203 do_readahead(f, 0, (48 * 1024) >> PAGE_SHIFT);
1206 + intent_release(dentry);
1210 @@ -725,11 +764,17 @@
1214 + intent_release(dentry);
1217 return ERR_PTR(error);
1220 +struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1222 + return dentry_open_it(dentry, mnt, flags, NULL);
1226 * Find an empty file descriptor entry, and mark it busy.
1228 --- linux-2.4.18-12-uml-pristine/fs/stat.c Mon Sep 9 14:41:56 2002
1229 +++ linux-2.4.18-12-uml/fs/stat.c Mon Sep 9 16:08:12 2002
1232 #include <asm/uaccess.h>
1234 +extern void intent_release(struct dentry *de);
1236 * Revalidate the inode. This is required for proper NFS attribute caching.
1238 @@ -104,10 +105,12 @@
1240 struct nameidata nd;
1242 + struct lookup_intent it = { .it_op = IT_GETATTR };
1244 - error = user_path_walk(name, &nd);
1245 + error = user_path_walk_it(name, &nd, &it);
1247 error = do_getattr(nd.mnt, nd.dentry, stat);
1248 + intent_release(nd.dentry);
1252 @@ -117,10 +120,12 @@
1254 struct nameidata nd;
1256 + struct lookup_intent it = { .it_op = IT_GETATTR };
1258 - error = user_path_walk_link(name, &nd);
1259 + error = user_path_walk_link_it(name, &nd, &it);
1261 error = do_getattr(nd.mnt, nd.dentry, stat);
1262 + intent_release(nd.dentry);
1266 --- linux-2.4.18-12-uml-pristine/mm/slab.c Mon Sep 9 14:41:53 2002
1267 +++ linux-2.4.18-12-uml/mm/slab.c Mon Sep 9 16:08:12 2002
1268 @@ -1208,6 +1208,59 @@
1269 * Called with the cache-lock held.
1272 +extern struct page *check_get_page(unsigned long kaddr);
1273 +struct page *page_mem_map(struct page *page);
1274 +static int kmem_check_cache_obj (kmem_cache_t * cachep,
1275 + slab_t *slabp, void * objp)
1278 + unsigned int objnr;
1281 + if (cachep->flags & SLAB_RED_ZONE) {
1282 + objp -= BYTES_PER_WORD;
1283 + if ( *(unsigned long *)objp != RED_MAGIC2)
1284 + /* Either write before start, or a double free. */
1286 + if (*(unsigned long *)(objp+cachep->objsize -
1287 + BYTES_PER_WORD) != RED_MAGIC2)
1288 + /* Either write past end, or a double free. */
1293 + objnr = (objp-slabp->s_mem)/cachep->objsize;
1294 + if (objnr >= cachep->num)
1296 + if (objp != slabp->s_mem + objnr*cachep->objsize)
1299 + /* Check slab's freelist to see if this obj is there. */
1300 + for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) {
1308 +int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
1310 + struct page *page = check_get_page((unsigned long)objp);
1312 + if (!VALID_PAGE(page))
1315 + if (!PageSlab(page))
1318 + /* XXX check for freed slab objects ? */
1319 + if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp))
1322 + return (cachep == GET_PAGE_CACHE(page));
1326 static int kmem_extra_free_checks (kmem_cache_t * cachep,
1327 slab_t *slabp, void * objp)