1 --- linux-2.4.18-17.8.0-uml-pristine/include/linux/lustre_version.h Wed Dec 31 19:00:00 1969
2 +++ linux-2.4.18-17.8.0-uml/include/linux/lustre_version.h Wed Nov 6 02:34:14 2002
4 +#define LUSTRE_KERNEL_VERSION 2
5 --- linux-2.4.18-17.8.0-uml-pristine/arch/ia64/mm/init.c 2002-10-19 11:44:08.000000000 -0600
6 +++ linux-2.4.18-17.8.0-uml/arch/ia64/mm/init.c 2002-10-19 11:44:51.000000000 -0600
9 static unsigned long totalram_pages;
11 +struct page *check_get_page(unsigned long kaddr)
13 +#warning FIXME: Lustre team, is this solid?
14 + return virt_to_page(kaddr);
18 do_check_pgt_cache (int low, int high)
20 --- linux-2.4.18-17.8.0-uml-pristine/arch/i386/mm/init.c 2002-10-19 11:44:04.000000000 -0600
21 +++ linux-2.4.18-17.8.0-uml/arch/i386/mm/init.c 2002-10-19 11:44:51.000000000 -0600
23 static unsigned long totalram_pages;
24 static unsigned long totalhigh_pages;
26 +struct page *check_get_page(unsigned long kaddr)
28 +#warning FIXME: Lustre team, is this solid?
29 + return virt_to_page(kaddr);
32 int do_check_pgt_cache(int low, int high)
35 --- linux-2.4.18-17.8.0-uml-pristine/drivers/block/blkpg.c 2002-10-19 11:43:55.000000000 -0600
36 +++ linux-2.4.18-17.8.0-uml/drivers/block/blkpg.c 2002-10-19 11:44:51.000000000 -0600
40 EXPORT_SYMBOL(blk_ioctl);
42 +#define NUM_DEV_NO_WRITE 16
43 +static int dev_no_write[NUM_DEV_NO_WRITE];
46 + * Debug code for turning block devices "read-only" (will discard writes
47 + * silently). This is for filesystem crash/recovery testing.
49 +void dev_set_rdonly(kdev_t dev, int no_write)
52 + printk(KERN_WARNING "Turning device %s read-only\n",
54 + dev_no_write[no_write] = 0xdead0000 + dev;
58 +int dev_check_rdonly(kdev_t dev) {
61 + for (i = 0; i < NUM_DEV_NO_WRITE; i++) {
62 + if ((dev_no_write[i] & 0xffff0000) == 0xdead0000 &&
63 + dev == (dev_no_write[i] & 0xffff))
69 +void dev_clear_rdonly(int no_write) {
70 + dev_no_write[no_write] = 0;
73 +EXPORT_SYMBOL(dev_set_rdonly);
74 +EXPORT_SYMBOL(dev_check_rdonly);
75 +EXPORT_SYMBOL(dev_clear_rdonly);
76 --- linux-2.4.18-17.8.0-uml-pristine/drivers/block/loop.c 2002-10-19 11:43:55.000000000 -0600
77 +++ linux-2.4.18-17.8.0-uml/drivers/block/loop.c 2002-10-19 11:44:51.000000000 -0600
79 spin_unlock_irq(&lo->lo_lock);
82 +#ifdef CONFIG_DEV_RDONLY
83 + if (dev_check_rdonly(rbh->b_rdev))
87 if (lo->lo_flags & LO_FLAGS_READ_ONLY)
89 } else if (rw == READA) {
90 --- linux-2.4.18-17.8.0-uml-pristine/drivers/ide/ide-disk.c 2002-10-19 11:43:58.000000000 -0600
91 +++ linux-2.4.18-17.8.0-uml/drivers/ide/ide-disk.c 2002-10-19 11:44:51.000000000 -0600
94 static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block)
96 +#ifdef CONFIG_DEV_RDONLY
97 + if (rq->cmd == WRITE && dev_check_rdonly(rq->rq_dev)) {
98 + ide_end_request(1, HWGROUP(drive));
103 OUT_BYTE(drive->ctl,IDE_CONTROL_REG);
105 --- linux-2.4.18-17.8.0-uml-pristine/fs/ext3/Makefile 2002-10-19 11:43:53.000000000 -0600
106 +++ linux-2.4.18-17.8.0-uml/fs/ext3/Makefile 2002-10-19 11:44:51.000000000 -0600
111 +export-objs := super.o
113 obj-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
114 ioctl.o namei.o super.o symlink.o
116 --- linux-2.4.18-17.8.0-uml-pristine/fs/ext3/super.c 2002-10-19 11:43:53.000000000 -0600
117 +++ linux-2.4.18-17.8.0-uml/fs/ext3/super.c 2002-10-19 11:44:51.000000000 -0600
118 @@ -1746,7 +1746,7 @@
119 unregister_filesystem(&ext3_fs_type);
123 +EXPORT_SYMBOL(ext3_bread);
125 MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
126 MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
127 --- linux-2.4.18-17.8.0-uml-pristine/include/linux/slab.h 2002-10-19 11:43:54.000000000 -0600
128 +++ linux-2.4.18-17.8.0-uml/include/linux/slab.h 2002-11-02 00:49:24.000000000 -0700
130 extern int kmem_cache_shrink(kmem_cache_t *);
131 extern void *kmem_cache_alloc(kmem_cache_t *, int);
132 extern void kmem_cache_free(kmem_cache_t *, void *);
133 +extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp);
135 extern void *kmalloc(size_t, int);
136 extern void kfree(const void *);
137 --- linux-2.4.18-17.8.0-uml-pristine/kernel/ksyms.c 2002-10-19 11:43:53.000000000 -0600
138 +++ linux-2.4.18-17.8.0-uml/kernel/ksyms.c 2002-11-02 01:09:34.000000000 -0700
140 EXPORT_SYMBOL(set_page_dirty);
141 EXPORT_SYMBOL(vfs_readlink);
142 EXPORT_SYMBOL(vfs_follow_link);
143 +EXPORT_SYMBOL(vfs_follow_link_it);
144 EXPORT_SYMBOL(page_readlink);
145 EXPORT_SYMBOL(page_follow_link);
146 EXPORT_SYMBOL(page_symlink_inode_operations);
148 EXPORT_SYMBOL_GPL(nr_free_pages);
149 EXPORT_SYMBOL_GPL(page_cache_size);
152 +EXPORT_SYMBOL(panic_notifier_list);
153 +EXPORT_SYMBOL(pagecache_lock_cacheline);
154 +EXPORT_SYMBOL(do_kern_mount);
155 +EXPORT_SYMBOL(kmem_cache_validate);
157 /* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */
158 EXPORT_SYMBOL(default_llseek);
159 EXPORT_SYMBOL(dentry_open);
160 --- linux-2.4.18-17.8.0-uml-pristine/include/linux/dcache.h 2002-10-19 11:43:54.000000000 -0600
161 +++ linux-2.4.18-17.8.0-uml/include/linux/dcache.h 2002-11-02 00:49:24.000000000 -0700
163 #include <asm/atomic.h>
164 #include <linux/mount.h>
167 +#define IT_CREAT (1<<1)
168 +#define IT_MKDIR (1<<2)
169 +#define IT_LINK (1<<3)
170 +#define IT_LINK2 (1<<4)
171 +#define IT_SYMLINK (1<<5)
172 +#define IT_UNLINK (1<<6)
173 +#define IT_RMDIR (1<<7)
174 +#define IT_RENAME (1<<8)
175 +#define IT_RENAME2 (1<<9)
176 +#define IT_READDIR (1<<10)
177 +#define IT_GETATTR (1<<11)
178 +#define IT_SETATTR (1<<12)
179 +#define IT_READLINK (1<<13)
180 +#define IT_MKNOD (1<<14)
181 +#define IT_LOOKUP (1<<15)
183 +struct lookup_intent {
186 + int it_disposition;
188 + struct iattr *it_iattr;
189 + __u64 it_lock_handle[2];
195 * linux/include/linux/dcache.h
198 unsigned long d_time; /* used by d_revalidate */
199 struct dentry_operations *d_op;
200 struct super_block * d_sb; /* The root of the dentry tree */
201 + struct lookup_intent *d_it;
202 unsigned long d_vfs_flags;
203 void * d_fsdata; /* fs-specific data */
204 void * d_extra_attributes; /* TUX-specific data */
206 int (*d_delete)(struct dentry *);
207 void (*d_release)(struct dentry *);
208 void (*d_iput)(struct dentry *, struct inode *);
209 + int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
210 + void (*d_intent_release)(struct dentry *, struct lookup_intent *);
213 /* the dentry parameter passed to d_hash and d_compare is the parent
214 --- linux-2.4.18-17.8.0-uml-pristine/include/linux/fs.h 2002-10-19 11:43:54.000000000 -0600
215 +++ linux-2.4.18-17.8.0-uml/include/linux/fs.h 2002-11-02 00:49:24.000000000 -0700
218 /* needed for tty driver, and maybe others */
220 + struct lookup_intent *f_intent;
222 /* preallocated helper kiobuf to speedup O_DIRECT */
223 struct kiobuf *f_iobuf;
225 extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
226 extern int vfs_rmdir(struct inode *, struct dentry *);
227 extern int vfs_unlink(struct inode *, struct dentry *);
228 -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
229 +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
230 + struct inode *new_dir, struct dentry *new_dentry,
231 + struct lookup_intent *it);
236 struct inode_operations {
237 int (*create) (struct inode *,struct dentry *,int);
238 struct dentry * (*lookup) (struct inode *,struct dentry *);
239 + struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *);
240 int (*link) (struct dentry *,struct inode *,struct dentry *);
241 int (*unlink) (struct inode *,struct dentry *);
242 int (*symlink) (struct inode *,struct dentry *,const char *);
244 struct inode *, struct dentry *);
245 int (*readlink) (struct dentry *, char *,int);
246 int (*follow_link) (struct dentry *, struct nameidata *);
247 + int (*follow_link2) (struct dentry *, struct nameidata *,
248 + struct lookup_intent *it);
249 void (*truncate) (struct inode *);
250 int (*permission) (struct inode *, int);
251 int (*revalidate) (struct dentry *);
252 @@ -1046,6 +1052,7 @@
253 extern struct vfsmount *kern_mount(struct file_system_type *);
254 extern int may_umount(struct vfsmount *);
255 extern long do_mount(char *, char *, char *, unsigned long, void *);
256 +struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
257 extern void umount_tree(struct vfsmount *);
259 #define kern_umount mntput
260 @@ -1380,6 +1387,7 @@
261 extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
263 extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
264 +extern int FASTCALL(__user_walk_it(const char *, unsigned, struct nameidata *, struct lookup_intent *it));
265 extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
266 extern int FASTCALL(path_walk(const char *, struct nameidata *));
267 extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
268 @@ -1391,6 +1399,8 @@
269 extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
270 #define user_path_walk(name,nd) __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
271 #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
272 +#define user_path_walk_it(name,nd,it) __user_walk_it(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd, it)
273 +#define user_path_walk_link_it(name,nd,it) __user_walk_it(name, LOOKUP_POSITIVE, nd, it)
275 extern void inode_init_once(struct inode *);
276 extern void iput(struct inode *);
277 @@ -1491,6 +1501,8 @@
279 extern int vfs_readlink(struct dentry *, char *, int, const char *);
280 extern int vfs_follow_link(struct nameidata *, const char *);
281 +extern int vfs_follow_link_it(struct nameidata *, const char *,
282 + struct lookup_intent *it);
283 extern int page_readlink(struct dentry *, char *, int);
284 extern int page_follow_link(struct dentry *, struct nameidata *);
285 extern struct inode_operations page_symlink_inode_operations;
286 --- linux-2.4.18-17.8.0-uml-pristine/fs/dcache.c 2002-10-19 11:43:53.000000000 -0600
287 +++ linux-2.4.18-17.8.0-uml/fs/dcache.c 2002-10-31 13:10:34.000000000 -0700
290 list_del_init(&dentry->d_hash);
295 struct dentry *parent;
296 list_del(&dentry->d_child);
298 dentry->d_fsdata = NULL;
299 dentry->d_extra_attributes = NULL;
300 dentry->d_mounted = 0;
301 + dentry->d_it = NULL;
302 INIT_LIST_HEAD(&dentry->d_hash);
303 INIT_LIST_HEAD(&dentry->d_lru);
304 INIT_LIST_HEAD(&dentry->d_subdirs);
305 --- linux-2.4.18-17.8.0-uml-pristine/fs/nfsd/vfs.c 2002-10-19 11:43:53.000000000 -0600
306 +++ linux-2.4.18-17.8.0-uml/fs/nfsd/vfs.c 2002-10-19 11:44:51.000000000 -0600
307 @@ -1298,7 +1298,7 @@
311 - err = vfs_rename(fdir, odentry, tdir, ndentry);
312 + err = vfs_rename(fdir, odentry, tdir, ndentry, NULL);
314 if (!err && EX_ISSYNC(tfhp->fh_export)) {
315 nfsd_sync_dir(tdentry);
316 --- linux-2.4.18-17.8.0-uml-pristine/fs/namei.c 2002-10-19 11:43:53.000000000 -0600
317 +++ linux-2.4.18-17.8.0-uml/fs/namei.c 2002-11-02 01:02:26.000000000 -0700
326 * XEmacs seems to be relying on it...
329 +void intent_release(struct dentry *de, struct lookup_intent *it)
331 + if (de->d_op && de->d_op->d_intent_release)
332 + de->d_op->d_intent_release(de, it);
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 +271,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);
395 * Without that kind of total limit, nasty chains of consecutive
396 * symlinks can cause almost arbitrarily long lookups.
398 -static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
399 +static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd,
400 + struct lookup_intent *it)
403 if (current->link_count >= max_recursive_link)
404 @@ -348,10 +379,14 @@
405 current->link_count++;
406 current->total_link_count++;
407 UPDATE_ATIME(dentry->d_inode);
408 - err = dentry->d_inode->i_op->follow_link(dentry, nd);
409 + if (dentry->d_inode->i_op->follow_link2)
410 + err = dentry->d_inode->i_op->follow_link2(dentry, nd, it);
412 + err = dentry->d_inode->i_op->follow_link(dentry, nd);
413 current->link_count--;
416 + intent_release(dentry, it);
422 * We expect 'base' to be positive and a directory.
424 -int link_path_walk(const char * name, struct nameidata *nd)
425 +int link_path_walk_it(const char *name, struct nameidata *nd,
426 + struct lookup_intent *it)
428 struct dentry *dentry;
430 @@ -526,12 +562,12 @@
433 /* This does the actual lookups.. */
434 - dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
435 + dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
437 err = -EWOULDBLOCKIO;
440 - dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
441 + dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE, NULL);
442 err = PTR_ERR(dentry);
449 - if (inode->i_op->follow_link) {
450 - err = do_follow_link(dentry, nd);
451 + if (inode->i_op->follow_link || inode->i_op->follow_link2) {
452 + err = do_follow_link(dentry, nd, it);
460 - if (!inode->i_op->lookup)
461 + if (!inode->i_op->lookup && !inode->i_op->lookup2)
464 /* here ends the main loop */
465 @@ -592,12 +628,12 @@
469 - dentry = cached_lookup(nd->dentry, &this, 0);
470 + dentry = cached_lookup(nd->dentry, &this, 0, it);
472 err = -EWOULDBLOCKIO;
475 - dentry = real_lookup(nd->dentry, &this, 0);
476 + dentry = real_lookup(nd->dentry, &this, 0, it);
477 err = PTR_ERR(dentry);
482 inode = dentry->d_inode;
483 if ((lookup_flags & LOOKUP_FOLLOW)
484 - && inode && inode->i_op && inode->i_op->follow_link) {
485 - err = do_follow_link(dentry, nd);
486 + && inode && inode->i_op &&
487 + (inode->i_op->follow_link ||
488 + inode->i_op->follow_link2)) {
489 + err = do_follow_link(dentry, nd, it);
495 if (lookup_flags & LOOKUP_DIRECTORY) {
497 - if (!inode->i_op || !inode->i_op->lookup)
498 + if (!inode->i_op || (!inode->i_op->lookup &&
499 + !inode->i_op->lookup2))
503 @@ -663,10 +702,21 @@
507 +int link_path_walk(const char * name, struct nameidata *nd)
509 + return link_path_walk_it(name, nd, NULL);
512 +int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it)
514 + current->total_link_count = 0;
515 + return link_path_walk_it(name, nd, it);
518 int path_walk(const char * name, struct nameidata *nd)
520 current->total_link_count = 0;
521 - return link_path_walk(name, nd);
522 + return link_path_walk_it(name, nd, NULL);
530 +int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
531 + struct lookup_intent *it)
534 + if (path_init(path, flags, nd))
535 + error = path_walk_it(path, nd, it);
541 int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
545 * needs parent already locked. Doesn't follow mounts.
548 -struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
549 +struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
550 + struct lookup_intent *it)
552 struct dentry * dentry;
554 @@ -802,13 +864,16 @@
558 - dentry = cached_lookup(base, name, 0);
559 + dentry = cached_lookup(base, name, 0, it);
561 struct dentry *new = d_alloc(base, name);
562 dentry = ERR_PTR(-ENOMEM);
566 + if (inode->i_op->lookup2)
567 + dentry = inode->i_op->lookup2(inode, new, it);
569 dentry = inode->i_op->lookup(inode, new);
576 +struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
578 + return lookup_hash_it(name, base, NULL);
583 struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
587 this.hash = end_name_hash(hash);
589 - return lookup_hash(&this, base);
590 + return lookup_hash_it(&this, base, NULL);
592 return ERR_PTR(-EACCES);
598 +int __user_walk_it(const char *name, unsigned flags, struct nameidata *nd,
599 + struct lookup_intent *it)
604 + tmp = getname(name);
605 + err = PTR_ERR(tmp);
606 + if (!IS_ERR(tmp)) {
608 + if (path_init(tmp, flags, nd))
609 + err = path_walk_it(tmp, nd, it);
616 * It's inline, so penalty for filesystems that don't use sticky bit is
618 @@ -1010,7 +1098,8 @@
619 * for symlinks (where the permissions are checked later).
622 -int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
623 +int open_namei_it(const char *pathname, int flag, int mode,
624 + struct nameidata *nd, struct lookup_intent *it)
626 int acc_mode, error = 0;
628 @@ -1024,7 +1113,7 @@
629 * The simplest case - just a plain lookup.
631 if (!(flag & O_CREAT)) {
632 - error = path_lookup(pathname, lookup_flags(flag), nd);
633 + error = path_lookup_it(pathname, lookup_flags(flag), nd, it);
637 @@ -1034,6 +1123,10 @@
639 * Create - we need to know the parent.
642 + it->it_mode = mode;
643 + it->it_op |= IT_CREAT;
645 error = path_lookup(pathname, LOOKUP_PARENT, nd);
648 @@ -1049,7 +1142,7 @@
651 down(&dir->d_inode->i_sem);
652 - dentry = lookup_hash(&nd->last, nd->dentry);
653 + dentry = lookup_hash_it(&nd->last, nd->dentry, it);
656 error = PTR_ERR(dentry);
657 @@ -1058,6 +1151,7 @@
661 + it->it_mode = mode;
662 /* Negative dentry, just create the file */
663 if (!dentry->d_inode) {
664 error = vfs_create(dir->d_inode, dentry,
665 @@ -1091,7 +1185,8 @@
667 if (!dentry->d_inode)
669 - if (dentry->d_inode->i_op && dentry->d_inode->i_op->follow_link)
670 + if (dentry->d_inode->i_op && (dentry->d_inode->i_op->follow_link ||
671 + dentry->d_inode->i_op->follow_link2))
675 @@ -1177,8 +1272,10 @@
679 + intent_release(dentry, it);
682 + intent_release(nd->dentry, it);
686 @@ -1197,7 +1294,12 @@
687 * are done. Procfs-like symlinks just set LAST_BIND.
689 UPDATE_ATIME(dentry->d_inode);
690 - error = dentry->d_inode->i_op->follow_link(dentry, nd);
691 + if (dentry->d_inode->i_op->follow_link2)
692 + error = dentry->d_inode->i_op->follow_link2(dentry, nd, it);
694 + error = dentry->d_inode->i_op->follow_link(dentry, nd);
696 + intent_release(dentry, it);
700 @@ -1219,13 +1321,20 @@
703 down(&dir->d_inode->i_sem);
704 - dentry = lookup_hash(&nd->last, nd->dentry);
705 + dentry = lookup_hash_it(&nd->last, nd->dentry, NULL);
706 putname(nd->last.name);
710 +int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd)
712 + return open_namei_it(pathname, flag, mode, nd, NULL);
717 -static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
718 +static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
719 + struct lookup_intent *it)
721 struct dentry *dentry;
723 @@ -1233,7 +1342,7 @@
724 dentry = ERR_PTR(-EEXIST);
725 if (nd->last_type != LAST_NORM)
727 - dentry = lookup_hash(&nd->last, nd->dentry);
728 + dentry = lookup_hash_it(&nd->last, nd->dentry, it);
731 if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
732 @@ -1279,6 +1388,7 @@
734 struct dentry * dentry;
736 + struct lookup_intent it = { .it_op = IT_MKNOD, .it_mode = mode };
740 @@ -1289,7 +1399,7 @@
741 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
744 - dentry = lookup_create(&nd, 0);
745 + dentry = lookup_create(&nd, 0, &it);
746 error = PTR_ERR(dentry);
748 mode &= ~current->fs->umask;
749 @@ -1307,6 +1417,7 @@
753 + intent_release(dentry, &it);
756 up(&nd.dentry->d_inode->i_sem);
757 @@ -1347,6 +1458,7 @@
761 + struct lookup_intent it = { .it_op = IT_MKDIR, .it_mode = mode };
763 tmp = getname(pathname);
764 error = PTR_ERR(tmp);
765 @@ -1357,11 +1469,12 @@
766 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
769 - dentry = lookup_create(&nd, 1);
770 + dentry = lookup_create(&nd, 1, &it);
771 error = PTR_ERR(dentry);
772 if (!IS_ERR(dentry)) {
773 error = vfs_mkdir(nd.dentry->d_inode, dentry,
774 mode & ~current->fs->umask);
775 + intent_release(dentry, &it);
778 up(&nd.dentry->d_inode->i_sem);
779 @@ -1445,6 +1558,7 @@
781 struct dentry *dentry;
783 + struct lookup_intent it = { .it_op = IT_RMDIR };
785 name = getname(pathname);
787 @@ -1466,10 +1580,11 @@
790 down(&nd.dentry->d_inode->i_sem);
791 - dentry = lookup_hash(&nd.last, nd.dentry);
792 + dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
793 error = PTR_ERR(dentry);
794 if (!IS_ERR(dentry)) {
795 error = vfs_rmdir(nd.dentry->d_inode, dentry);
796 + intent_release(dentry, &it);
799 up(&nd.dentry->d_inode->i_sem);
800 @@ -1513,6 +1628,7 @@
802 struct dentry *dentry;
804 + struct lookup_intent it = { .it_op = IT_UNLINK };
806 name = getname(pathname);
808 @@ -1525,7 +1641,7 @@
809 if (nd.last_type != LAST_NORM)
811 down(&nd.dentry->d_inode->i_sem);
812 - dentry = lookup_hash(&nd.last, nd.dentry);
813 + dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
814 error = PTR_ERR(dentry);
815 if (!IS_ERR(dentry)) {
816 /* Why not before? Because we want correct error value */
817 @@ -1533,6 +1649,7 @@
819 error = vfs_unlink(nd.dentry->d_inode, dentry);
821 + intent_release(dentry, &it);
824 up(&nd.dentry->d_inode->i_sem);
825 @@ -1579,6 +1696,7 @@
829 + struct lookup_intent it = { .it_op = IT_SYMLINK };
831 from = getname(oldname);
833 @@ -1592,10 +1710,12 @@
834 error = path_lookup(to, LOOKUP_PARENT, &nd);
837 - dentry = lookup_create(&nd, 0);
839 + dentry = lookup_create(&nd, 0, &it);
840 error = PTR_ERR(dentry);
841 if (!IS_ERR(dentry)) {
842 error = vfs_symlink(nd.dentry->d_inode, dentry, from);
843 + intent_release(dentry, &it);
846 up(&nd.dentry->d_inode->i_sem);
847 @@ -1660,6 +1780,7 @@
851 + struct lookup_intent it = { .it_op = IT_LINK };
853 to = getname(newname);
855 @@ -1667,7 +1788,7 @@
856 struct dentry *new_dentry;
857 struct nameidata nd, old_nd;
859 - error = __user_walk(oldname, LOOKUP_POSITIVE, &old_nd);
860 + error = __user_walk_it(oldname, LOOKUP_POSITIVE, &old_nd, &it);
863 error = path_lookup(to, LOOKUP_PARENT, &nd);
864 @@ -1676,10 +1797,12 @@
866 if (old_nd.mnt != nd.mnt)
868 - new_dentry = lookup_create(&nd, 0);
869 + it.it_op = IT_LINK2;
870 + new_dentry = lookup_create(&nd, 0, &it);
871 error = PTR_ERR(new_dentry);
872 if (!IS_ERR(new_dentry)) {
873 error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
874 + intent_release(new_dentry, &it);
877 up(&nd.dentry->d_inode->i_sem);
878 @@ -1720,7 +1843,8 @@
881 int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
882 - struct inode *new_dir, struct dentry *new_dentry)
883 + struct inode *new_dir, struct dentry *new_dentry,
884 + struct lookup_intent *it)
887 struct inode *target;
888 @@ -1778,6 +1902,7 @@
891 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
892 + intent_release(new_dentry, it);
895 target->i_flags |= S_DEAD;
896 @@ -1799,7 +1924,8 @@
899 int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
900 - struct inode *new_dir, struct dentry *new_dentry)
901 + struct inode *new_dir, struct dentry *new_dentry,
902 + struct lookup_intent *it)
906 @@ -1830,6 +1956,7 @@
909 error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
910 + intent_release(new_dentry, it);
911 double_up(&old_dir->i_zombie, &new_dir->i_zombie);
914 @@ -1841,13 +1968,14 @@
917 int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
918 - struct inode *new_dir, struct dentry *new_dentry)
919 + struct inode *new_dir, struct dentry *new_dentry,
920 + struct lookup_intent *it)
923 if (S_ISDIR(old_dentry->d_inode->i_mode))
924 - error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry);
925 + error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry,it);
927 - error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry);
928 + error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry,it);
930 if (old_dir == new_dir)
931 inode_dir_notify(old_dir, DN_RENAME);
932 @@ -1864,6 +1992,7 @@
934 struct dentry * old_dir, * new_dir;
935 struct dentry * old_dentry, *new_dentry;
936 + struct lookup_intent it = { .it_op = IT_RENAME };
937 struct nameidata oldnd, newnd;
939 error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
940 @@ -1889,7 +2018,7 @@
942 double_lock(new_dir, old_dir);
944 - old_dentry = lookup_hash(&oldnd.last, old_dir);
945 + old_dentry = lookup_hash_it(&oldnd.last, old_dir, &it);
946 error = PTR_ERR(old_dentry);
947 if (IS_ERR(old_dentry))
949 @@ -1905,18 +2034,21 @@
950 if (newnd.last.name[newnd.last.len])
953 - new_dentry = lookup_hash(&newnd.last, new_dir);
954 + it.it_op = IT_RENAME2;
955 + new_dentry = lookup_hash_it(&newnd.last, new_dir, &it);
956 error = PTR_ERR(new_dentry);
957 if (IS_ERR(new_dentry))
961 error = vfs_rename(old_dir->d_inode, old_dentry,
962 - new_dir->d_inode, new_dentry);
963 + new_dir->d_inode, new_dentry, &it);
966 + intent_release(new_dentry, NULL);
969 + intent_release(old_dentry, &it);
972 double_up(&new_dir->d_inode->i_sem, &old_dir->d_inode->i_sem);
973 @@ -1965,7 +2097,8 @@
977 -__vfs_follow_link(struct nameidata *nd, const char *link)
978 +__vfs_follow_link(struct nameidata *nd, const char *link,
979 + struct lookup_intent *it)
983 @@ -1978,7 +2111,7 @@
984 /* weird __emul_prefix() stuff did it */
987 - res = link_path_walk(link, nd);
988 + res = link_path_walk_it(link, nd, it);
990 if (current->link_count || res || nd->last_type!=LAST_NORM)
992 @@ -2000,7 +2133,13 @@
994 int vfs_follow_link(struct nameidata *nd, const char *link)
996 - return __vfs_follow_link(nd, link);
997 + return __vfs_follow_link(nd, link, NULL);
1000 +int vfs_follow_link_it(struct nameidata *nd, const char *link,
1001 + struct lookup_intent *it)
1003 + return __vfs_follow_link(nd, link, it);
1006 /* get the link contents into pagecache */
1007 @@ -2042,7 +2181,7 @@
1009 struct page *page = NULL;
1010 char *s = page_getlink(dentry, &page);
1011 - int res = __vfs_follow_link(nd, s);
1012 + int res = __vfs_follow_link(nd, s, NULL);
1015 page_cache_release(page);
1016 --- linux-2.4.18-17.8.0-uml-pristine/fs/open.c 2002-10-19 11:43:53.000000000 -0600
1017 +++ linux-2.4.18-17.8.0-uml/fs/open.c 2002-10-19 11:44:51.000000000 -0600
1019 #include <asm/uaccess.h>
1021 #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
1022 +extern int path_walk_it(const char *name, struct nameidata *nd,
1023 + struct lookup_intent *it);
1024 +extern void intent_release(struct dentry *de, struct lookup_intent *it);
1026 int vfs_statfs(struct super_block *sb, struct statfs *buf)
1028 @@ -118,12 +121,13 @@
1029 struct nameidata nd;
1030 struct inode * inode;
1032 + struct lookup_intent it = { .it_op = IT_SETATTR };
1035 if (length < 0) /* sorry, but loff_t says... */
1038 - error = user_path_walk(path, &nd);
1039 + error = user_path_walk_it(path, &nd, &it);
1042 inode = nd.dentry->d_inode;
1044 put_write_access(inode);
1047 + intent_release(nd.dentry, &it);
1052 struct nameidata nd;
1053 struct inode * inode;
1054 struct iattr newattrs;
1055 + struct lookup_intent it = { .it_op = IT_SETATTR };
1057 - error = user_path_walk(filename, &nd);
1058 + error = user_path_walk_it(filename, &nd, &it);
1061 inode = nd.dentry->d_inode;
1064 error = notify_change(nd.dentry, &newattrs);
1066 + intent_release(nd.dentry, &it);
1071 struct nameidata nd;
1072 struct inode * inode;
1073 struct iattr newattrs;
1074 + struct lookup_intent it = { .it_op = IT_SETATTR };
1076 - error = user_path_walk(filename, &nd);
1077 + error = user_path_walk_it(filename, &nd, &it);
1083 error = notify_change(nd.dentry, &newattrs);
1085 + intent_release(nd.dentry, &it);
1090 int old_fsuid, old_fsgid;
1091 kernel_cap_t old_cap;
1093 + struct lookup_intent it = { .it_op = IT_GETATTR };
1095 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
1097 @@ -364,13 +374,14 @@
1099 current->cap_effective = current->cap_permitted;
1101 - res = user_path_walk(filename, &nd);
1102 + res = user_path_walk_it(filename, &nd, &it);
1104 res = permission(nd.dentry->d_inode, mode);
1105 /* SuS v2 requires we report a read only fs too */
1106 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
1107 && !special_file(nd.dentry->d_inode->i_mode))
1109 + intent_release(nd.dentry, &it);
1113 @@ -385,8 +396,11 @@
1116 struct nameidata nd;
1117 + struct lookup_intent it = { .it_op = IT_GETATTR };
1119 - error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd);
1120 + error = __user_walk_it(filename,
1121 + LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,
1127 set_fs_pwd(current->fs, nd.mnt, nd.dentry);
1130 + intent_release(nd.dentry, &it);
1134 @@ -436,9 +451,10 @@
1137 struct nameidata nd;
1138 + struct lookup_intent it = { .it_op = IT_GETATTR };
1140 - error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
1141 - LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
1142 + error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
1143 + LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
1151 + intent_release(nd.dentry, &it);
1156 struct inode * inode;
1158 struct iattr newattrs;
1159 + struct lookup_intent it = { .it_op = IT_SETATTR };
1161 - error = user_path_walk(filename, &nd);
1162 + error = user_path_walk_it(filename, &nd, &it);
1165 inode = nd.dentry->d_inode;
1167 error = notify_change(nd.dentry, &newattrs);
1170 + intent_release(nd.dentry, &it);
1174 @@ -588,10 +607,12 @@
1176 struct nameidata nd;
1178 + struct lookup_intent it = { .it_op = IT_SETATTR };
1180 - error = user_path_walk(filename, &nd);
1181 + error = user_path_walk_it(filename, &nd, &it);
1183 error = chown_common(nd.dentry, user, group);
1184 + intent_release(nd.dentry, &it);
1188 @@ -601,10 +622,12 @@
1190 struct nameidata nd;
1192 + struct lookup_intent it = { .it_op = IT_SETATTR };
1194 - error = user_path_walk_link(filename, &nd);
1195 + error = user_path_walk_link_it(filename, &nd, &it);
1197 error = chown_common(nd.dentry, user, group);
1198 + intent_release(nd.dentry, &it);
1202 @@ -638,10 +661,16 @@
1203 * for the internal routines (ie open_namei()/follow_link() etc). 00 is
1206 +extern int open_namei_it(const char *filename, int namei_flags, int mode,
1207 + struct nameidata *nd, struct lookup_intent *it);
1208 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
1209 + int flags, struct lookup_intent *it);
1211 struct file *filp_open(const char * filename, int flags, int mode)
1213 int namei_flags, error;
1214 struct nameidata nd;
1215 + struct lookup_intent it = { .it_op = IT_OPEN };
1217 namei_flags = flags;
1218 if ((namei_flags+1) & O_ACCMODE)
1219 @@ -649,18 +678,19 @@
1220 if (namei_flags & O_TRUNC)
1223 - error = open_namei(filename, namei_flags, mode, &nd);
1225 - return dentry_open(nd.dentry, nd.mnt, flags);
1226 + error = open_namei_it(filename, namei_flags, mode, &nd, &it);
1228 + return ERR_PTR(error);
1230 - return ERR_PTR(error);
1231 + return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
1234 extern ssize_t do_readahead(struct file *file, unsigned long index, unsigned long nr);
1235 /* for files over a certains size it doesn't pay to do readahead on open */
1236 #define READAHEAD_CUTOFF 48000
1238 -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1239 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
1240 + int flags, struct lookup_intent *it)
1243 struct inode *inode;
1245 do_readahead(f, 0, (48 * 1024) >> PAGE_SHIFT);
1248 + intent_release(dentry, it);
1252 @@ -725,11 +756,17 @@
1256 + intent_release(dentry, it);
1259 return ERR_PTR(error);
1262 +struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1264 + return dentry_open_it(dentry, mnt, flags, NULL);
1268 * Find an empty file descriptor entry, and mark it busy.
1270 --- linux-2.4.18-17.8.0-uml-pristine/fs/stat.c 2002-10-19 11:43:53.000000000 -0600
1271 +++ linux-2.4.18-17.8.0-uml/fs/stat.c 2002-10-19 11:44:51.000000000 -0600
1274 #include <asm/uaccess.h>
1276 +extern void intent_release(struct dentry *de, struct lookup_intent *it);
1278 * Revalidate the inode. This is required for proper NFS attribute caching.
1280 @@ -104,10 +105,12 @@
1282 struct nameidata nd;
1284 + struct lookup_intent it = { .it_op = IT_GETATTR };
1286 - error = user_path_walk(name, &nd);
1287 + error = user_path_walk_it(name, &nd, &it);
1289 error = do_getattr(nd.mnt, nd.dentry, stat);
1290 + intent_release(nd.dentry, &it);
1294 @@ -117,10 +120,12 @@
1296 struct nameidata nd;
1298 + struct lookup_intent it = { .it_op = IT_GETATTR };
1300 - error = user_path_walk_link(name, &nd);
1301 + error = user_path_walk_link_it(name, &nd, &it);
1303 error = do_getattr(nd.mnt, nd.dentry, stat);
1304 + intent_release(nd.dentry, &it);
1308 --- linux-2.4.18-17.8.0-uml-pristine/mm/slab.c 2002-10-19 11:43:54.000000000 -0600
1309 +++ linux-2.4.18-17.8.0-uml/mm/slab.c 2002-10-19 11:44:51.000000000 -0600
1310 @@ -1208,6 +1208,59 @@
1311 * Called with the cache-lock held.
1314 +extern struct page *check_get_page(unsigned long kaddr);
1315 +struct page *page_mem_map(struct page *page);
1316 +static int kmem_check_cache_obj (kmem_cache_t * cachep,
1317 + slab_t *slabp, void * objp)
1320 + unsigned int objnr;
1323 + if (cachep->flags & SLAB_RED_ZONE) {
1324 + objp -= BYTES_PER_WORD;
1325 + if ( *(unsigned long *)objp != RED_MAGIC2)
1326 + /* Either write before start, or a double free. */
1328 + if (*(unsigned long *)(objp+cachep->objsize -
1329 + BYTES_PER_WORD) != RED_MAGIC2)
1330 + /* Either write past end, or a double free. */
1335 + objnr = (objp-slabp->s_mem)/cachep->objsize;
1336 + if (objnr >= cachep->num)
1338 + if (objp != slabp->s_mem + objnr*cachep->objsize)
1341 + /* Check slab's freelist to see if this obj is there. */
1342 + for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) {
1350 +int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
1352 + struct page *page = check_get_page((unsigned long)objp);
1354 + if (!VALID_PAGE(page))
1357 + if (!PageSlab(page))
1360 + /* XXX check for freed slab objects ? */
1361 + if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp))
1364 + return (cachep == GET_PAGE_CACHE(page));
1368 static int kmem_extra_free_checks (kmem_cache_t * cachep,
1369 slab_t *slabp, void * objp)