-Index: linux-2.6.9-5.0.3.EL/fs/exec.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/exec.c 2005-02-26 14:28:01.373228096 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/exec.c 2005-02-26 14:32:04.728232512 +0200
-@@ -124,9 +124,10 @@
+diff -rup RH_2_6_9_55.orig/fs/cifs/dir.c RH_2_6_9_55/fs/cifs/dir.c
+--- RH_2_6_9_55.orig/fs/cifs/dir.c
++++ RH_2_6_9_55/fs/cifs/dir.c
+@@ -157,11 +157,7 @@ cifs_create(struct inode *inode, struct
+
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
+ if(nd && (nd->flags & LOOKUP_OPEN)) {
+-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,5) /* SUSE included Lustre patch */
+ int oflags = nd->intent.it_flags;
+-#else
+- int oflags = nd->intent.open.flags;
+-#endif
+
+ desiredAccess = 0;
+ if (oflags & FMODE_READ)
+diff -rup RH_2_6_9_55.orig/fs/exec.c RH_2_6_9_55/fs/exec.c
+--- RH_2_6_9_55.orig/fs/exec.c
++++ RH_2_6_9_55/fs/exec.c
+@@ -126,9 +126,10 @@ asmlinkage long sys_uselib(const char __
struct file * file;
struct nameidata nd;
int error;
-+ intent_init(&nd.intent, IT_OPEN);
-
-- nd.intent.open.flags = FMODE_READ;
+-
+- nd.intent.open.flags = FMODE_READ|FMODE_EXEC;
- error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
++ intent_init(&nd.intent, IT_OPEN);
++
+ nd.intent.it_flags = FMODE_READ|FMODE_EXEC;
+ error = __user_walk_it(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
if (error)
goto out;
-@@ -138,7 +139,7 @@
+@@ -140,7 +141,7 @@ asmlinkage long sys_uselib(const char __
if (error)
goto exit;
error = PTR_ERR(file);
if (IS_ERR(file))
goto out;
-@@ -487,8 +488,9 @@
+@@ -489,8 +490,9 @@ struct file *open_exec(const char *name)
int err;
struct file *file;
-- nd.intent.open.flags = FMODE_READ;
+- nd.intent.open.flags = FMODE_READ|FMODE_EXEC;
- err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
+ intent_init(&nd.intent, IT_OPEN);
+ nd.intent.it_flags = FMODE_READ|FMODE_EXEC;
-+ err = path_lookup(name, LOOKUP_FOLLOW, &nd);
++ err = path_lookup_it(name, LOOKUP_FOLLOW, &nd);
file = ERR_PTR(err);
if (!err) {
-@@ -501,7 +503,7 @@
- err = -EACCES;
+@@ -501,7 +503,7 @@ struct file *open_exec(const char *name)
+ int err = permission(inode, MAY_EXEC, &nd);
file = ERR_PTR(err);
if (!err) {
- file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
if (!IS_ERR(file)) {
err = deny_write_access(file);
if (err) {
-Index: linux-2.6.9-5.0.3.EL/fs/namei.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/namei.c 2005-02-26 14:28:01.378227336 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/namei.c 2005-02-26 14:32:04.732231904 +0200
-@@ -272,8 +272,19 @@
+diff -rup RH_2_6_9_55.orig/fs/inode.c RH_2_6_9_55/fs/inode.c
+--- RH_2_6_9_55.orig/fs/inode.c
++++ RH_2_6_9_55/fs/inode.c
+@@ -235,6 +235,7 @@ void __iget(struct inode * inode)
+ inodes_stat.nr_unused--;
+ }
+
++EXPORT_SYMBOL(__iget);
+ /**
+ * clear_inode - clear an inode
+ * @inode: inode to clear
+diff -rup RH_2_6_9_55.orig/fs/namei.c RH_2_6_9_55/fs/namei.c
+--- RH_2_6_9_55.orig/fs/namei.c
++++ RH_2_6_9_55/fs/namei.c
+@@ -282,8 +282,19 @@ int deny_write_access(struct file * file
return 0;
}
dput(nd->dentry);
mntput(nd->mnt);
}
-@@ -363,7 +374,10 @@
+@@ -395,8 +406,12 @@ static struct dentry * real_lookup(struc
{
struct dentry * result;
struct inode *dir = parent->d_inode;
+-
+ int counter = 0;
-
++
+again:
-+ counter++;
down(&dir->i_sem);
++ counter++;
++
/*
* First re-do the cached lookup just in case it was created
-@@ -402,7 +416,10 @@
+ * while we waited for the directory semaphore..
+@@ -433,8 +448,12 @@ static struct dentry * real_lookup(struc
+ up(&dir->i_sem);
if (result->d_op && result->d_op->d_revalidate) {
- if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) {
- dput(result);
+ result = do_revalidate(result, nd);
+- if (!result)
- result = ERR_PTR(-ENOENT);
++ if (!result) {
+ if (counter > 10)
+ result = ERR_PTR(-ESTALE);
+ if (!IS_ERR(result))
+ goto again;
- }
++ }
}
return result;
-@@ -432,7 +449,9 @@
- static inline int __vfs_follow_link(struct nameidata *nd, const char *link)
+ }
+@@ -464,6 +483,7 @@ static inline int __vfs_follow_link(stru
{
int res = 0;
-+ struct lookup_intent it = nd->intent;
char *name;
+
if (IS_ERR(link))
goto fail;
-@@ -442,6 +461,9 @@
+@@ -473,6 +493,7 @@ static inline int __vfs_follow_link(stru
/* weird __emul_prefix() stuff did it */
goto out;
}
-+ intent_init(&nd->intent, it.it_op);
-+ nd->intent.it_flags = it.it_flags;
-+ nd->intent.it_create_mode = it.it_create_mode;
++ intent_reset_fs_part(&nd->intent);
res = link_path_walk(link, nd);
out:
if (nd->depth || res || nd->last_type!=LAST_NORM)
-@@ -650,6 +672,33 @@
+@@ -681,6 +702,33 @@ fail:
return PTR_ERR(dentry);
}
+ counter++;
+ if (counter < 10)
+ goto revalidate_again;
-+ printk("excessive revalidate_it loops\n");
++ //printk("excessive revalidate_it loops\n");
+ return -ESTALE;
+ }
+ return 0;
+
/*
* Name resolution.
- *
-@@ -752,7 +801,9 @@
+ * This is the basic name resolution function, turning a pathname into
+@@ -782,13 +830,17 @@ static fastcall int __link_path_walk(con
+ goto out_dput;
if (inode->i_op->follow_link) {
++ int save_flags = nd->flags;
mntget(next.mnt);
+ if (next.mnt != nd->mnt) {
+ dput(nd->dentry);
+ nd->mnt = next.mnt;
+ nd->dentry = dget(next.dentry);
+ }
+ nd->flags |= LOOKUP_LINK_NOTLAST;
err = do_follow_link(next.dentry, nd);
-+ nd->flags &= ~LOOKUP_LINK_NOTLAST;
++ if (!(save_flags & LOOKUP_LINK_NOTLAST))
++ nd->flags &= ~LOOKUP_LINK_NOTLAST;
dput(next.dentry);
mntput(next.mnt);
if (err)
-@@ -791,14 +842,34 @@
+@@ -828,14 +880,34 @@ last_component:
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
-+ nd->flags |= LOOKUP_LAST;
-+ err = revalidate_special(nd);
-+ nd->flags &= ~LOOKUP_LAST;
++ nd->flags |= LOOKUP_LAST;
++ err = revalidate_special(nd);
++ nd->flags &= ~LOOKUP_LAST;
+ if (!nd->dentry->d_inode)
+ err = -ENOENT;
+ if (err) {
-+ path_release(nd);
++ path_release(nd);
+ goto return_err;
+ }
+ if (lookup_flags & LOOKUP_DIRECTORY) {
+ err = -ENOTDIR;
-+ if(!nd->dentry->d_inode->i_op ||
-+ !nd->dentry->d_inode->i_op->lookup) {
++ if (!nd->dentry->d_inode->i_op ||
++ !nd->dentry->d_inode->i_op->lookup){
+ path_release(nd);
+ goto return_err;
+ }
if (err)
break;
follow_mount(&next.mnt, &next.dentry);
-@@ -1016,7 +1087,7 @@
+@@ -1007,7 +1079,7 @@ set_it:
+ }
+
+ /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
+-int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
++int fastcall path_lookup_it(const char *name, unsigned int flags, struct nameidata *nd)
+ {
+ int retval = 0;
+
+@@ -1041,6 +1113,12 @@ out:
+ return retval;
+ }
+
++int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
++{
++ intent_init(&nd->intent, IT_GETATTR);
++ return path_lookup_it(name, flags, nd);
++}
++
+ /*
+ * Restricted form of lookup. Doesn't follow links, single-component only,
+ * needs parent already locked. Doesn't follow mounts.
+@@ -1091,7 +1169,7 @@ struct dentry * lookup_hash(struct qstr
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -1036,11 +1107,16 @@
+@@ -1111,11 +1189,16 @@ struct dentry * lookup_one_len(const cha
}
this.hash = end_name_hash(hash);
/*
* namei()
*
-@@ -1052,7 +1128,7 @@
+@@ -1127,18 +1210,24 @@ access:
* that namei follows links, while lnamei does not.
* SMP-safe
*/
{
char *tmp = getname(name);
int err = PTR_ERR(tmp);
-@@ -1064,6 +1140,12 @@
+
+ if (!IS_ERR(tmp)) {
+- err = path_lookup(tmp, flags, nd);
++ err = path_lookup_it(tmp, flags, nd);
+ putname(tmp);
+ }
return err;
}
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -1347,8 +1429,8 @@
+@@ -1384,7 +1473,7 @@ int may_open(struct nameidata *nd, int a
+ if (!error) {
+ DQUOT_INIT(inode);
+
+- error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME);
++ error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME|ATTR_FROM_OPEN);
+ }
+ put_write_access(inode);
+ if (error)
+@@ -1425,14 +1514,14 @@ int open_namei(const char * pathname, in
acc_mode |= MAY_APPEND;
/* Fill in the open() intent data */
/*
* The simplest case - just a plain lookup.
-@@ -1363,6 +1445,7 @@
+ */
+ if (!(flag & O_CREAT)) {
+- error = path_lookup(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
++ error = path_lookup_it(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
+ if (error)
+ return error;
+ goto ok;
+@@ -1441,7 +1530,8 @@ int open_namei(const char * pathname, in
/*
* Create - we need to know the parent.
*/
+- error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
+ nd->intent.it_op |= IT_CREAT;
- error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
++ error = path_lookup_it(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
if (error)
return error;
-@@ -1379,7 +1462,9 @@
+
+@@ -1457,7 +1547,9 @@ int open_namei(const char * pathname, in
dir = nd->dentry;
nd->flags &= ~LOOKUP_PARENT;
down(&dir->d_inode->i_sem);
do_last:
error = PTR_ERR(dentry);
-@@ -1492,7 +1577,9 @@
+@@ -1570,7 +1662,9 @@ do_link:
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
+ nd->flags |= LOOKUP_LAST;
dentry = __lookup_hash(&nd->last, nd->dentry, nd);
+ nd->flags &= ~LOOKUP_LAST;
- putname(nd->last.name);
+ __putname(nd->last.name);
goto do_last;
}
-Index: linux-2.6.9-5.0.3.EL/fs/namespace.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/namespace.c 2005-02-26 14:28:01.381226880 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/namespace.c 2005-02-26 14:32:04.734231600 +0200
-@@ -61,6 +61,7 @@
- INIT_LIST_HEAD(&mnt->mnt_mounts);
- INIT_LIST_HEAD(&mnt->mnt_list);
- INIT_LIST_HEAD(&mnt->mnt_fslink);
-+ INIT_LIST_HEAD(&mnt->mnt_lustre_list);
- if (name) {
- int size = strlen(name)+1;
- char *newname = kmalloc(size, GFP_KERNEL);
-@@ -114,6 +115,7 @@
+@@ -1644,10 +1738,20 @@ asmlinkage long sys_mknod(const char __u
+ tmp = getname(filename);
+ if (IS_ERR(tmp))
+ return PTR_ERR(tmp);
+-
+- error = path_lookup(tmp, LOOKUP_PARENT, &nd);
++
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = path_lookup_it(tmp, LOOKUP_PARENT, &nd);
+ if (error)
+ goto out;
++
++ if (nd.dentry->d_inode->i_op->mknod_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++ error = op->mknod_raw(&nd, mode, dev);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out2;
++ }
++
+ dentry = lookup_create(&nd, 0);
+ error = PTR_ERR(dentry);
+
+@@ -1674,6 +1778,7 @@ asmlinkage long sys_mknod(const char __u
+ dput(dentry);
+ }
+ up(&nd.dentry->d_inode->i_sem);
++out2:
+ path_release(&nd);
+ out:
+ putname(tmp);
+@@ -1716,10 +1821,20 @@ asmlinkage long sys_mkdir(const char __u
+ if (!IS_ERR(tmp)) {
+ struct dentry *dentry;
+ struct nameidata nd;
++ intent_init(&nd.intent, IT_LOOKUP);
+
+- error = path_lookup(tmp, LOOKUP_PARENT, &nd);
++ error = path_lookup_it(tmp, LOOKUP_PARENT, &nd);
+ if (error)
+ goto out;
++
++ if (nd.dentry->d_inode->i_op->mkdir_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++ error = op->mkdir_raw(&nd, mode);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out2;
++ }
++
+ dentry = lookup_create(&nd, 1);
+ error = PTR_ERR(dentry);
+ if (!IS_ERR(dentry)) {
+@@ -1729,6 +1844,7 @@ asmlinkage long sys_mkdir(const char __u
+ dput(dentry);
+ }
+ up(&nd.dentry->d_inode->i_sem);
++out2:
+ path_release(&nd);
+ out:
+ putname(tmp);
+@@ -1814,7 +1930,8 @@ asmlinkage long sys_rmdir(const char __u
+ if(IS_ERR(name))
+ return PTR_ERR(name);
+
+- error = path_lookup(name, LOOKUP_PARENT, &nd);
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = path_lookup_it(name, LOOKUP_PARENT, &nd);
+ if (error)
+ goto exit;
+
+@@ -1829,6 +1946,16 @@ asmlinkage long sys_rmdir(const char __u
+ error = -EBUSY;
+ goto exit1;
+ }
++
++ if (nd.dentry->d_inode->i_op->rmdir_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++
++ error = op->rmdir_raw(&nd);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto exit1;
++ }
++
+ down(&nd.dentry->d_inode->i_sem);
+ dentry = lookup_hash(&nd.last, nd.dentry);
+ error = PTR_ERR(dentry);
+@@ -1892,12 +2019,22 @@ asmlinkage long sys_unlink(const char __
+ if(IS_ERR(name))
+ return PTR_ERR(name);
+
+- error = path_lookup(name, LOOKUP_PARENT, &nd);
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = path_lookup_it(name, LOOKUP_PARENT, &nd);
+ if (error)
+ goto exit;
+ error = -EISDIR;
+ if (nd.last_type != LAST_NORM)
+ goto exit1;
++
++ if (nd.dentry->d_inode->i_op->unlink_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++ error = op->unlink_raw(&nd);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto exit1;
++ }
++
+ down(&nd.dentry->d_inode->i_sem);
+ dentry = lookup_hash(&nd.last, nd.dentry);
+ error = PTR_ERR(dentry);
+@@ -1965,10 +2102,20 @@ asmlinkage long sys_symlink(const char _
+ if (!IS_ERR(to)) {
+ struct dentry *dentry;
+ struct nameidata nd;
++ intent_init(&nd.intent, IT_LOOKUP);
+
+- error = path_lookup(to, LOOKUP_PARENT, &nd);
++ error = path_lookup_it(to, LOOKUP_PARENT, &nd);
+ if (error)
+ goto out;
++
++ if (nd.dentry->d_inode->i_op->symlink_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++ error = op->symlink_raw(&nd, from);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out2;
++ }
++
+ dentry = lookup_create(&nd, 0);
+ error = PTR_ERR(dentry);
+ if (!IS_ERR(dentry)) {
+@@ -1976,6 +2123,7 @@ asmlinkage long sys_symlink(const char _
+ dput(dentry);
+ }
+ up(&nd.dentry->d_inode->i_sem);
++out2:
+ path_release(&nd);
+ out:
+ putname(to);
+@@ -2045,15 +2193,26 @@ asmlinkage long sys_link(const char __us
+ if (IS_ERR(to))
+ return PTR_ERR(to);
+
+- error = __user_walk(oldname, 0, &old_nd);
++ intent_init(&old_nd.intent, IT_LOOKUP);
++ error = __user_walk_it(oldname, 0, &old_nd);
+ if (error)
+ goto exit;
+- error = path_lookup(to, LOOKUP_PARENT, &nd);
++
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = path_lookup_it(to, LOOKUP_PARENT, &nd);
+ if (error)
+ goto out;
+ error = -EXDEV;
+ if (old_nd.mnt != nd.mnt)
+ goto out_release;
++ if (nd.dentry->d_inode->i_op->link_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++ error = op->link_raw(&old_nd, &nd);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out_release;
++ }
++
+ new_dentry = lookup_create(&nd, 0);
+ error = PTR_ERR(new_dentry);
+ if (!IS_ERR(new_dentry)) {
+@@ -2229,11 +2388,13 @@ static inline int do_rename(const char *
+ struct dentry * trap;
+ struct nameidata oldnd, newnd;
+
+- error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
++ intent_init(&oldnd.intent, IT_LOOKUP);
++ error = path_lookup_it(oldname, LOOKUP_PARENT, &oldnd);
+ if (error)
+ goto exit;
+
+- error = path_lookup(newname, LOOKUP_PARENT, &newnd);
++ intent_init(&newnd.intent, IT_LOOKUP);
++ error = path_lookup_it(newname, LOOKUP_PARENT, &newnd);
+ if (error)
+ goto exit1;
+
+@@ -2250,6 +2411,13 @@ static inline int do_rename(const char *
+ if (newnd.last_type != LAST_NORM)
+ goto exit2;
+
++ if (old_dir->d_inode->i_op->rename_raw) {
++ error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto exit2;
++ }
++
+ trap = lock_rename(new_dir, old_dir);
+
+ old_dentry = lookup_hash(&oldnd.last, old_dir);
+@@ -2281,8 +2449,7 @@ static inline int do_rename(const char *
+ if (new_dentry == trap)
+ goto exit5;
+
+- error = vfs_rename(old_dir->d_inode, old_dentry,
+- new_dir->d_inode, new_dentry);
++ error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry);
+ exit5:
+ dput(new_dentry);
+ exit4:
+@@ -2473,6 +2640,7 @@ EXPORT_SYMBOL(page_readlink);
+ EXPORT_SYMBOL(page_symlink);
+ EXPORT_SYMBOL(page_symlink_inode_operations);
+ EXPORT_SYMBOL(path_lookup);
++EXPORT_SYMBOL(path_lookup_it);
+ EXPORT_SYMBOL(path_release);
+ EXPORT_SYMBOL(path_walk);
+ EXPORT_SYMBOL(permission);
+diff -urNp RH_2_6_9_42_0_3.orig/fs/namespace.c RH_2_6_9_42_0_3/fs/namespace.c
+--- RH_2_6_9_42_0_3.orig/fs/namespace.c
++++ RH_2_6_9_42_0_3/fs/namespace.c
+@@ -114,6 +115,7 @@ static inline int check_mnt(struct vfsmo
static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
{
old_nd->dentry = mnt->mnt_mountpoint;
old_nd->mnt = mnt->mnt_parent;
mnt->mnt_parent = mnt;
-@@ -177,6 +179,9 @@
- {
- struct super_block *sb = mnt->mnt_sb;
- dput(mnt->mnt_root);
-+ spin_lock(&dcache_lock);
-+ list_del(&mnt->mnt_lustre_list);
-+ spin_unlock(&dcache_lock);
- free_vfsmnt(mnt);
- deactivate_super(sb);
- }
-@@ -403,6 +408,8 @@
+@@ -441,6 +442,8 @@ static int do_umount(struct vfsmount *mn
*/
lock_kernel();
+ if (sb->s_op->umount_lustre)
-+ sb->s_op->umount_lustre(sb);
++ sb->s_op->umount_lustre(sb);
if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
sb->s_op->umount_begin(sb);
unlock_kernel();
-@@ -627,6 +634,7 @@
+@@ -665,7 +668,8 @@ static int do_loopback(struct nameidata
return err;
if (!old_name || !*old_name)
return -EINVAL;
+- err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
+ intent_init(&old_nd.intent, IT_LOOKUP);
- err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
++ err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
if (err)
return err;
-@@ -701,6 +709,7 @@
+
+@@ -739,7 +743,8 @@ static int do_move_mount(struct nameidat
return -EPERM;
if (!old_name || !*old_name)
return -EINVAL;
+- err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
+ intent_init(&old_nd.intent, IT_LOOKUP);
- err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
++ err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
if (err)
return err;
-@@ -1012,6 +1021,7 @@
- int retval = 0;
- int mnt_flags = 0;
-+ intent_init(&nd.intent, IT_LOOKUP);
- /* Discard magic */
- if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
- flags &= ~MS_MGC_MSK;
-Index: linux-2.6.9-5.0.3.EL/fs/open.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/open.c 2005-02-26 14:28:01.383226576 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/open.c 2005-02-26 14:32:04.736231296 +0200
-@@ -215,12 +215,12 @@
+@@ -1074,7 +1079,8 @@ long do_mount(char * dev_name, char * di
+ flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_ACTIVE);
+
+ /* ... and get the mountpoint */
+- retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);
++ intent_init(&nd.intent, IT_LOOKUP);
++ retval = path_lookup_it(dir_name, LOOKUP_FOLLOW, &nd);
+ if (retval)
+ return retval;
+
+diff -rup RH_2_6_9_55.orig/fs/nfs/dir.c RH_2_6_9_55/fs/nfs/dir.c
+--- RH_2_6_9_55.orig/fs/nfs/dir.c
++++ RH_2_6_9_55/fs/nfs/dir.c
+@@ -839,7 +839,7 @@ int nfs_is_exclusive_create(struct inode
+ return 0;
+ if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
+ return 0;
+- return (nd->intent.open.flags & O_EXCL) != 0;
++ return (nd->intent.it_flags & O_EXCL) != 0;
+ }
+
+ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
+@@ -915,7 +915,7 @@ static int is_atomic_open(struct inode *
+ if (nd->flags & LOOKUP_DIRECTORY)
+ return 0;
+ /* Are we trying to write to a read only partition? */
+- if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
++ if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
+ return 0;
+ return 1;
+ }
+@@ -936,7 +936,7 @@ static struct dentry *nfs_atomic_lookup(
+ dentry->d_op = NFS_PROTO(dir)->dentry_ops;
+
+ /* Let vfs_create() deal with O_EXCL */
+- if (nd->intent.open.flags & O_EXCL)
++ if (nd->intent.it_flags & O_EXCL)
+ goto no_entry;
+
+ /* Open the file on the server */
+@@ -948,7 +948,7 @@ static struct dentry *nfs_atomic_lookup(
+ goto out;
+ }
+
+- if (nd->intent.open.flags & O_CREAT) {
++ if (nd->intent.it_flags & O_CREAT) {
+ nfs_begin_data_update(dir);
+ inode = nfs4_atomic_open(dir, dentry, nd);
+ nfs_end_data_update(dir);
+@@ -967,7 +967,7 @@ static struct dentry *nfs_atomic_lookup(
+ case -ENOTDIR:
+ goto no_open;
+ case -ELOOP:
+- if (!(nd->intent.open.flags & O_NOFOLLOW))
++ if (!(nd->intent.it_flags & O_NOFOLLOW))
+ goto no_open;
+ /* case -EINVAL: */
+ default:
+@@ -1005,7 +1005,7 @@ static int nfs_open_revalidate(struct de
+ /* NFS only supports OPEN on regular files */
+ if (!S_ISREG(inode->i_mode))
+ goto no_open;
+- openflags = nd->intent.open.flags;
++ openflags = nd->intent.it_flags;
+ /* We cannot do exclusive creation on a positive dentry */
+ if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
+ goto no_open;
+@@ -1213,7 +1213,7 @@ static int nfs_create(struct inode *dir,
+ attr.ia_valid = ATTR_MODE;
+
+ if (nd && (nd->flags & LOOKUP_CREATE))
+- open_flags = nd->intent.open.flags;
++ open_flags = nd->intent.it_flags;
+
+ /*
+ * The 0 argument passed into the create function should one day
+diff -rup RH_2_6_9_55.orig/fs/nfs/nfs4proc.c RH_2_6_9_55/fs/nfs/nfs4proc.c
+--- RH_2_6_9_55.orig/fs/nfs/nfs4proc.c
++++ RH_2_6_9_55/fs/nfs/nfs4proc.c
+@@ -770,27 +770,27 @@ nfs4_atomic_open(struct inode *dir, stru
+ struct nfs4_inc_open *inc_open;
+
+ if (nd->flags & LOOKUP_CREATE) {
+- attr.ia_mode = nd->intent.open.create_mode;
++ attr.ia_mode = nd->intent.it_create_mode;
+ attr.ia_valid = ATTR_MODE;
+ if (!IS_POSIXACL(dir))
+ attr.ia_mode &= ~current->fs->umask;
+ } else {
+ attr.ia_valid = 0;
+- BUG_ON(nd->intent.open.flags & O_CREAT);
++ BUG_ON(nd->intent.it_flags & O_CREAT);
+ }
+
+ /* track info in case the open never completes */
+ if (!(inc_open = kmalloc(sizeof(*inc_open), GFP_KERNEL)))
+ return ERR_PTR(-ENOMEM);
+ cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
+- state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
++ state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
+ put_rpccred(cred);
+ if (IS_ERR(state)) {
+ kfree(inc_open);
+ return (struct inode *)state;
+ }
+ inc_open->task = current;
+- inc_open->flags = nd->intent.open.flags;
++ inc_open->flags = nd->intent.it_flags;
+ INIT_LIST_HEAD(&inc_open->state);
+ spin_lock(&state->inode->i_lock);
+ list_add(&inc_open->state, &state->inc_open);
+diff -rup RH_2_6_9_55.orig/fs/open.c RH_2_6_9_55/fs/open.c
+--- RH_2_6_9_55.orig/fs/open.c
++++ RH_2_6_9_55/fs/open.c
+@@ -195,6 +195,7 @@ out:
+ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs)
+ {
+ int err;
++ struct inode_operations *op = dentry->d_inode->i_op;
+ struct iattr newattrs;
+
+ /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
+@@ -204,8 +205,16 @@ int do_truncate(struct dentry *dentry, l
+ newattrs.ia_size = length;
+ newattrs.ia_valid = ATTR_SIZE | time_attrs;
+ down(&dentry->d_inode->i_sem);
+- err = notify_change(dentry, &newattrs);
+- up(&dentry->d_inode->i_sem);
++ if (op->setattr_raw) {
++ newattrs.ia_valid |= ATTR_RAW;
++ newattrs.ia_ctime = CURRENT_TIME;
++ down_write(&dentry->d_inode->i_alloc_sem);
++ err = op->setattr_raw(dentry->d_inode, &newattrs);
++ up_write(&dentry->d_inode->i_alloc_sem);
++ } else
++ err = notify_change(dentry, &newattrs);
++ up(&dentry->d_inode->i_sem);
++
+ return err;
+ }
+
+@@ -214,12 +223,13 @@ static inline long do_sys_truncate(const
struct nameidata nd;
struct inode * inode;
int error;
-
-+ intent_init(&nd.intent, IT_GETATTR);
++
error = -EINVAL;
if (length < 0) /* sorry, but loff_t says... */
goto out;
-
+-
- error = user_path_walk(path, &nd);
++
++ intent_init(&nd.intent, IT_GETATTR);
+ error = user_path_walk_it(path, &nd);
if (error)
goto out;
inode = nd.dentry->d_inode;
-@@ -474,6 +474,7 @@
+@@ -390,9 +400,19 @@ asmlinkage long sys_utime(char __user *
+ (error = permission(inode,MAY_WRITE,&nd)) != 0)
+ goto dput_and_out;
+ }
+- down(&inode->i_sem);
+- error = notify_change(nd.dentry, &newattrs);
+- up(&inode->i_sem);
++ if (inode->i_op->setattr_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++
++ newattrs.ia_valid |= ATTR_RAW;
++ error = op->setattr_raw(inode, &newattrs);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto dput_and_out;
++ } else {
++ down(&inode->i_sem);
++ error = notify_change(nd.dentry, &newattrs);
++ up(&inode->i_sem);
++ }
+ dput_and_out:
+ path_release(&nd);
+ out:
+@@ -443,9 +463,19 @@ long do_utimes(char __user * filename, s
+ (error = permission(inode,MAY_WRITE,&nd)) != 0)
+ goto dput_and_out;
+ }
+- down(&inode->i_sem);
+- error = notify_change(nd.dentry, &newattrs);
+- up(&inode->i_sem);
++ if (inode->i_op->setattr_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++
++ newattrs.ia_valid |= ATTR_RAW;
++ error = op->setattr_raw(inode, &newattrs);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto dput_and_out;
++ } else {
++ down(&inode->i_sem);
++ error = notify_change(nd.dentry, &newattrs);
++ up(&inode->i_sem);
++ }
+ dput_and_out:
+ path_release(&nd);
+ out:
+@@ -473,6 +503,7 @@ asmlinkage long sys_access(const char __
int old_fsuid, old_fsgid;
kernel_cap_t old_cap;
int res;
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
-@@ -498,13 +499,14 @@
+@@ -497,13 +528,14 @@ asmlinkage long sys_access(const char __
else
current->cap_effective = current->cap_permitted;
path_release(&nd);
}
-@@ -519,8 +521,9 @@
+@@ -518,8 +550,9 @@ asmlinkage long sys_chdir(const char __u
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -572,8 +575,9 @@
+@@ -571,8 +604,9 @@ asmlinkage long sys_chroot(const char __
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -754,27 +758,8 @@
- * for the internal routines (ie open_namei()/follow_link() etc). 00 is
- * used by symlinks.
- */
--struct file *filp_open(const char * filename, int flags, int mode)
--{
-- int namei_flags, error;
-- struct nameidata nd;
+@@ -595,36 +629,52 @@ out:
+
+ EXPORT_SYMBOL_GPL(sys_chroot);
+
+-asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
++int chmod_common(struct dentry *dentry, mode_t mode)
+ {
+- struct inode * inode;
+- struct dentry * dentry;
+- struct file * file;
+- int err = -EBADF;
++ struct inode * inode = dentry->d_inode;
+ struct iattr newattrs;
++ int error = -EROFS;
+
+- file = fget(fd);
+- if (!file)
++ if (IS_RDONLY(inode))
+ goto out;
++
++ if (inode->i_op->setattr_raw) {
++ struct inode_operations *op = dentry->d_inode->i_op;
+
+- dentry = file->f_dentry;
+- inode = dentry->d_inode;
++ newattrs.ia_mode = mode;
++ newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
++ newattrs.ia_valid |= ATTR_RAW;
++ error = op->setattr_raw(inode, &newattrs);
++ /* the file system wants to use the normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out;
++ }
+
+- err = -EROFS;
+- if (IS_RDONLY(inode))
+- goto out_putf;
+- err = -EPERM;
++ error = -EPERM;
+ if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+- goto out_putf;
++ goto out;
++
+ down(&inode->i_sem);
+ if (mode == (mode_t) -1)
+ mode = inode->i_mode;
+ newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
+ newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
+- err = notify_change(dentry, &newattrs);
++ error = notify_change(dentry, &newattrs);
+ up(&inode->i_sem);
++out:
++ return error;
++}
+
+-out_putf:
++asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
++{
++ struct file * file;
++ int err = -EBADF;
++
++ file = fget(fd);
++ if (!file)
++ goto out;
++
++ err = chmod_common(file->f_dentry, mode);
+ fput(file);
+ out:
+ return err;
+@@ -633,32 +683,13 @@ out:
+ asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
+ {
+ struct nameidata nd;
+- struct inode * inode;
+ int error;
+- struct iattr newattrs;
+
+ error = user_path_walk(filename, &nd);
+ if (error)
+ goto out;
+- inode = nd.dentry->d_inode;
+
+- error = -EROFS;
+- if (IS_RDONLY(inode))
+- goto dput_and_out;
-
-- namei_flags = flags;
-- if ((namei_flags+1) & O_ACCMODE)
-- namei_flags++;
-- if (namei_flags & O_TRUNC)
-- namei_flags |= 2;
+- error = -EPERM;
+- if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+- goto dput_and_out;
-
-- error = open_namei(filename, namei_flags, mode, &nd);
-- if (!error)
-- return dentry_open(nd.dentry, nd.mnt, flags);
+- down(&inode->i_sem);
+- if (mode == (mode_t) -1)
+- mode = inode->i_mode;
+- newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
+- newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
+- error = notify_change(nd.dentry, &newattrs);
+- up(&inode->i_sem);
-
-- return ERR_PTR(error);
--}
+-dput_and_out:
++ error = chmod_common(nd.dentry, mode);
+ path_release(&nd);
+ out:
+ return error;
+@@ -679,6 +710,18 @@ static int chown_common(struct dentry *
+ if (IS_RDONLY(inode))
+ goto out;
+ error = -EPERM;
++ if (inode->i_op->setattr_raw) {
++ struct inode_operations *op = dentry->d_inode->i_op;
++
++ newattrs.ia_uid = user;
++ newattrs.ia_gid = group;
++ newattrs.ia_valid = ATTR_UID | ATTR_GID | ATTR_CTIME;
++ newattrs.ia_valid |= ATTR_RAW;
++ error = op->setattr_raw(inode, &newattrs);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ return error;
++ }
+ if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+ goto out;
+ newattrs.ia_valid = ATTR_CTIME;
+@@ -692,6 +735,7 @@ static int chown_common(struct dentry *
+ }
+ if (!S_ISDIR(inode->i_mode))
+ newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
++
+ down(&inode->i_sem);
+ error = notify_change(dentry, &newattrs);
+ up(&inode->i_sem);
+@@ -739,8 +783,6 @@ asmlinkage long sys_fchown(unsigned int
+ return error;
+ }
+
+-static struct file *__dentry_open(struct dentry *, struct vfsmount *, int, struct file *);
-
--EXPORT_SYMBOL(filp_open);
+ /*
+ * Note that while the flag value (low two bits) for sys_open means:
+ * 00 - read-only
+@@ -758,8 +800,9 @@ static struct file *__dentry_open(struct
+ struct file *filp_open(const char * filename, int flags, int mode)
+ {
+ int namei_flags, error;
++ struct file * temp_filp;
+ struct nameidata nd;
+- struct file *f;
++ intent_init(&nd.intent, IT_OPEN);
+
+ namei_flags = flags;
+ if ((namei_flags+1) & O_ACCMODE)
+@@ -767,16 +810,11 @@ struct file *filp_open(const char * file
+ if (namei_flags & O_TRUNC)
+ namei_flags |= 2;
+
+- error = -ENFILE;
+- f = get_empty_filp();
+- if (f == NULL)
+- return ERR_PTR(error);
+-
+ error = open_namei(filename, namei_flags, mode, &nd);
+- if (!error)
+- return __dentry_open(nd.dentry, nd.mnt, flags, f);
+-
+- put_filp(f);
++ if (!error) {
++ temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
++ return temp_filp;
++ }
+ return ERR_PTR(error);
+ }
+
+@@ -784,29 +822,27 @@ EXPORT_SYMBOL(filp_open);
+
+ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
+ {
+- int error;
+- struct file *f;
++ struct lookup_intent it;
++ intent_init(&it, IT_LOOKUP);
+
+- error = -ENFILE;
+- f = get_empty_filp();
+- if (f == NULL) {
+- dput(dentry);
+- mntput(mnt);
+- return ERR_PTR(error);
+- }
-
--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)
+- return __dentry_open(dentry, mnt, flags, f);
++ return dentry_open_it(dentry, mnt, flags, &it);
+ }
+
+ EXPORT_SYMBOL(dentry_open);
+
+-static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, struct file *f)
++struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it)
{
- struct file * f;
++ struct file *f;
struct inode *inode;
-@@ -786,6 +771,7 @@
- goto cleanup_dentry;
+ int error;
+
++ error = -ENFILE;
++ f = get_empty_filp();
++ if (!f)
++ goto cleanup_dentry;
f->f_flags = flags;
f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
+ f->f_it = it;
inode = dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = get_write_access(inode);
-@@ -804,6 +790,7 @@
+@@ -825,6 +861,7 @@ static struct file *__dentry_open(struct
error = f->f_op->open(inode,f);
if (error)
goto cleanup_all;
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-@@ -829,6 +816,7 @@
+@@ -849,6 +886,8 @@ cleanup_all:
+ f->f_vfsmnt = NULL;
cleanup_file:
put_filp(f);
- cleanup_dentry:
++cleanup_dentry:
+ intent_release(it);
dput(dentry);
mntput(mnt);
return ERR_PTR(error);
-@@ -836,6 +824,36 @@
-
- EXPORT_SYMBOL(dentry_open);
-
-+struct file *filp_open(const char * filename, int flags, int mode)
-+{
-+ int namei_flags, error;
-+ struct file * temp_filp;
-+ struct nameidata nd;
-+ intent_init(&nd.intent, IT_OPEN);
-+
-+ namei_flags = flags;
-+ if ((namei_flags+1) & O_ACCMODE)
-+ namei_flags++;
-+ if (namei_flags & O_TRUNC)
-+ namei_flags |= 2;
-+
-+ error = open_namei(filename, namei_flags, mode, &nd);
-+ if (!error) {
-+ temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
-+ return temp_filp;
-+ }
-+ return ERR_PTR(error);
-+}
-+
-+
-+struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
-+{
-+ struct lookup_intent it;
-+ intent_init(&it, IT_LOOKUP);
-+
-+ return dentry_open_it(dentry, mnt, flags, &it);
-+}
-+
- /*
- * Find an empty file descriptor entry, and mark it busy.
- */
-Index: linux-2.6.9-5.0.3.EL/fs/stat.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/stat.c 2005-02-26 14:28:01.384226424 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/stat.c 2005-02-26 14:32:04.738230992 +0200
-@@ -37,7 +37,7 @@
+diff -rup RH_2_6_9_55.orig/fs/stat.c RH_2_6_9_55/fs/stat.c
+--- RH_2_6_9_55.orig/fs/stat.c
++++ RH_2_6_9_55/fs/stat.c
+@@ -37,7 +37,7 @@ void generic_fillattr(struct inode *inod
EXPORT_SYMBOL(generic_fillattr);
{
struct inode *inode = dentry->d_inode;
int retval;
-@@ -46,6 +46,8 @@
+@@ -46,6 +46,8 @@ int vfs_getattr(struct vfsmount *mnt, st
if (retval)
return retval;
if (inode->i_op->getattr)
return inode->i_op->getattr(mnt, dentry, stat);
-@@ -62,14 +64,20 @@
+@@ -62,7 +64,7 @@ int vfs_getattr(struct vfsmount *mnt, st
EXPORT_SYMBOL(vfs_getattr);
+-int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
++int vfs_getattr64_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat64 *stat)
+ {
+ struct inode *inode = dentry->d_inode;
+ int retval;
+@@ -79,6 +81,13 @@ int vfs_getattr64(struct vfsmount *mnt,
+ return ixop->getattr64(mnt, dentry, stat);
+ }
+
++ if (inode->i_op->getattr_it) {
++ retval = inode->i_op->getattr_it(mnt, dentry, it, (struct kstat *) stat);
++ if (retval == 0)
++ stat->ino64 = stat->ino;
++ return retval;
++ }
++
+ if (inode->i_op->getattr) {
+ retval = inode->i_op->getattr(mnt, dentry, (struct kstat *) stat);
+ if (retval == 0)
+@@ -98,16 +107,28 @@ int vfs_getattr64(struct vfsmount *mnt,
+ return 0;
+ }
+
++
+ EXPORT_SYMBOL(vfs_getattr64);
+
+int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+{
+ return vfs_getattr_it(mnt, dentry, NULL, stat);
+}
+
++int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
++{
++ return vfs_getattr64_it(mnt, dentry, NULL, stat);
++}
++
int vfs_stat(char __user *name, struct kstat *stat)
{
struct nameidata nd;
path_release(&nd);
}
return error;
-@@ -81,10 +89,11 @@
+@@ -119,10 +140,11 @@ int vfs_lstat(char __user *name, struct
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -96,9 +105,12 @@
+@@ -134,9 +156,12 @@ int vfs_fstat(unsigned int fd, struct ks
{
struct file *f = fget(fd);
int error = -EBADF;
fput(f);
}
return error;
-Index: linux-2.6.9-5.0.3.EL/fs/nfs/dir.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/nfs/dir.c 2005-02-26 14:28:01.387225968 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/nfs/dir.c 2005-02-26 14:32:04.740230688 +0200
-@@ -718,7 +718,7 @@
- return 0;
- if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
- return 0;
-- return (nd->intent.open.flags & O_EXCL) != 0;
-+ return (nd->intent.it_flags & O_EXCL) != 0;
- }
-
- static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
-@@ -1043,7 +1043,7 @@
- attr.ia_valid = ATTR_MODE;
-
- if (nd && (nd->flags & LOOKUP_CREATE))
-- open_flags = nd->intent.open.flags;
-+ open_flags = nd->intent.it_flags;
-
- /*
- * The 0 argument passed into the create function should one day
-Index: linux-2.6.9-5.0.3.EL/fs/inode.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/fs/inode.c 2005-02-26 14:28:01.389225664 +0200
-+++ linux-2.6.9-5.0.3.EL/fs/inode.c 2005-02-26 14:32:04.742230384 +0200
-@@ -233,6 +233,7 @@
- inodes_stat.nr_unused--;
- }
-
-+EXPORT_SYMBOL(__iget);
- /**
- * clear_inode - clear an inode
- * @inode: inode to clear
-Index: linux-2.6.9-5.0.3.EL/include/linux/dcache.h
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/include/linux/dcache.h 2005-02-26 14:28:01.390225512 +0200
-+++ linux-2.6.9-5.0.3.EL/include/linux/dcache.h 2005-02-26 14:32:04.743230232 +0200
+@@ -148,10 +173,11 @@ int vfs_stat64(char __user *name, struct
+ {
+ struct nameidata nd;
+ int error;
++ intent_init(&nd.intent, IT_GETATTR);
+
+- error = user_path_walk(name, &nd);
++ error = user_path_walk_it(name, &nd);
+ if (!error) {
+- error = vfs_getattr64(nd.mnt, nd.dentry, stat);
++ error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
+ path_release(&nd);
+ }
+ return error;
+@@ -163,10 +189,11 @@ int vfs_lstat64(char __user *name, struc
+ {
+ struct nameidata nd;
+ int error;
++ intent_init(&nd.intent, IT_GETATTR);
+
+- error = user_path_walk_link(name, &nd);
++ error = user_path_walk_link_it(name, &nd);
+ if (!error) {
+- error = vfs_getattr64(nd.mnt, nd.dentry, stat);
++ error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
+ path_release(&nd);
+ }
+ return error;
+@@ -178,9 +205,11 @@ int vfs_fstat64(unsigned int fd, struct
+ {
+ struct file *f = fget(fd);
+ int error = -EBADF;
++ struct nameidata nd;
++ intent_init(&nd.intent, IT_GETATTR);
+
+ if (f) {
+- error = vfs_getattr64(f->f_vfsmnt, f->f_dentry, stat);
++ error = vfs_getattr64_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
+ fput(f);
+ }
+ return error;
+diff -rup RH_2_6_9_55.orig/include/linux/dcache.h RH_2_6_9_55/include/linux/dcache.h
+--- RH_2_6_9_55.orig/include/linux/dcache.h
++++ RH_2_6_9_55/include/linux/dcache.h
@@ -4,6 +4,7 @@
#ifdef __KERNEL__
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/cache.h>
-@@ -37,6 +38,8 @@
+@@ -37,6 +38,8 @@ struct qstr {
const unsigned char *name;
};
struct dentry_stat_t {
int nr_dentry;
int nr_unused;
-Index: linux-2.6.9-5.0.3.EL/include/linux/fs.h
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/include/linux/fs.h 2005-02-26 14:28:01.393225056 +0200
-+++ linux-2.6.9-5.0.3.EL/include/linux/fs.h 2005-02-26 14:32:04.745229928 +0200
-@@ -74,6 +74,7 @@
-
- #define FMODE_READ 1
- #define FMODE_WRITE 2
-+#define FMODE_EXEC 4
-
- /* Internal kernel extensions */
- #define FMODE_LSEEK 4
-@@ -258,6 +259,8 @@
+diff -rup RH_2_6_9_55.orig/include/linux/fs.h RH_2_6_9_55/include/linux/fs.h
+--- RH_2_6_9_55.orig/include/linux/fs.h
++++ RH_2_6_9_55/include/linux/fs.h
+@@ -266,6 +266,8 @@ typedef void (dio_iodone_t)(struct inode
#define ATTR_ATTR_FLAG 1024
#define ATTR_KILL_SUID 2048
#define ATTR_KILL_SGID 4096
/*
* This is the Inode Attributes structure, used for notify_change(). It
-@@ -456,6 +459,7 @@
+@@ -464,6 +466,7 @@ struct inode {
struct block_device *i_bdev;
struct cdev *i_cdev;
int i_cindex;
__u32 i_generation;
-@@ -589,6 +593,7 @@
+@@ -597,6 +600,7 @@ struct file {
spinlock_t f_ep_lock;
#endif /* #ifdef CONFIG_EPOLL */
struct address_space *f_mapping;
};
extern spinlock_t files_lock;
#define file_list_lock() spin_lock(&files_lock);
-@@ -934,7 +939,9 @@
+@@ -967,20 +971,29 @@ struct inode_operations {
+ int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
+ struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
+ int (*link) (struct dentry *,struct inode *,struct dentry *);
++ int (*link_raw) (struct nameidata *,struct nameidata *);
+ int (*unlink) (struct inode *,struct dentry *);
++ int (*unlink_raw) (struct nameidata *);
+ int (*symlink) (struct inode *,struct dentry *,const char *);
++ int (*symlink_raw) (struct nameidata *,const char *);
+ int (*mkdir) (struct inode *,struct dentry *,int);
++ int (*mkdir_raw) (struct nameidata *,int);
+ int (*rmdir) (struct inode *,struct dentry *);
++ int (*rmdir_raw) (struct nameidata *);
+ int (*mknod) (struct inode *,struct dentry *,int,dev_t);
++ int (*mknod_raw) (struct nameidata *,int,dev_t);
+ int (*rename) (struct inode *, struct dentry *,
+ struct inode *, struct dentry *);
++ int (*rename_raw) (struct nameidata *, struct nameidata *);
+ int (*readlink) (struct dentry *, char __user *,int);
+ int (*follow_link) (struct dentry *, struct nameidata *);
+ void (*put_link) (struct dentry *, struct nameidata *);
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int, struct nameidata *);
int (*setattr) (struct dentry *, struct iattr *);
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
ssize_t (*listxattr) (struct dentry *, char *, size_t);
-@@ -974,6 +981,7 @@
+@@ -1025,6 +1038,7 @@ struct super_operations {
int (*remount_fs) (struct super_block *, int *, char *);
void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *);
int (*show_options)(struct seq_file *, struct vfsmount *);
};
-@@ -1164,6 +1172,7 @@
+@@ -1217,6 +1231,7 @@ extern int unregister_filesystem(struct
extern struct vfsmount *kern_mount(struct file_system_type *);
extern int may_umount_tree(struct vfsmount *);
extern int may_umount(struct vfsmount *);
extern long do_mount(char *, char *, char *, unsigned long, void *);
extern int vfs_statfs(struct super_block *, struct kstatfs *);
-@@ -1228,6 +1237,7 @@
- extern int do_truncate(struct dentry *, loff_t start);
+@@ -1277,10 +1292,10 @@ static inline int break_lease(struct ino
+ }
+
+ /* fs/open.c */
+-
+ extern int do_truncate(struct dentry *, loff_t start, unsigned int);
extern struct file *filp_open(const char *, int, int);
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
+extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
extern int filp_close(struct file *, fl_owner_t id);
extern char * getname(const char __user *);
-Index: linux-2.6.9-5.0.3.EL/include/linux/namei.h
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/include/linux/namei.h 2005-02-26 14:28:01.396224600 +0200
-+++ linux-2.6.9-5.0.3.EL/include/linux/namei.h 2005-02-26 14:32:04.747229624 +0200
-@@ -2,14 +2,48 @@
+diff -rup RH_2_6_9_55.orig/include/linux/mount.h RH_2_6_9_55/include/linux/mount.h
+--- RH_2_6_9_55.orig/include/linux/mount.h
++++ RH_2_6_9_55/include/linux/mount.h
+@@ -34,6 +34,7 @@ struct vfsmount
+ struct list_head mnt_list;
+ struct list_head mnt_fslink; /* link in fs-specific expiry list */
+ struct namespace *mnt_namespace; /* containing namespace */
++ unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
+ };
+
+ static inline struct vfsmount *mntget(struct vfsmount *mnt)
+diff -rup RH_2_6_9_55.orig/include/linux/namei.h RH_2_6_9_55/include/linux/namei.h
+--- RH_2_6_9_55.orig/include/linux/namei.h
++++ RH_2_6_9_55/include/linux/namei.h
+@@ -2,14 +2,55 @@
#define _LINUX_NAMEI_H
#include <linux/linkage.h>
+ } d;
+};
+
++static inline void intent_reset_fs_part(struct lookup_intent *it)
++{
++ memset(&it->d, 0, sizeof(it->d));
++ it->it_magic = INTENT_MAGIC;
++ it->it_op_release = NULL;
++}
++
+static inline void intent_init(struct lookup_intent *it, int op)
+{
+ memset(it, 0, sizeof(*it));
enum { MAX_NESTED_LINKS = 8 };
struct nameidata {
-@@ -21,10 +56,7 @@
+@@ -21,10 +62,7 @@ struct nameidata {
unsigned depth;
char *saved_names[MAX_NESTED_LINKS + 1];
};
/*
-@@ -46,6 +78,8 @@
- #define LOOKUP_PARENT 16
+@@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
#define LOOKUP_NOALT 32
#define LOOKUP_ATOMIC 64
-+#define LOOKUP_LAST (0x1000)
-+#define LOOKUP_LINK_NOTLAST (0x2000)
+ #define LOOKUP_REVAL 128
++#define LOOKUP_LAST (0x1000)
++#define LOOKUP_LINK_NOTLAST (0x2000)
/*
* Intent data
-@@ -55,6 +89,12 @@
+@@ -56,11 +96,18 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
#define LOOKUP_ACCESS (0x0400)
extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
#define user_path_walk(name,nd) \
__user_walk(name, LOOKUP_FOLLOW, nd)
#define user_path_walk_link(name,nd) \
-@@ -67,7 +107,6 @@
-
- extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
- extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
--
- extern int follow_down(struct vfsmount **, struct dentry **);
- extern int follow_up(struct vfsmount **, struct dentry **);
-
-Index: linux-2.6.9-5.0.3.EL/include/linux/mount.h
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/include/linux/mount.h 2005-02-26 14:28:01.397224448 +0200
-+++ linux-2.6.9-5.0.3.EL/include/linux/mount.h 2005-02-26 14:32:04.748229472 +0200
-@@ -34,6 +34,8 @@
- struct list_head mnt_list;
- struct list_head mnt_fslink; /* link in fs-specific expiry list */
- struct namespace *mnt_namespace; /* containing namespace */
-+ struct list_head mnt_lustre_list; /* GNS mount list */
-+ unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
- };
-
- static inline struct vfsmount *mntget(struct vfsmount *mnt)
-Index: linux-2.6.9-5.0.3.EL/kernel/exit.c
-===================================================================
---- linux-2.6.9-5.0.3.EL.orig/kernel/exit.c 2005-02-26 14:28:01.399224144 +0200
-+++ linux-2.6.9-5.0.3.EL/kernel/exit.c 2005-02-26 14:32:04.750229168 +0200
-@@ -244,6 +244,8 @@
- write_unlock_irq(&tasklist_lock);
- }
-
-+EXPORT_SYMBOL(reparent_to_init);
-+
- void __set_special_pids(pid_t session, pid_t pgrp)
- {
- struct task_struct *curr = current;
-@@ -428,6 +430,8 @@
- __exit_files(tsk);
- }
-
-+EXPORT_SYMBOL(exit_files);
-+
- static inline void __put_fs_struct(struct fs_struct *fs)
- {
- /* No need to hold fs->lock if we are killing it */
+ __user_walk(name, 0, nd)
+ extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
++extern int FASTCALL(path_lookup_it(const char *, unsigned, struct nameidata *));
+ extern int FASTCALL(path_walk(const char *, struct nameidata *));
+ extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
+ extern void path_release(struct nameidata *);