int do_check_pgt_cache(int low, int high)
{
int freed = 0;
---- lum-pristine/mm/slab.c Fri Dec 21 12:42:05 2001
-+++ lum/mm/slab.c Thu Aug 1 18:07:35 2002
-@@ -1187,6 +1187,57 @@
- * Called with the cache-lock held.
- */
-
-+extern struct page *check_get_page(unsigned long kaddr);
-+struct page *page_mem_map(struct page *page);
-+static int kmem_check_cache_obj (kmem_cache_t * cachep,
-+ slab_t *slabp, void * objp)
-+{
-+ int i;
-+ unsigned int objnr;
-+
-+ if (cachep->flags & SLAB_RED_ZONE) {
-+ objp -= BYTES_PER_WORD;
-+ if ( *(unsigned long *)objp != RED_MAGIC2)
-+ /* Either write before start, or a double free. */
-+ return 0;
-+ if (*(unsigned long *)(objp+cachep->objsize -
-+ BYTES_PER_WORD) != RED_MAGIC2)
-+ /* Either write past end, or a double free. */
-+ return 0;
-+ }
-+
-+ objnr = (objp-slabp->s_mem)/cachep->objsize;
-+ if (objnr >= cachep->num)
-+ return 0;
-+ if (objp != slabp->s_mem + objnr*cachep->objsize)
-+ return 0;
-+
-+ /* Check slab's freelist to see if this obj is there. */
-+ for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) {
-+ if (i == objnr)
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+
-+int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
-+{
-+ struct page *page = check_get_page((unsigned long)objp);
-+
-+ if (!VALID_PAGE(page))
-+ return 0;
-+
-+ if (!PageSlab(page))
-+ return 0;
-+
-+ /* XXX check for freed slab objects ? */
-+ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp))
-+ return 0;
-+
-+ return (cachep == GET_PAGE_CACHE(page));
-+}
-+
- #if DEBUG
- static int kmem_extra_free_checks (kmem_cache_t * cachep,
- slab_t *slabp, void * objp)
--- lum-pristine/drivers/block/blkpg.c Mon Feb 25 14:37:57 2002
+++ lum/drivers/block/blkpg.c Thu Aug 1 18:07:35 2002
@@ -294,3 +294,38 @@
+void dev_set_rdonly(kdev_t dev, int no_write)
+{
+ if (dev) {
-+ printk(KERN_WARNING "Turning device %s read-only\n",
++ printk(KERN_WARNING "Turning device %s read-only\n",
+ bdevname(dev));
+ dev_no_write[no_write] = 0xdead0000 + dev;
+ }
/*
* Obtain a new handle.
*
-@@ -228,13 +243,10 @@
+@@ -227,14 +242,11 @@
+ handle->h_ref++;
return handle;
}
-
+-
- handle = jbd_kmalloc(sizeof (handle_t), GFP_NOFS);
++
+ handle = get_handle(nblocks);
if (!handle)
return ERR_PTR(-ENOMEM);
current->journal_info = handle;
err = start_this_handle(journal, handle);
-@@ -334,13 +346,10 @@
+@@ -333,14 +345,11 @@
+
if (is_journal_aborted(journal))
return ERR_PTR(-EIO);
-
+-
- handle = jbd_kmalloc(sizeof (handle_t), GFP_NOFS);
++
+ handle = get_handle(nblocks);
if (!handle)
return ERR_PTR(-ENOMEM);
* All done for a particular handle.
*
* There is not much action needed here. We just return any remaining
-@@ -1393,6 +1425,9 @@
+@@ -1383,7 +1415,10 @@
wake_up(&journal->j_wait_transaction_locked);
}
+- /*
+ /* Move callbacks from the handle to the transaction. */
+ list_splice(&handle->h_jcb, &transaction->t_jcb);
+
- /*
++ /*
* If the handle is marked SYNC, we need to set another commit
* going! We also want to force a commit if the current
+ * transaction is occupying too much of the log, or if the
--- lum-pristine/include/linux/blkdev.h Mon Nov 26 08:29:17 2001
+++ lum/include/linux/blkdev.h Mon Aug 12 11:48:39 2002
@@ -228,4 +228,8 @@
EXPORT_SYMBOL(dentry_open);
--- lum-pristine/include/linux/dcache.h Thu Nov 22 14:46:18 2001
+++ lum/include/linux/dcache.h Mon Aug 12 00:02:29 2002
-@@ -6,6 +6,34 @@
+@@ -6,6 +6,33 @@
#include <asm/atomic.h>
#include <linux/mount.h>
+#define IT_GETATTR (1<<10)
+#define IT_SETATTR (1<<11)
+#define IT_READLINK (1<<12)
-+#define IT_MKNOD (1<<13)
-+#define IT_LOOKUP (1<<14)
++#define IT_MKNOD (1<<13)
++#define IT_LOOKUP (1<<14)
+
-+/* it_op MUST be first, or all of the initializing code will break */
-+struct lookup_intent {
++struct lookup_intent {
+ int it_op;
+ int it_mode;
+ int it_disposition;
-+ int it_status;
++ int it_status;
+ struct iattr *it_iattr;
+ __u64 it_lock_handle[2];
+ int it_lock_mode;
/*
* linux/include/linux/dcache.h
*
-@@ -79,17 +107,20 @@
+@@ -78,6 +106,7 @@
+ unsigned long d_time; /* used by d_revalidate */
struct dentry_operations *d_op;
struct super_block * d_sb; /* The root of the dentry tree */
- unsigned long d_vfs_flags;
+ struct lookup_intent *d_it;
+ unsigned long d_vfs_flags;
void * d_fsdata; /* fs-specific data */
unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
- };
-
- struct dentry_operations {
- int (*d_revalidate)(struct dentry *, int);
-+ int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
- int (*d_hash) (struct dentry *, struct qstr *);
- int (*d_compare) (struct dentry *, struct qstr *, struct qstr *);
+@@ -91,6 +119,8 @@
int (*d_delete)(struct dentry *);
void (*d_release)(struct dentry *);
void (*d_iput)(struct dentry *, struct inode *);
++ int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
+ void (*d_intent_release)(struct dentry *);
};
extern int vfs_unlink(struct inode *, struct dentry *);
-extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
+int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
-+ struct inode *new_dir, struct dentry *new_dentry,
++ struct inode *new_dir, struct dentry *new_dentry,
+ struct lookup_intent *it);
/*
* XEmacs seems to be relying on it...
*/
-+void intent_release(struct dentry *de)
++void intent_release(struct dentry *de)
+{
+ if (de->d_op && de->d_op->d_intent_release)
+ de->d_op->d_intent_release(de);
* SMP-safe
*/
-static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags)
-+static struct dentry *cached_lookup(struct dentry *parent, struct qstr * name,
++static struct dentry *cached_lookup(struct dentry *parent, struct qstr *name,
+ int flags, struct lookup_intent *it)
{
struct dentry * dentry = d_lookup(parent, name);
+ dput(dentry);
+ dentry = NULL;
+ }
-+ return dentry;
-+ } else
++ return dentry;
++ } else
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
dput(dentry);
result = ERR_PTR(-ENOMEM);
if (dentry) {
lock_kernel();
-+ if (dir->i_op->lookup2)
++ if (dir->i_op->lookup2)
+ result = dir->i_op->lookup2(dir, dentry, it);
-+ else
++ else
result = dir->i_op->lookup(dir, dentry);
unlock_kernel();
if (result)
* We expect 'base' to be positive and a directory.
*/
-int link_path_walk(const char * name, struct nameidata *nd)
-+int link_path_walk_it(const char * name, struct nameidata *nd,
++int link_path_walk_it(const char *name, struct nameidata *nd,
+ struct lookup_intent *it)
{
struct dentry *dentry;
if (lookup_flags & LOOKUP_DIRECTORY) {
err = -ENOTDIR;
- if (!inode->i_op || !inode->i_op->lookup)
-+ if (!inode->i_op || (!inode->i_op->lookup &&
++ if (!inode->i_op || (!inode->i_op->lookup &&
+ !inode->i_op->lookup2))
break;
}
/* SMP-safe */
/* returns 1 if everything is done */
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
+@@ -707,6 +738,17 @@
+ }
+
+ /* SMP-safe */
++int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
++ struct lookup_intent *it)
++{
++ int error = 0;
++ if (path_init(path, flags, nd))
++ error = path_walk_it(path, nd, it);
++ return error;
++}
++
++
++/* SMP-safe */
+ int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
+ {
+ int error = 0;
@@ -742,7 +786,8 @@
* needs parent already locked. Doesn't follow mounts.
* SMP-safe.
*/
-struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
-+struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
++struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
+ struct lookup_intent *it)
{
struct dentry * dentry;
if (!new)
goto out;
lock_kernel();
-+ if (inode->i_op->lookup2)
++ if (inode->i_op->lookup2)
+ dentry = inode->i_op->lookup2(inode, new, it);
-+ else
++ else
dentry = inode->i_op->lookup(inode, new);
unlock_kernel();
if (!dentry)
* SMP-safe
*/
-int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
-+int open_namei_it(const char * pathname, int flag, int mode,
++int open_namei_it(const char *pathname, int flag, int mode,
+ struct nameidata *nd, struct lookup_intent *it)
{
int acc_mode, error = 0;
struct inode *inode;
-@@ -984,17 +1056,23 @@
+@@ -984,17 +1056,22 @@
* The simplest case - just a plain lookup.
*/
if (!(flag & O_CREAT)) {
-+
if (path_init(pathname, lookup_flags(flag), nd))
- error = path_walk(pathname, nd);
+ error = path_walk_it(pathname, nd, it);
return 0;
exit_dput:
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
exit:
-+ intent_release(nd->dentry);
++ intent_release(nd->dentry);
path_release(nd);
return error;
UPDATE_ATIME(dentry->d_inode);
error = dentry->d_inode->i_op->follow_link(dentry, nd);
+ if (error)
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
if (error)
return error;
goto do_last;
}
-+int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
++int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd)
+{
-+ return open_namei_it(pathname, flag, mode, nd, NULL);
++ return open_namei_it(pathname, flag, mode, nd, NULL);
+}
+
+
/* SMP-safe */
-static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
-+static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
++static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
+ struct lookup_intent *it)
{
struct dentry *dentry;
char * tmp;
struct dentry * dentry;
struct nameidata nd;
-+ struct lookup_intent it = { IT_MKNOD, mode };
++ struct lookup_intent it = { .it_op = IT_MKNOD, .it_mode = mode };
if (S_ISDIR(mode))
return -EPERM;
default:
error = -EINVAL;
}
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
{
int error = 0;
char * tmp;
-+ struct lookup_intent it = { IT_MKDIR, mode };
++ struct lookup_intent it = { .it_op = IT_MKDIR, .it_mode = mode };
tmp = getname(pathname);
error = PTR_ERR(tmp);
+ dentry->d_it = ⁢
error = vfs_mkdir(nd.dentry->d_inode, dentry,
mode & ~current->fs->umask);
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
char * name;
struct dentry *dentry;
struct nameidata nd;
-+ struct lookup_intent it = { IT_RMDIR, 0 };
++ struct lookup_intent it = { .it_op = IT_RMDIR };
name = getname(pathname);
if(IS_ERR(name))
+ dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
-+ dentry->d_it = ⁢
++ dentry->d_it = ⁢
error = vfs_rmdir(nd.dentry->d_inode, dentry);
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
char * name;
struct dentry *dentry;
struct nameidata nd;
-+ struct lookup_intent it = { IT_UNLINK, 0 };
++ struct lookup_intent it = { .it_op = IT_UNLINK };
name = getname(pathname);
if(IS_ERR(name))
goto slashes;
error = vfs_unlink(nd.dentry->d_inode, dentry);
exit2:
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
int error = 0;
char * from;
char * to;
-+ struct lookup_intent it = { IT_SYMLINK, 0 };
++ struct lookup_intent it = { .it_op = IT_SYMLINK };
from = getname(oldname);
if(IS_ERR(from))
if (!IS_ERR(dentry)) {
+ dentry->d_it = ⁢
error = vfs_symlink(nd.dentry->d_inode, dentry, from);
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
int error;
char * from;
char * to;
-+ struct lookup_intent it = { IT_LINK, 0 };
++ struct lookup_intent it = { .it_op = IT_LINK };
from = getname(oldname);
if(IS_ERR(from))
if (!IS_ERR(new_dentry)) {
+ new_dentry->d_it = ⁢
error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
-+ intent_release(new_dentry);
++ intent_release(new_dentry);
dput(new_dentry);
}
up(&nd.dentry->d_inode->i_sem);
error = -EBUSY;
else
error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
-+ intent_release(new_dentry);
++ intent_release(new_dentry);
if (target) {
if (!error)
target->i_flags |= S_DEAD;
int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
- struct inode *new_dir, struct dentry *new_dentry)
-+ struct inode *new_dir, struct dentry *new_dentry,
++ struct inode *new_dir, struct dentry *new_dentry,
+ struct lookup_intent *it)
{
int error;
error = -EBUSY;
else
error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
-+ intent_release(new_dentry);
++ intent_release(new_dentry);
double_up(&old_dir->i_zombie, &new_dir->i_zombie);
if (error)
return error;
int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
- struct inode *new_dir, struct dentry *new_dentry)
-+ struct inode *new_dir, struct dentry *new_dentry,
++ struct inode *new_dir, struct dentry *new_dentry,
+ struct lookup_intent *it)
{
int error;
if (S_ISDIR(old_dentry->d_inode->i_mode))
- error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry);
-+ error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry, it);
++ error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry,it);
else
- error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry);
-+ error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry, it);
++ error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry,it);
if (!error) {
if (old_dir == new_dir)
inode_dir_notify(old_dir, DN_RENAME);
-@@ -1841,6 +1957,7 @@
+@@ -1840,6 +1956,7 @@
+ int error = 0;
struct dentry * old_dir, * new_dir;
struct dentry * old_dentry, *new_dentry;
++ struct lookup_intent it = { .it_op = IT_RENAME };
struct nameidata oldnd, newnd;
-+ struct lookup_intent it = {IT_RENAME, 0};
if (path_init(oldname, LOOKUP_PARENT, &oldnd))
- error = path_walk(oldname, &oldnd);
-@@ -1868,7 +1985,9 @@
+@@ -1868,7 +1985,7 @@
double_lock(new_dir, old_dir);
- old_dentry = lookup_hash(&oldnd.last, old_dir);
-+ it.it_op = IT_RENAME;
-+ it.it_mode = 0;
+ old_dentry = lookup_hash_it(&oldnd.last, old_dir, &it);
error = PTR_ERR(old_dentry);
if (IS_ERR(old_dentry))
#include <asm/uaccess.h>
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
-+extern int path_walk_it(const char * name, struct nameidata *nd,
++extern int path_walk_it(const char *name, struct nameidata *nd,
+ struct lookup_intent *it);
+extern void intent_release(struct dentry *de);
struct nameidata nd;
struct inode * inode;
int error;
-+ struct lookup_intent it = { IT_SETATTR };
++ struct lookup_intent it = { .it_op = IT_SETATTR };
error = -EINVAL;
if (length < 0) /* sorry, but loff_t says... */
struct nameidata nd;
struct inode * inode;
struct iattr newattrs;
-+ struct lookup_intent it = { IT_SETATTR };
++ struct lookup_intent it = { .it_op = IT_SETATTR };
- error = user_path_walk(filename, &nd);
+ error = user_path_walk_it(filename, &nd, &it);
struct nameidata nd;
struct inode * inode;
struct iattr newattrs;
-+ struct lookup_intent it = { IT_SETATTR };
++ struct lookup_intent it = { .it_op = IT_SETATTR };
- error = user_path_walk(filename, &nd);
+ error = user_path_walk_it(filename, &nd, &it);
int old_fsuid, old_fsgid;
kernel_cap_t old_cap;
int res;
-+ struct lookup_intent it = { IT_GETATTR };
++ struct lookup_intent it = { .it_op = IT_GETATTR };
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
int error;
struct nameidata nd;
char *name;
-+ struct lookup_intent it = { IT_GETATTR };
++ struct lookup_intent it = { .it_op = IT_GETATTR };
name = getname(filename);
error = PTR_ERR(name);
int error;
struct nameidata nd;
char *name;
-+ struct lookup_intent it = { IT_GETATTR };
++ struct lookup_intent it = { .it_op = IT_GETATTR };
name = getname(filename);
error = PTR_ERR(name);
path_init(name, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
- error = path_walk(name, &nd);
-+ error = path_walk_it(name, &nd, &it);
++ error = path_walk_it(name, &nd, &it);
putname(name);
if (error)
goto out;
path_release(&nd);
out:
return error;
-@@ -490,12 +510,13 @@
+@@ -490,12 +510,14 @@
struct inode * inode;
int error;
struct iattr newattrs;
--
++ struct lookup_intent it = { .it_op = IT_SETATTR };
+
- error = user_path_walk(filename, &nd);
-+ struct lookup_intent it = { IT_SETATTR };
+ error = user_path_walk_it(filename, &nd, &it);
if (error)
goto out;
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = { IT_SETATTR };
++ struct lookup_intent it = { .it_op = IT_SETATTR };
- error = user_path_walk(filename, &nd);
+ error = user_path_walk_it(filename, &nd, &it);
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = { IT_SETATTR };
++ struct lookup_intent it = { .it_op = IT_SETATTR };
- error = user_path_walk_link(filename, &nd);
+ error = user_path_walk_link_it(filename, &nd, &it);
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
*/
-+extern int open_namei_it(const char *filename, int namei_flags, int mode,
++extern int open_namei_it(const char *filename, int namei_flags, int mode,
+ struct nameidata *nd, struct lookup_intent *it);
+struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
+ int flags, struct lookup_intent *it);
{
int namei_flags, error;
struct nameidata nd;
-+ struct lookup_intent it = {IT_OPEN, 0};
++ struct lookup_intent it = { .it_op = IT_OPEN };
namei_flags = flags;
if ((namei_flags+1) & O_ACCMODE)
- return dentry_open(nd.dentry, nd.mnt, flags);
+ error = open_namei_it(filename, namei_flags, mode, &nd, &it);
+ if (error)
-+ return ERR_PTR(error);
++ return ERR_PTR(error);
- return ERR_PTR(error);
-+ return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
++ return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
}
-struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-+ intent_release(dentry);
++ intent_release(dentry);
return f;
cleanup_all:
*/
--- lum-pristine/fs/stat.c Thu Sep 13 19:04:43 2001
+++ lum/fs/stat.c Mon Aug 12 00:04:39 2002
+@@ -13,6 +13,7 @@
+
+ #include <asm/uaccess.h>
+
++extern void intent_release(struct dentry *de);
+ /*
+ * Revalidate the inode. This is required for proper NFS attribute caching.
+ */
@@ -135,13 +135,15 @@
asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
{
struct nameidata nd;
-+ struct lookup_intent it = {IT_GETATTR, 0};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
int error;
- error = user_path_walk(filename, &nd);
asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
{
struct nameidata nd;
-+ struct lookup_intent it = {IT_GETATTR, 0};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
int error;
- error = user_path_walk(filename, &nd);
asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
{
struct nameidata nd;
-+ struct lookup_intent it = {IT_GETATTR, 0};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
int error;
- error = user_path_walk_link(filename, &nd);
asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
{
struct nameidata nd;
-+ struct lookup_intent it = {IT_GETATTR, 0};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
int error;
- error = user_path_walk_link(filename, &nd);
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = { IT_READLINK };
++ struct lookup_intent it = { .it_op = IT_READLINK };
if (bufsiz <= 0)
return -EINVAL;
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = {IT_GETATTR};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
- error = user_path_walk(filename, &nd);
+ error = user_path_walk_it(filename, &nd, &it);
error = do_revalidate(nd.dentry);
if (!error)
error = cp_new_stat64(nd.dentry->d_inode, statbuf);
-+ intent_release(nd.dentry);
++ intent_release(nd.dentry);
path_release(&nd);
}
return error;
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = { IT_GETATTR};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
- error = user_path_walk_link(filename, &nd);
+ error = user_path_walk_link_it(filename, &nd, &it);
error = do_revalidate(nd.dentry);
if (!error)
error = cp_new_stat64(nd.dentry->d_inode, statbuf);
-+ intent_release(nd.dentry);
++ intent_release(nd.dentry);
path_release(&nd);
}
return error;
{
struct file * f;
int err = -EBADF;
-+ struct lookup_intent it = { IT_GETATTR };
++ struct lookup_intent it = { .it_op = IT_GETATTR };
f = fget(fd);
if (f) {
+--- lum-pristine/mm/slab.c Fri Dec 21 12:42:05 2001
++++ lum/mm/slab.c Thu Aug 1 18:07:35 2002
+@@ -1187,6 +1187,59 @@
+ * Called with the cache-lock held.
+ */
+
++extern struct page *check_get_page(unsigned long kaddr);
++struct page *page_mem_map(struct page *page);
++static int kmem_check_cache_obj (kmem_cache_t * cachep,
++ slab_t *slabp, void * objp)
++{
++ int i;
++ unsigned int objnr;
++
++#if DEBUG
++ if (cachep->flags & SLAB_RED_ZONE) {
++ objp -= BYTES_PER_WORD;
++ if ( *(unsigned long *)objp != RED_MAGIC2)
++ /* Either write before start, or a double free. */
++ return 0;
++ if (*(unsigned long *)(objp+cachep->objsize -
++ BYTES_PER_WORD) != RED_MAGIC2)
++ /* Either write past end, or a double free. */
++ return 0;
++ }
++#endif
++
++ objnr = (objp-slabp->s_mem)/cachep->objsize;
++ if (objnr >= cachep->num)
++ return 0;
++ if (objp != slabp->s_mem + objnr*cachep->objsize)
++ return 0;
++
++ /* Check slab's freelist to see if this obj is there. */
++ for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) {
++ if (i == objnr)
++ return 0;
++ }
++ return 1;
++}
++
++
++int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
++{
++ struct page *page = check_get_page((unsigned long)objp);
++
++ if (!VALID_PAGE(page))
++ return 0;
++
++ if (!PageSlab(page))
++ return 0;
++
++ /* XXX check for freed slab objects ? */
++ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp))
++ return 0;
++
++ return (cachep == GET_PAGE_CACHE(page));
++}
++
+ #if DEBUG
+ static int kmem_extra_free_checks (kmem_cache_t * cachep,
+ slab_t *slabp, void * objp)
+--- linux-2.4.18-lustre12-pristine/arch/ia64/mm/init.c Wed Jun 26 00:15:21 2002
++++ linux-2.4.18-lustre12/arch/ia64/mm/init.c Tue Aug 13 11:13:09 2002
+@@ -37,6 +37,12 @@
+
+ static unsigned long totalram_pages;
+
++struct page *check_get_page(unsigned long kaddr)
++{
++#warning FIXME: Lustre team, is this solid?
++ return virt_to_page(kaddr);
++}
++
+ int
+ do_check_pgt_cache (int low, int high)
+ {
+--- linux-2.4.18-lustre12-pristine/arch/i386/mm/init.c Wed Jun 26 00:15:21 2002
++++ linux-2.4.18-lustre12/arch/i386/mm/init.c Tue Aug 13 11:13:09 2002
+@@ -43,6 +43,12 @@
+ static unsigned long totalram_pages;
+ static unsigned long totalhigh_pages;
+
++struct page *check_get_page(unsigned long kaddr)
++{
++#warning FIXME: Lustre team, is this solid?
++ return virt_to_page(kaddr);
++}
++
+ int do_check_pgt_cache(int low, int high)
+ {
+ int freed = 0;
--- linux-2.4.18-lustre12-pristine/drivers/block/blkpg.c Tue May 7 20:33:10 2002
+++ linux-2.4.18-lustre12/drivers/block/blkpg.c Tue Aug 13 11:13:08 2002
@@ -295,3 +295,38 @@
+void dev_set_rdonly(kdev_t dev, int no_write)
+{
+ if (dev) {
-+ printk(KERN_WARNING "Turning device %s read-only\n",
++ printk(KERN_WARNING "Turning device %s read-only\n",
+ bdevname(dev));
+ dev_no_write[no_write] = 0xdead0000 + dev;
+ }
* transaction is occupying too much of the log, or if the
--- linux-2.4.18-lustre12-pristine/include/linux/blkdev.h Wed Jun 26 00:16:30 2002
+++ linux-2.4.18-lustre12/include/linux/blkdev.h Tue Aug 13 11:13:08 2002
-@@ -276,4 +276,9 @@
- }
+@@ -228,4 +228,8 @@
return retval;
}
-+
+
+#define CONFIG_DEV_RDONLY
+void dev_set_rdonly(kdev_t, int);
+int dev_check_rdonly(kdev_t);
+void dev_clear_rdonly(int);
#endif
+--- linux-2.4.18-lustre12-pristine/include/linux/slab.h Wed Jun 26 00:16:34 2002
++++ linux-2.4.18-lustre12/include/linux/slab.h Tue Aug 13 11:13:09 2002
+@@ -57,6 +57,7 @@
+ extern int kmem_cache_shrink(kmem_cache_t *);
+ extern void *kmem_cache_alloc(kmem_cache_t *, int);
+ extern void kmem_cache_free(kmem_cache_t *, void *);
++extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp);
+
+ extern void *kmalloc(size_t, int);
+ extern void kfree(const void *);
--- linux-2.4.18-lustre12-pristine/include/linux/jbd.h Tue May 7 19:43:17 2002
+++ linux-2.4.18-lustre12/include/linux/jbd.h Tue Aug 13 11:13:08 2002
@@ -257,6 +257,13 @@
extern void journal_unlock_updates (journal_t *);
--- linux-2.4.18-lustre12-pristine/kernel/ksyms.c Wed Jun 26 00:16:38 2002
+++ linux-2.4.18-lustre12/kernel/ksyms.c Tue Aug 13 11:13:08 2002
-@@ -306,6 +306,13 @@
+@@ -306,6 +306,12 @@
EXPORT_SYMBOL(lock_may_write);
EXPORT_SYMBOL(dcache_readdir);
+/* lustre */
+EXPORT_SYMBOL(panic_notifier_list);
+EXPORT_SYMBOL(pagecache_lock_cacheline);
-+EXPORT_SYMBOL(kmem_cache_validate);
+EXPORT_SYMBOL(do_kern_mount);
-+
++EXPORT_SYMBOL(kmem_cache_validate);
+
/* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */
EXPORT_SYMBOL(default_llseek);
+#define IT_MKNOD (1<<13)
+#define IT_LOOKUP (1<<14)
+
-+struct lookup_intent {
++struct lookup_intent {
+ int it_op;
+ int it_mode;
+ int it_disposition;
-+ int it_status;
++ int it_status;
+ struct iattr *it_iattr;
+ __u64 it_lock_handle[2];
+ int it_lock_mode;
unsigned long d_time; /* used by d_revalidate */
struct dentry_operations *d_op;
struct super_block * d_sb; /* The root of the dentry tree */
-+ struct lookup_intent *d_it;
++ struct lookup_intent *d_it;
unsigned long d_vfs_flags;
void * d_fsdata; /* fs-specific data */
void * d_extra_attributes; /* TUX-specific data */
void (*d_release)(struct dentry *);
void (*d_iput)(struct dentry *, struct inode *);
+ int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *);
-+ void (*d_intent_release)(struct dentry *);
++ void (*d_intent_release)(struct dentry *);
};
/* the dentry parameter passed to d_hash and d_compare is the parent
/* needed for tty driver, and maybe others */
void *private_data;
-+ struct lookup_intent *f_intent;
++ struct lookup_intent *f_intent;
/* preallocated helper kiobuf to speedup O_DIRECT */
struct kiobuf *f_iobuf;
extern int vfs_unlink(struct inode *, struct dentry *);
-extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
+int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
-+ struct inode *new_dir, struct dentry *new_dentry,
++ struct inode *new_dir, struct dentry *new_dentry,
+ struct lookup_intent *it);
/*
struct inode_operations {
int (*create) (struct inode *,struct dentry *,int);
struct dentry * (*lookup) (struct inode *,struct dentry *);
-+ struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *);
++ struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *);
int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
int (*symlink) (struct inode *,struct dentry *,const char *);
* XEmacs seems to be relying on it...
*/
-+void intent_release(struct dentry *de)
++void intent_release(struct dentry *de)
+{
+ if (de->d_op && de->d_op->d_intent_release)
+ de->d_op->d_intent_release(de);
+ dput(dentry);
+ dentry = NULL;
+ }
-+ return dentry;
++ return dentry;
+ } else
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
result = ERR_PTR(-ENOMEM);
if (dentry) {
lock_kernel();
-+ if (dir->i_op->lookup2)
++ if (dir->i_op->lookup2)
+ result = dir->i_op->lookup2(dir, dentry, it);
-+ else
++ else
result = dir->i_op->lookup(dir, dentry);
unlock_kernel();
if (result)
-@@ -322,6 +343,13 @@
+@@ -321,6 +342,12 @@
+ dput(result);
result = ERR_PTR(-ENOENT);
}
- }
-+ else if (result->d_op && result->d_op->d_revalidate2) {
++ } else if (result->d_op && result->d_op->d_revalidate2) {
+ if (!result->d_op->d_revalidate2(result, flags, it) &&
+ !d_invalidate(result)) {
+ dput(result);
+ result = ERR_PTR(-ENOENT);
+ }
-+ }
+ }
return result;
}
-
@@ -447,7 +475,8 @@
*
* We expect 'base' to be positive and a directory.
if (lookup_flags & LOOKUP_DIRECTORY) {
err = -ENOTDIR;
- if (!inode->i_op || !inode->i_op->lookup)
-+ if (!inode->i_op || (!inode->i_op->lookup &&
++ if (!inode->i_op || (!inode->i_op->lookup &&
+ !inode->i_op->lookup2))
break;
}
}
/* SMP-safe */
-+int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
++int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
+ struct lookup_intent *it)
+{
+ int error = 0;
* SMP-safe.
*/
-struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
-+struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
++struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base,
+ struct lookup_intent *it)
{
struct dentry * dentry;
if (!new)
goto out;
lock_kernel();
-+ if (inode->i_op->lookup2)
++ if (inode->i_op->lookup2)
+ dentry = inode->i_op->lookup2(inode, new, it);
-+ else
++ else
dentry = inode->i_op->lookup(inode, new);
unlock_kernel();
if (!dentry)
* Create - we need to know the parent.
*/
+ if (it) {
-+ it->it_mode = mode;
-+ it->it_op |= IT_CREAT;
-+ }
++ it->it_mode = mode;
++ it->it_op |= IT_CREAT;
++ }
error = path_lookup(pathname, LOOKUP_PARENT, nd);
if (error)
return error;
}
+ dentry->d_it = it;
-+ dentry->d_it->it_mode = mode;
++ dentry->d_it->it_mode = mode;
/* Negative dentry, just create the file */
if (!dentry->d_inode) {
error = vfs_create(dir->d_inode, dentry,
+ intent_release(dentry);
dput(dentry);
exit:
-+ intent_release(nd->dentry);
++ intent_release(nd->dentry);
path_release(nd);
return error;
UPDATE_ATIME(dentry->d_inode);
error = dentry->d_inode->i_op->follow_link(dentry, nd);
+ if (error)
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
if (error)
return error;
+int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd)
+{
-+ return open_namei_it(pathname, flag, mode, nd, NULL);
++ return open_namei_it(pathname, flag, mode, nd, NULL);
+}
+
+
/* SMP-safe */
-static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
-+static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
++static struct dentry *lookup_create(struct nameidata *nd, int is_dir,
+ struct lookup_intent *it)
{
struct dentry *dentry;
default:
error = -EINVAL;
}
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
+ dentry->d_it = ⁢
error = vfs_mkdir(nd.dentry->d_inode, dentry,
mode & ~current->fs->umask);
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
+ dentry = lookup_hash_it(&nd.last, nd.dentry, &it);
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
-+ dentry->d_it = ⁢
++ dentry->d_it = ⁢
error = vfs_rmdir(nd.dentry->d_inode, dentry);
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
goto slashes;
error = vfs_unlink(nd.dentry->d_inode, dentry);
exit2:
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
if (!IS_ERR(dentry)) {
+ dentry->d_it = ⁢
error = vfs_symlink(nd.dentry->d_inode, dentry, from);
-+ intent_release(dentry);
++ intent_release(dentry);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
*/
int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
- struct inode *new_dir, struct dentry *new_dentry)
-+ struct inode *new_dir, struct dentry *new_dentry,
-+ struct lookup_intent *it)
++ struct inode *new_dir, struct dentry *new_dentry,
++ struct lookup_intent *it)
{
int error;
struct inode *target;
int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
- struct inode *new_dir, struct dentry *new_dentry)
-+ struct inode *new_dir, struct dentry *new_dentry,
-+ struct lookup_intent *it)
++ struct inode *new_dir, struct dentry *new_dentry,
++ struct lookup_intent *it)
{
int error;
error = PTR_ERR(old_dentry);
if (IS_ERR(old_dentry))
goto exit3;
-@@ -1899,14 +2027,15 @@
+@@ -1899,18 +2027,21 @@
if (newnd.last.name[newnd.last.len])
goto exit4;
}
+ new_dir->d_inode, new_dentry, &it);
unlock_kernel();
++ intent_release(new_dentry);
dput(new_dentry);
+ exit4:
++ intent_release(old_dentry);
+ dput(old_dentry);
+ exit3:
+ double_up(&new_dir->d_inode->i_sem, &old_dir->d_inode->i_sem);
--- linux-2.4.18-lustre12-pristine/fs/open.c Wed Jun 26 00:16:14 2002
+++ linux-2.4.18-lustre12/fs/open.c Tue Aug 13 11:19:36 2002
-@@ -19,6 +19,8 @@
+@@ -19,6 +19,9 @@
#include <asm/uaccess.h>
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
-+extern int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it);
++extern int path_walk_it(const char *name, struct nameidata *nd,
++ struct lookup_intent *it);
+extern void intent_release(struct dentry *de);
int vfs_statfs(struct super_block *sb, struct statfs *buf)
path_release(&nd);
}
-@@ -384,11 +397,13 @@
+@@ -384,11 +397,15 @@
{
int error;
struct nameidata nd;
--
-- error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd);
+ struct lookup_intent it = { .it_op = IT_GETATTR };
-+
-+ error = __user_walk_it(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd, &it);
+
+- error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd);
++ error = __user_walk_it(filename,
++ LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,
++ &nd, &it);
if (error)
goto out;
path_release(&nd);
}
return error;
-@@ -637,10 +665,15 @@
+@@ -637,10 +665,16 @@
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
*/
-+extern int open_namei_it(const char *filename, int namei_flags, int mode,
++extern int open_namei_it(const char *filename, int namei_flags, int mode,
+ struct nameidata *nd, struct lookup_intent *it);
-+struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it);
++struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
++ int flags, struct lookup_intent *it);
+
struct file *filp_open(const char * filename, int flags, int mode)
{
namei_flags = flags;
if ((namei_flags+1) & O_ACCMODE)
-@@ -648,14 +681,14 @@
+@@ -648,14 +681,15 @@
if (namei_flags & O_TRUNC)
namei_flags |= 2;
- return dentry_open(nd.dentry, nd.mnt, flags);
+ error = open_namei_it(filename, namei_flags, mode, &nd, &it);
+ if (error)
-+ return ERR_PTR(error);
++ return ERR_PTR(error);
- return ERR_PTR(error);
-+ return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
++ return dentry_open_it(nd.dentry, nd.mnt, flags, &it);
}
-struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
-+struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it)
++struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
++ int flags, struct lookup_intent *it)
{
struct file * f;
struct inode *inode;
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-+ intent_release(dentry);
++ intent_release(dentry);
return f;
cleanup_all:
-@@ -712,11 +746,19 @@
+@@ -712,11 +746,17 @@
cleanup_file:
put_filp(f);
cleanup_dentry:
+struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
+{
+ return dentry_open_it(dentry, mnt, flags, NULL);
-+
+}
+
-+
/*
* Find an empty file descriptor entry, and mark it busy.
*/
--- linux-2.4.18-lustre12-pristine/fs/stat.c Tue May 7 19:40:30 2002
+++ linux-2.4.18-lustre12/fs/stat.c Tue Aug 13 11:13:09 2002
-@@ -13,6 +13,8 @@
+@@ -13,6 +13,7 @@
#include <asm/uaccess.h>
-+
+extern void intent_release(struct dentry *de);
/*
* Revalidate the inode. This is required for proper NFS attribute caching.
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = { IT_GETATTR};
++ struct lookup_intent it = { .it_op = IT_GETATTR };
- error = user_path_walk(name, &nd);
+ error = user_path_walk_it(name, &nd, &it);
path_release(&nd);
}
return error;
-@@ -117,10 +121,13 @@
+@@ -117,10 +121,12 @@
{
struct nameidata nd;
int error;
-+ struct lookup_intent it = { IT_GETATTR};
-+
++ struct lookup_intent it = { .it_op = IT_GETATTR };
- error = user_path_walk_link(name, &nd);
+ error = user_path_walk_link_it(name, &nd, &it);
return error;
--- linux-2.4.18-lustre12-pristine/mm/slab.c Wed Jun 26 00:16:40 2002
+++ linux-2.4.18-lustre12/mm/slab.c Tue Aug 13 11:13:09 2002
-@@ -1207,6 +1207,58 @@
+@@ -1207,6 +1207,59 @@
* Called with the cache-lock held.
*/
+{
+ int i;
+ unsigned int objnr;
++
+#if DEBUG
+ if (cachep->flags & SLAB_RED_ZONE) {
+ objp -= BYTES_PER_WORD;
+
+int kmem_cache_validate(kmem_cache_t *cachep, void *objp)
+{
-+ struct page *page = check_get_page((unsigned long)objp);
++ struct page *page = check_get_page((unsigned long)objp);
+
+ if (!VALID_PAGE(page))
+ return 0;
+ if (!PageSlab(page))
+ return 0;
+
-+ /* XXX check for freed slab objects ? */
-+ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp))
++ /* XXX check for freed slab objects ? */
++ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp))
+ return 0;
+
+ return (cachep == GET_PAGE_CACHE(page));
#if DEBUG
static int kmem_extra_free_checks (kmem_cache_t * cachep,
slab_t *slabp, void * objp)
---- linux-2.4.18-lustre12-pristine/arch/i386/mm/init.c Wed Jun 26 00:15:21 2002
-+++ linux-2.4.18-lustre12/arch/i386/mm/init.c Tue Aug 13 11:13:09 2002
-@@ -43,6 +43,14 @@
- static unsigned long totalram_pages;
- static unsigned long totalhigh_pages;
-
-+
-+struct page *check_get_page(unsigned long kaddr)
-+{
-+#warning FIXME: Lustre team, is this solid enough?
-+ return virt_to_page(kaddr);
-+}
-+
-+
- int do_check_pgt_cache(int low, int high)
- {
- int freed = 0;
---- linux-2.4.18-lustre12-pristine/include/linux/slab.h Wed Jun 26 00:16:34 2002
-+++ linux-2.4.18-lustre12/include/linux/slab.h Tue Aug 13 11:13:09 2002
-@@ -57,6 +57,7 @@
- extern int kmem_cache_shrink(kmem_cache_t *);
- extern void *kmem_cache_alloc(kmem_cache_t *, int);
- extern void kmem_cache_free(kmem_cache_t *, void *);
-+extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp);
-
- extern void *kmalloc(size_t, int);
- extern void kfree(const void *);
--- linux-2.4.18-lustre12-pristine/scripts/mkspec Wed Jun 26 00:16:49 2002
+++ linux-2.4.18-lustre12/scripts/mkspec Tue Aug 13 11:13:09 2002
@@ -64,6 +64,7 @@