#endif /* _I386_PAGE_H */
--- lum-pristine/include/linux/blkdev.h Mon Nov 26 06:29:17 2001
-+++ lum/include/linux/blkdev.h Sat Jun 15 00:34:24 2002
++++ lum/include/linux/blkdev.h Thu Jun 20 10:18:40 2002
@@ -228,4 +228,8 @@
return retval;
}
+void dev_clear_rdonly(int);
#endif
--- lum-pristine/include/linux/slab.h Fri Dec 21 10:42:04 2001
-+++ lum/include/linux/slab.h Sat Jun 15 00:34:24 2002
++++ lum/include/linux/slab.h Thu Jun 20 10:18:35 2002
@@ -57,6 +57,7 @@
extern int kmem_cache_shrink(kmem_cache_t *);
extern void *kmem_cache_alloc(kmem_cache_t *, int);
extern void *kmalloc(size_t, int);
extern void kfree(const void *);
--- lum-pristine/include/linux/jbd.h Mon Feb 25 12:38:13 2002
-+++ lum/include/linux/jbd.h Sat Jun 15 00:36:15 2002
++++ lum/include/linux/jbd.h Thu Jun 20 10:19:02 2002
@@ -249,6 +249,13 @@
return bh->b_private;
}
EXPORT_SYMBOL(default_llseek);
EXPORT_SYMBOL(dentry_open);
--- lum-pristine/include/linux/dcache.h Thu Nov 22 12:46:18 2001
-+++ lum/include/linux/dcache.h Fri Jun 14 16:50:42 2002
-@@ -6,6 +6,31 @@
++++ lum/include/linux/dcache.h Thu Jun 20 10:18:35 2002
+@@ -6,6 +6,32 @@
#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)
+
+struct lookup_intent {
+ int it_op;
/*
* linux/include/linux/dcache.h
*
-@@ -79,17 +104,20 @@
+@@ -79,17 +105,20 @@
struct dentry_operations *d_op;
struct super_block * d_sb; /* The root of the dentry tree */
unsigned long d_vfs_flags;
/* the dentry parameter passed to d_hash and d_compare is the parent
--- lum-pristine/include/linux/fs.h Thu Jun 13 14:07:26 2002
-+++ lum/include/linux/fs.h Sat Jun 15 00:34:24 2002
++++ lum/include/linux/fs.h Thu Jun 20 10:18:35 2002
@@ -536,6 +536,7 @@
/* needed for tty driver, and maybe others */
extern void iput(struct inode *);
extern void force_delete(struct inode *);
--- lum-pristine/fs/namei.c Mon Feb 25 12:38:09 2002
-+++ lum/fs/namei.c Wed Jun 12 19:18:36 2002
++++ lum/fs/namei.c Thu Jun 20 10:16:35 2002
@@ -94,6 +94,14 @@
* XEmacs seems to be relying on it...
*/
break;
}
goto return_base;
-@@ -636,12 +662,24 @@
+@@ -626,6 +652,7 @@
+ else if (this.len == 2 && this.name[1] == '.')
+ nd->last_type = LAST_DOTDOT;
+ return_base:
++ nd->dentry->d_it = it;
+ return 0;
+ out_dput:
+ dput(dentry);
+@@ -633,15 +660,29 @@
+ }
+ path_release(nd);
+ return_err:
++ if (!err)
++ nd->dentry->d_it = it;
return err;
}
/* SMP-safe */
/* returns 1 if everything is done */
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
-@@ -742,7 +780,8 @@
+@@ -742,7 +783,8 @@
* needs parent already locked. Doesn't follow mounts.
* SMP-safe.
*/
{
struct dentry * dentry;
struct inode *inode;
-@@ -765,13 +804,16 @@
+@@ -765,13 +807,16 @@
goto out;
}
dentry = inode->i_op->lookup(inode, new);
unlock_kernel();
if (!dentry)
-@@ -783,6 +825,12 @@
+@@ -783,6 +828,12 @@
return dentry;
}
/* SMP-safe */
struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
{
-@@ -804,7 +852,7 @@
+@@ -804,7 +855,7 @@
}
this.hash = end_name_hash(hash);
access:
return ERR_PTR(-EACCES);
}
-@@ -836,6 +884,22 @@
+@@ -836,6 +887,22 @@
return err;
}
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -970,7 +1034,8 @@
+@@ -970,7 +1037,8 @@
* for symlinks (where the permissions are checked later).
* SMP-safe
*/
{
int acc_mode, error = 0;
struct inode *inode;
-@@ -984,8 +1049,9 @@
+@@ -984,17 +1052,21 @@
* The simplest case - just a plain lookup.
*/
if (!(flag & O_CREAT)) {
if (error)
return error;
dentry = nd->dentry;
-@@ -995,6 +1061,8 @@
++ dentry->d_it = it;
+ goto ok;
+ }
+
/*
* Create - we need to know the parent.
*/
if (path_init(pathname, LOOKUP_PARENT, nd))
error = path_walk(pathname, nd);
if (error)
-@@ -1011,7 +1079,7 @@
+@@ -1011,7 +1083,7 @@
dir = nd->dentry;
down(&dir->d_inode->i_sem);
do_last:
error = PTR_ERR(dentry);
-@@ -1022,6 +1090,7 @@
+@@ -1020,6 +1092,7 @@
+ goto exit;
+ }
++ dentry->d_it = it;
/* Negative dentry, just create the file */
if (!dentry->d_inode) {
-+ dentry->d_it = it;
error = vfs_create(dir->d_inode, dentry,
- mode & ~current->fs->umask);
- up(&dir->d_inode->i_sem);
-@@ -1181,13 +1250,20 @@
+@@ -1136,9 +1209,11 @@
+ if (flag & FMODE_WRITE)
+ DQUOT_INIT(inode);
+
++ intent_release(dentry);
+ return 0;
+
+ exit_dput:
++ intent_release(dentry);
+ dput(dentry);
+ exit:
+ path_release(nd);
+@@ -1181,13 +1256,20 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
{
struct dentry *dentry;
-@@ -1195,7 +1271,7 @@
+@@ -1195,7 +1277,7 @@
dentry = ERR_PTR(-EEXIST);
if (nd->last_type != LAST_NORM)
goto fail;
if (IS_ERR(dentry))
goto fail;
if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
-@@ -1241,6 +1317,7 @@
+@@ -1241,6 +1323,7 @@
char * tmp;
struct dentry * dentry;
struct nameidata nd;
-+ struct lookup_intent it = { IT_CREAT , mode };
++ struct lookup_intent it = { IT_MKNOD , mode };
if (S_ISDIR(mode))
return -EPERM;
-@@ -1252,11 +1329,12 @@
+@@ -1252,11 +1335,12 @@
error = path_walk(tmp, &nd);
if (error)
goto out;
switch (mode & S_IFMT) {
case 0: case S_IFREG:
error = vfs_create(nd.dentry->d_inode,dentry,mode);
-@@ -1272,6 +1350,7 @@
+@@ -1272,6 +1356,7 @@
}
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
-@@ -1310,6 +1389,7 @@
+@@ -1310,6 +1395,7 @@
{
int error = 0;
char * tmp;
tmp = getname(pathname);
error = PTR_ERR(tmp);
-@@ -1321,13 +1401,15 @@
+@@ -1321,13 +1407,15 @@
error = path_walk(tmp, &nd);
if (error)
goto out;
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
-@@ -1407,6 +1489,7 @@
+@@ -1407,6 +1495,7 @@
char * name;
struct dentry *dentry;
struct nameidata nd;
name = getname(pathname);
if(IS_ERR(name))
-@@ -1429,10 +1512,12 @@
+@@ -1429,10 +1518,12 @@
goto exit1;
}
down(&nd.dentry->d_inode->i_sem);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
-@@ -1476,6 +1561,7 @@
+@@ -1476,6 +1567,7 @@
char * name;
struct dentry *dentry;
struct nameidata nd;
name = getname(pathname);
if(IS_ERR(name))
-@@ -1489,14 +1575,16 @@
+@@ -1489,14 +1581,16 @@
if (nd.last_type != LAST_NORM)
goto exit1;
down(&nd.dentry->d_inode->i_sem);
dput(dentry);
}
up(&nd.dentry->d_inode->i_sem);
-@@ -1543,6 +1631,7 @@
+@@ -1543,6 +1637,7 @@
int error = 0;
char * from;
char * to;
from = getname(oldname);
if(IS_ERR(from))
-@@ -1557,12 +1646,14 @@
+@@ -1557,12 +1652,14 @@
error = path_walk(to, &nd);
if (error)
goto out;
up(&nd.dentry->d_inode->i_sem);
path_release(&nd);
out:
-@@ -1626,6 +1717,7 @@
+@@ -1626,6 +1723,7 @@
int error;
char * from;
char * to;
from = getname(oldname);
if(IS_ERR(from))
-@@ -1648,12 +1740,14 @@
+@@ -1648,12 +1746,14 @@
error = -EXDEV;
if (old_nd.mnt != nd.mnt)
goto out_release;
up(&nd.dentry->d_inode->i_sem);
out_release:
path_release(&nd);
-@@ -1694,7 +1788,8 @@
+@@ -1694,7 +1794,8 @@
* locking].
*/
int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
struct inode *target;
-@@ -1748,12 +1843,14 @@
+@@ -1748,12 +1849,14 @@
} else
double_down(&old_dir->i_zombie,
&new_dir->i_zombie);
if (target) {
if (!error)
target->i_flags |= S_DEAD;
-@@ -1775,7 +1872,8 @@
+@@ -1775,7 +1878,8 @@
}
int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
{
int error;
-@@ -1802,10 +1900,12 @@
+@@ -1802,10 +1906,12 @@
DQUOT_INIT(old_dir);
DQUOT_INIT(new_dir);
double_down(&old_dir->i_zombie, &new_dir->i_zombie);
double_up(&old_dir->i_zombie, &new_dir->i_zombie);
if (error)
return error;
-@@ -1817,13 +1917,14 @@
+@@ -1817,13 +1923,14 @@
}
int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (!error) {
if (old_dir == new_dir)
inode_dir_notify(old_dir, DN_RENAME);
-@@ -1841,6 +1942,7 @@
+@@ -1841,6 +1948,7 @@
struct dentry * old_dir, * new_dir;
struct dentry * old_dentry, *new_dentry;
struct nameidata oldnd, newnd;
if (path_init(oldname, LOOKUP_PARENT, &oldnd))
error = path_walk(oldname, &oldnd);
-@@ -1868,7 +1970,9 @@
+@@ -1868,7 +1976,9 @@
double_lock(new_dir, old_dir);
error = PTR_ERR(old_dentry);
if (IS_ERR(old_dentry))
goto exit3;
-@@ -1884,14 +1988,15 @@
+@@ -1884,14 +1994,15 @@
if (newnd.last.name[newnd.last.len])
goto exit4;
}
dput(new_dentry);
--- lum-pristine/fs/open.c Fri Oct 12 14:48:42 2001
-+++ lum/fs/open.c Fri Jun 7 12:49:14 2002
++++ lum/fs/open.c Thu Jun 20 10:14:37 2002
@@ -19,6 +19,8 @@
#include <asm/uaccess.h>
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
-@@ -339,7 +360,7 @@
+@@ -339,13 +360,14 @@
else
current->cap_effective = current->cap_permitted;
if (!res) {
res = permission(nd.dentry->d_inode, mode);
/* SuS v2 requires we report a read only fs too */
-@@ -361,6 +382,9 @@
+ if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
+ && !special_file(nd.dentry->d_inode->i_mode))
+ res = -EROFS;
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+
+@@ -361,6 +383,9 @@
int error;
struct nameidata nd;
char *name;
name = getname(filename);
error = PTR_ERR(name);
-@@ -369,11 +393,12 @@
+@@ -369,11 +394,12 @@
error = 0;
if (path_init(name,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd))
error = permission(nd.dentry->d_inode,MAY_EXEC);
if (error)
goto dput_and_out;
-@@ -381,6 +406,7 @@
+@@ -381,6 +407,7 @@
set_fs_pwd(current->fs, nd.mnt, nd.dentry);
dput_and_out:
path_release(&nd);
out:
return error;
-@@ -421,6 +447,9 @@
+@@ -421,6 +448,9 @@
int error;
struct nameidata nd;
char *name;
name = getname(filename);
error = PTR_ERR(name);
-@@ -429,11 +458,12 @@
+@@ -429,11 +459,12 @@
path_init(name, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
error = permission(nd.dentry->d_inode,MAY_EXEC);
if (error)
goto dput_and_out;
-@@ -446,6 +476,7 @@
+@@ -446,6 +477,7 @@
set_fs_altroot();
error = 0;
dput_and_out:
path_release(&nd);
out:
return error;
-@@ -490,12 +521,15 @@
+@@ -490,12 +522,15 @@
struct inode * inode;
int error;
struct iattr newattrs;
error = -EROFS;
if (IS_RDONLY(inode))
goto dput_and_out;
-@@ -511,6 +545,7 @@
+@@ -511,6 +546,7 @@
error = notify_change(nd.dentry, &newattrs);
dput_and_out:
path_release(&nd);
out:
return error;
-@@ -580,10 +615,15 @@
+@@ -580,10 +616,15 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -593,10 +633,15 @@
+@@ -593,10 +634,15 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -630,10 +675,15 @@
+@@ -630,10 +676,15 @@
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
*/
namei_flags = flags;
if ((namei_flags+1) & O_ACCMODE)
-@@ -641,14 +691,14 @@
+@@ -641,14 +692,14 @@
if (namei_flags & O_TRUNC)
namei_flags |= 2;
{
struct file * f;
struct inode *inode;
-@@ -690,6 +740,7 @@
+@@ -690,6 +741,7 @@
goto cleanup_all;
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
return f;
-@@ -710,6 +761,13 @@
+@@ -705,11 +757,19 @@
+ cleanup_file:
+ put_filp(f);
+ cleanup_dentry:
++ intent_release(dentry);
+ dput(dentry);
+ mntput(mnt);
return ERR_PTR(error);
}
* Find an empty file descriptor entry, and mark it busy.
*/
--- lum-pristine/fs/stat.c Thu Sep 13 17:04:43 2001
-+++ lum/fs/stat.c Fri Jun 7 12:49:14 2002
-@@ -247,14 +247,16 @@
++++ lum/fs/stat.c Thu Jun 20 10:13:18 2002
+@@ -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};
+ int error;
+
+- error = user_path_walk(filename, &nd);
++ error = user_path_walk_it(filename, &nd, &it);
+ if (!error) {
+ error = do_revalidate(nd.dentry);
+ if (!error)
+ error = cp_old_stat(nd.dentry->d_inode, statbuf);
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -151,13 +153,15 @@
+ asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
+ {
+ struct nameidata nd;
++ struct lookup_intent it = {IT_GETATTR, 0};
+ int error;
+
+- error = user_path_walk(filename, &nd);
++ error = user_path_walk_it(filename, &nd, &it);
+ if (!error) {
+ error = do_revalidate(nd.dentry);
+ if (!error)
+ error = cp_new_stat(nd.dentry->d_inode, statbuf);
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -172,13 +176,15 @@
+ asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
+ {
+ struct nameidata nd;
++ struct lookup_intent it = {IT_GETATTR, 0};
+ int error;
+
+- error = user_path_walk_link(filename, &nd);
++ error = user_path_walk_link_it(filename, &nd, &it);
+ if (!error) {
+ error = do_revalidate(nd.dentry);
+ if (!error)
+ error = cp_old_stat(nd.dentry->d_inode, statbuf);
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -189,13 +195,15 @@
+ asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
+ {
+ struct nameidata nd;
++ struct lookup_intent it = {IT_GETATTR, 0};
+ int error;
+
+- error = user_path_walk_link(filename, &nd);
++ error = user_path_walk_link_it(filename, &nd, &it);
+ if (!error) {
+ error = do_revalidate(nd.dentry);
+ if (!error)
+ error = cp_new_stat(nd.dentry->d_inode, statbuf);
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -247,20 +255,22 @@
{
struct nameidata nd;
int error;
if (!error) {
struct inode * inode = nd.dentry->d_inode;
-
-+ nd.dentry->d_it = ⁢
error = -EINVAL;
if (inode->i_op && inode->i_op->readlink &&
!(error = do_revalidate(nd.dentry))) {
-@@ -333,9 +335,12 @@
+ UPDATE_ATIME(inode);
+ error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
+ }
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -333,12 +343,15 @@
{
struct nameidata nd;
int error;
- error = user_path_walk(filename, &nd);
+ error = user_path_walk_it(filename, &nd, &it);
if (!error) {
-+ nd.dentry->d_it = ⁢
error = do_revalidate(nd.dentry);
if (!error)
error = cp_new_stat64(nd.dentry->d_inode, statbuf);
-@@ -348,9 +353,12 @@
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -348,12 +361,15 @@
{
struct nameidata nd;
int error;
- error = user_path_walk_link(filename, &nd);
+ error = user_path_walk_link_it(filename, &nd, &it);
if (!error) {
-+ nd.dentry->d_it = ⁢
error = do_revalidate(nd.dentry);
if (!error)
error = cp_new_stat64(nd.dentry->d_inode, statbuf);
-@@ -363,11 +371,16 @@
++ intent_release(nd.dentry);
+ path_release(&nd);
+ }
+ return error;
+@@ -363,6 +379,10 @@
{
struct file * f;
int err = -EBADF;
f = fget(fd);
if (f) {
- struct dentry * dentry = f->f_dentry;
-
-+ dentry->d_it = ⁢
- err = do_revalidate(dentry);
- if (!err)
- err = cp_new_stat64(dentry->d_inode, statbuf);