----
- fs/exec.c | 14 ++++---
- fs/inode.c | 1
- fs/namei.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++---
- fs/namespace.c | 10 +++++
- fs/open.c | 40 ++++++++++++++------
- fs/stat.c | 24 +++++++++---
- include/linux/dcache.h | 3 +
- include/linux/fs.h | 10 +++++
- include/linux/mount.h | 2 +
- include/linux/namei.h | 61 ++++++++++++++++++++++++++----
- 10 files changed, 226 insertions(+), 37 deletions(-)
-
--- linux-2.6.10.orig/fs/exec.c
+++ linux-2.6.10/fs/exec.c
-@@ -124,9 +124,10 @@ asmlinkage long sys_uselib(const char __
+@@ -124,9 +124,10 @@
struct file * file;
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -138,7 +139,7 @@ asmlinkage long sys_uselib(const char __
+@@ -138,7 +139,7 @@
if (error)
goto exit;
error = PTR_ERR(file);
if (IS_ERR(file))
goto out;
-@@ -485,8 +486,9 @@ struct file *open_exec(const char *name)
+@@ -485,8 +486,9 @@
int err;
struct file *file;
file = ERR_PTR(err);
if (!err) {
-@@ -499,7 +501,7 @@ struct file *open_exec(const char *name)
+@@ -499,7 +501,7 @@
err = -EACCES;
file = ERR_PTR(err);
if (!err) {
if (err) {
--- linux-2.6.10.orig/fs/inode.c
+++ linux-2.6.10/fs/inode.c
-@@ -233,6 +233,7 @@ void __iget(struct inode * inode)
+@@ -233,6 +233,7 @@
inodes_stat.nr_unused--;
}
* @inode: inode to clear
--- linux-2.6.10.orig/fs/namei.c
+++ linux-2.6.10/fs/namei.c
-@@ -288,8 +288,19 @@ int deny_write_access(struct file * file
+@@ -288,8 +288,19 @@
return 0;
}
dput(nd->dentry);
mntput(nd->mnt);
}
-@@ -379,7 +390,10 @@ static struct dentry * real_lookup(struc
+@@ -379,7 +390,10 @@
{
struct dentry * result;
struct inode *dir = parent->d_inode;
down(&dir->i_sem);
/*
* First re-do the cached lookup just in case it was created
-@@ -418,7 +432,10 @@ static struct dentry * real_lookup(struc
+@@ -418,7 +432,10 @@
if (result->d_op && result->d_op->d_revalidate) {
if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) {
dput(result);
}
}
return result;
-@@ -449,6 +466,7 @@ static inline int __vfs_follow_link(stru
+@@ -449,6 +466,7 @@
{
int res = 0;
char *name;
if (IS_ERR(link))
goto fail;
-@@ -458,6 +476,7 @@ static inline int __vfs_follow_link(stru
+@@ -458,6 +476,7 @@
/* weird __emul_prefix() stuff did it */
goto out;
}
res = link_path_walk(link, nd);
out:
if (nd->depth || res || nd->last_type!=LAST_NORM)
-@@ -666,6 +685,33 @@ fail:
+@@ -666,6 +685,33 @@
return PTR_ERR(dentry);
}
/*
* Name resolution.
*
-@@ -767,8 +813,12 @@ int fastcall link_path_walk(const char *
+@@ -767,8 +813,12 @@
goto out_dput;
if (inode->i_op->follow_link) {
dput(next.dentry);
mntput(next.mnt);
if (err)
-@@ -807,14 +857,34 @@ last_component:
+@@ -807,14 +857,34 @@
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
if (err)
break;
follow_mount(&next.mnt, &next.dentry);
-@@ -1032,7 +1102,7 @@ struct dentry * lookup_hash(struct qstr
+@@ -1032,7 +1102,7 @@
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -1052,11 +1122,16 @@ struct dentry * lookup_one_len(const cha
+@@ -1052,11 +1122,16 @@
}
this.hash = end_name_hash(hash);
/*
* namei()
*
-@@ -1068,7 +1143,7 @@ access:
+@@ -1068,7 +1143,7 @@
* that namei follows links, while lnamei does not.
* SMP-safe
*/
{
char *tmp = getname(name);
int err = PTR_ERR(tmp);
-@@ -1080,6 +1155,12 @@ int fastcall __user_walk(const char __us
+@@ -1080,6 +1155,12 @@
return err;
}
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -1363,8 +1444,8 @@ int open_namei(const char * pathname, in
+@@ -1363,8 +1444,8 @@
acc_mode |= MAY_APPEND;
/* Fill in the open() intent data */
/*
* The simplest case - just a plain lookup.
-@@ -1379,6 +1460,7 @@ int open_namei(const char * pathname, in
+@@ -1379,6 +1460,7 @@
/*
* Create - we need to know the parent.
*/
error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
if (error)
return error;
-@@ -1395,7 +1477,9 @@ int open_namei(const char * pathname, in
+@@ -1395,7 +1477,9 @@
dir = nd->dentry;
nd->flags &= ~LOOKUP_PARENT;
down(&dir->d_inode->i_sem);
do_last:
error = PTR_ERR(dentry);
-@@ -1508,7 +1592,9 @@ do_link:
+@@ -1508,7 +1592,9 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
}
--- linux-2.6.10.orig/fs/namespace.c
+++ linux-2.6.10/fs/namespace.c
-@@ -62,6 +62,7 @@ struct vfsmount *alloc_vfsmnt(const char
+@@ -62,6 +62,7 @@
INIT_LIST_HEAD(&mnt->mnt_mounts);
INIT_LIST_HEAD(&mnt->mnt_list);
INIT_LIST_HEAD(&mnt->mnt_fslink);
if (name) {
int size = strlen(name)+1;
char *newname = kmalloc(size, GFP_KERNEL);
-@@ -113,6 +114,7 @@ static inline int check_mnt(struct vfsmo
+@@ -113,6 +114,7 @@
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;
-@@ -176,6 +178,9 @@ void __mntput(struct vfsmount *mnt)
+@@ -176,6 +178,9 @@
{
struct super_block *sb = mnt->mnt_sb;
dput(mnt->mnt_root);
free_vfsmnt(mnt);
deactivate_super(sb);
}
-@@ -402,6 +407,8 @@ static int do_umount(struct vfsmount *mn
+@@ -402,6 +407,8 @@
*/
lock_kernel();
if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
sb->s_op->umount_begin(sb);
unlock_kernel();
-@@ -627,6 +634,7 @@ static int do_loopback(struct nameidata
+@@ -627,6 +634,7 @@
return err;
if (!old_name || !*old_name)
return -EINVAL;
err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
if (err)
return err;
-@@ -701,6 +709,7 @@ static int do_move_mount(struct nameidat
+@@ -701,6 +709,7 @@
return -EPERM;
if (!old_name || !*old_name)
return -EINVAL;
err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
if (err)
return err;
-@@ -1012,6 +1021,7 @@ long do_mount(char * dev_name, char * di
+@@ -1012,6 +1021,7 @@
int retval = 0;
int mnt_flags = 0;
flags &= ~MS_MGC_MSK;
--- linux-2.6.10.orig/fs/open.c
+++ linux-2.6.10/fs/open.c
-@@ -216,12 +216,12 @@ static inline long do_sys_truncate(const
+@@ -216,12 +216,12 @@
struct nameidata nd;
struct inode * inode;
int error;
if (error)
goto out;
inode = nd.dentry->d_inode;
-@@ -475,6 +475,7 @@ asmlinkage long sys_access(const char __
+@@ -475,6 +475,7 @@
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;
-@@ -499,13 +500,14 @@ asmlinkage long sys_access(const char __
+@@ -499,13 +500,14 @@
else
current->cap_effective = current->cap_permitted;
path_release(&nd);
}
-@@ -520,8 +522,9 @@ asmlinkage long sys_chdir(const char __u
+@@ -520,8 +522,9 @@
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -573,8 +576,9 @@ asmlinkage long sys_chroot(const char __
+@@ -573,8 +576,9 @@
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -758,8 +762,10 @@ asmlinkage long sys_fchown(unsigned int
+@@ -758,8 +762,10 @@
struct file *filp_open(const char * filename, int flags, int mode)
{
int namei_flags, error;
namei_flags = flags;
if ((namei_flags+1) & O_ACCMODE)
namei_flags++;
-@@ -767,15 +773,26 @@ struct file *filp_open(const char * file
+@@ -767,15 +773,26 @@
namei_flags |= 2;
error = open_namei(filename, namei_flags, mode, &nd);
{
struct file * f;
struct inode *inode;
-@@ -787,6 +804,7 @@ struct file *dentry_open(struct dentry *
+@@ -787,6 +804,7 @@
goto cleanup_dentry;
f->f_flags = flags;
f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
inode = dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = get_write_access(inode);
-@@ -805,6 +823,7 @@ struct file *dentry_open(struct dentry *
+@@ -805,6 +823,7 @@
error = f->f_op->open(inode,f);
if (error)
goto cleanup_all;
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-@@ -830,13 +849,12 @@ cleanup_all:
+@@ -830,13 +849,12 @@
cleanup_file:
put_filp(f);
cleanup_dentry:
*/
--- linux-2.6.10.orig/fs/stat.c
+++ linux-2.6.10/fs/stat.c
-@@ -38,7 +38,7 @@ void generic_fillattr(struct inode *inod
+@@ -38,7 +38,7 @@
EXPORT_SYMBOL(generic_fillattr);
{
struct inode *inode = dentry->d_inode;
int retval;
-@@ -47,6 +47,8 @@ int vfs_getattr(struct vfsmount *mnt, st
+@@ -47,6 +47,8 @@
if (retval)
return retval;
if (inode->i_op->getattr)
return inode->i_op->getattr(mnt, dentry, stat);
-@@ -63,14 +65,20 @@ int vfs_getattr(struct vfsmount *mnt, st
+@@ -63,14 +65,20 @@
EXPORT_SYMBOL(vfs_getattr);
path_release(&nd);
}
return error;
-@@ -82,10 +90,11 @@ int vfs_lstat(char __user *name, struct
+@@ -82,10 +90,11 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -97,9 +106,12 @@ int vfs_fstat(unsigned int fd, struct ks
+@@ -97,9 +106,12 @@
{
struct file *f = fget(fd);
int error = -EBADF;
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/cache.h>
-@@ -37,6 +38,8 @@ struct qstr {
+@@ -37,6 +38,8 @@
const unsigned char *name;
};
int nr_unused;
--- linux-2.6.10.orig/include/linux/fs.h
+++ linux-2.6.10/include/linux/fs.h
-@@ -78,6 +78,7 @@ extern int dir_notify_enable;
+@@ -78,6 +78,7 @@
#define FMODE_READ 1
#define FMODE_WRITE 2
/* Internal kernel extensions */
#define FMODE_LSEEK 4
-@@ -262,6 +263,8 @@ typedef void (dio_iodone_t)(struct inode
+@@ -262,6 +263,8 @@
#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
-@@ -465,6 +468,7 @@ struct inode {
+@@ -465,6 +468,7 @@
struct block_device *i_bdev;
struct cdev *i_cdev;
int i_cindex;
__u32 i_generation;
-@@ -600,6 +604,7 @@ struct file {
+@@ -600,6 +604,7 @@
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);
-@@ -950,7 +955,9 @@ struct inode_operations {
+@@ -950,7 +955,9 @@
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);
-@@ -990,6 +997,7 @@ struct super_operations {
+@@ -990,6 +997,7 @@
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 *);
};
-@@ -1181,6 +1189,7 @@ extern int unregister_filesystem(struct
+@@ -1181,6 +1189,7 @@
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 *);
-@@ -1245,6 +1254,7 @@ static inline int break_lease(struct ino
+@@ -1245,6 +1254,7 @@
extern int do_truncate(struct dentry *, loff_t start);
extern struct file *filp_open(const char *, int, int);
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
--- linux-2.6.10.orig/include/linux/mount.h
+++ linux-2.6.10/include/linux/mount.h
-@@ -36,6 +36,8 @@ struct vfsmount
+@@ -36,6 +36,8 @@
struct list_head mnt_list;
struct list_head mnt_fslink; /* link in fs-specific expiry list */
struct namespace *mnt_namespace; /* containing namespace */
enum { MAX_NESTED_LINKS = 8 };
struct nameidata {
-@@ -21,10 +62,7 @@ struct nameidata {
+@@ -21,10 +62,7 @@
unsigned depth;
char *saved_names[MAX_NESTED_LINKS + 1];
};
/*
-@@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -47,6 +85,8 @@
#define LOOKUP_NOALT 32
#define LOOKUP_ATOMIC 64
#define LOOKUP_REVAL 128
/*
* Intent data
-@@ -56,6 +96,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -56,6 +96,12 @@
#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) \
-@@ -68,7 +114,6 @@ extern void path_release_on_umount(struc
+@@ -68,7 +114,6 @@
extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
----
- fs/exec.c | 14 ++++---
- fs/inode.c | 1
- fs/namei.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++---
- fs/namespace.c | 10 +++++
- fs/open.c | 57 ++++++++++++++--------------
- fs/stat.c | 24 +++++++++---
- include/linux/dcache.h | 3 +
- include/linux/fs.h | 10 +++++
- include/linux/mount.h | 2 +
- include/linux/namei.h | 61 ++++++++++++++++++++++++++----
- 10 files changed, 225 insertions(+), 55 deletions(-)
-
---- linux-2.6.9.orig/fs/exec.c
-+++ linux-2.6.9/fs/exec.c
+diff -urNp RH_2_6_9_42_0_3.orig/fs/cifs/dir.c RH_2_6_9_42_0_3/fs/cifs/dir.c
+--- RH_2_6_9_42_0_3.orig/fs/cifs/dir.c 2006-10-23 13:32:46.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/cifs/dir.c 2007-01-29 17:47:35.000000000 +0200
+@@ -146,23 +146,23 @@ cifs_create(struct inode *inode, struct
+ }
+
+ if(nd) {
+- if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY)
++ if ((nd->intent.it_flags & O_ACCMODE) == O_RDONLY)
+ desiredAccess = GENERIC_READ;
+- else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY) {
++ else if ((nd->intent.it_flags & O_ACCMODE) == O_WRONLY) {
+ desiredAccess = GENERIC_WRITE;
+ write_only = TRUE;
+- } else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
++ } else if ((nd->intent.it_flags & O_ACCMODE) == O_RDWR) {
+ /* GENERIC_ALL is too much permission to request */
+ /* can cause unnecessary access denied on create */
+ /* desiredAccess = GENERIC_ALL; */
+ desiredAccess = GENERIC_READ | GENERIC_WRITE;
+ }
+
+- if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
++ if((nd->intent.it_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
+ disposition = FILE_CREATE;
+- else if((nd->intent.open.flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
++ else if((nd->intent.it_flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
+ disposition = FILE_OVERWRITE_IF;
+- else if((nd->intent.open.flags & O_CREAT) == O_CREAT)
++ else if((nd->intent.it_flags & O_CREAT) == O_CREAT)
+ disposition = FILE_OPEN_IF;
+ else {
+ cFYI(1,("Create flag not set in create function"));
+diff -urNp RH_2_6_9_42_0_3.orig/fs/exec.c RH_2_6_9_42_0_3/fs/exec.c
+--- RH_2_6_9_42_0_3.orig/fs/exec.c 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/exec.c 2007-01-29 17:47:35.000000000 +0200
@@ -126,9 +126,10 @@ asmlinkage long sys_uselib(const char __
struct file * file;
struct nameidata nd;
- 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) {
if (!IS_ERR(file)) {
err = deny_write_access(file);
if (err) {
---- linux-2.6.9.orig/fs/inode.c
-+++ linux-2.6.9/fs/inode.c
+@@ -1536,7 +1538,7 @@ int do_coredump(long signr, int exit_cod
+ goto close_fail;
+ if (!file->f_op->write)
+ goto close_fail;
+- if (do_truncate(file->f_dentry, 0) != 0)
++ if (do_truncate(file->f_dentry, 0, 0) != 0)
+ goto close_fail;
+
+ retval = binfmt->core_dump(signr, regs, file);
+diff -urNp RH_2_6_9_42_0_3.orig/fs/inode.c RH_2_6_9_42_0_3/fs/inode.c
+--- RH_2_6_9_42_0_3.orig/fs/inode.c 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/inode.c 2007-01-29 17:47:35.000000000 +0200
@@ -235,6 +235,7 @@ void __iget(struct inode * inode)
inodes_stat.nr_unused--;
}
/**
* clear_inode - clear an inode
* @inode: inode to clear
---- linux-2.6.9.orig/fs/namei.c
-+++ linux-2.6.9/fs/namei.c
+diff -urNp RH_2_6_9_42_0_3.orig/fs/namei.c RH_2_6_9_42_0_3/fs/namei.c
+--- RH_2_6_9_42_0_3.orig/fs/namei.c 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/namei.c 2007-01-29 17:53:11.000000000 +0200
@@ -274,8 +274,19 @@ int deny_write_access(struct file * file
return 0;
}
+ }
goto return_reval;
}
-+
++
if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
err = nd->dentry->d_op->d_hash(nd->dentry, &this);
if (err < 0)
if (err)
break;
follow_mount(&next.mnt, &next.dentry);
-@@ -1053,7 +1123,7 @@ struct dentry * lookup_hash(struct qstr
+@@ -969,7 +1039,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;
+
+@@ -1003,6 +1073,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.
+@@ -1053,7 +1129,7 @@ struct dentry * lookup_hash(struct qstr
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -1073,11 +1143,16 @@ struct dentry * lookup_one_len(const cha
+@@ -1073,11 +1149,16 @@ struct dentry * lookup_one_len(const cha
}
this.hash = end_name_hash(hash);
/*
* namei()
*
-@@ -1089,7 +1164,7 @@ access:
+@@ -1089,18 +1170,24 @@ access:
* that namei follows links, while lnamei does not.
* SMP-safe
*/
{
char *tmp = getname(name);
int err = PTR_ERR(tmp);
-@@ -1101,6 +1176,12 @@ int fastcall __user_walk(const char __us
+
+ 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.
-@@ -1387,8 +1468,8 @@ int open_namei(const char * pathname, in
+@@ -1346,7 +1433,7 @@ int may_open(struct nameidata *nd, int a
+ if (!error) {
+ DQUOT_INIT(inode);
+
+- error = do_truncate(dentry, 0);
++ error = do_truncate(dentry, 0, 1);
+ }
+ put_write_access(inode);
+ if (error)
+@@ -1387,14 +1474,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.
-@@ -1403,6 +1484,7 @@ int open_namei(const char * pathname, in
+ */
+ 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;
+@@ -1403,7 +1490,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;
-@@ -1419,7 +1501,9 @@ int open_namei(const char * pathname, in
+
+@@ -1419,7 +1507,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);
-@@ -1532,7 +1616,9 @@ do_link:
+@@ -1532,7 +1622,9 @@ do_link:
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
__putname(nd->last.name);
goto do_last;
}
---- linux-2.6.9.orig/fs/namespace.c
-+++ linux-2.6.9/fs/namespace.c
+@@ -1606,10 +1698,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);
+
+@@ -1636,6 +1738,7 @@ asmlinkage long sys_mknod(const char __u
+ dput(dentry);
+ }
+ up(&nd.dentry->d_inode->i_sem);
++out2:
+ path_release(&nd);
+ out:
+ putname(tmp);
+@@ -1678,10 +1781,18 @@ 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)) {
+@@ -1691,6 +1802,7 @@ asmlinkage long sys_mkdir(const char __u
+ dput(dentry);
+ }
+ up(&nd.dentry->d_inode->i_sem);
++out2:
+ path_release(&nd);
+ out:
+ putname(tmp);
+@@ -1776,7 +1888,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;
+
+@@ -1791,6 +1904,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);
+@@ -1854,12 +1977,20 @@ 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);
+@@ -1927,10 +2058,18 @@ 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)) {
+@@ -1938,6 +2077,7 @@ asmlinkage long sys_symlink(const char _
+ dput(dentry);
+ }
+ up(&nd.dentry->d_inode->i_sem);
++out2:
+ path_release(&nd);
+ out:
+ putname(to);
+@@ -2007,15 +2147,25 @@ 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)) {
+@@ -2191,11 +2341,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;
+
+@@ -2212,6 +2364,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);
+@@ -2243,8 +2402,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:
+@@ -2435,6 +2593,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 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/namespace.c 2007-01-29 17:47:35.000000000 +0200
@@ -61,6 +61,7 @@ struct vfsmount *alloc_vfsmnt(const char
INIT_LIST_HEAD(&mnt->mnt_mounts);
INIT_LIST_HEAD(&mnt->mnt_list);
if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
sb->s_op->umount_begin(sb);
unlock_kernel();
-@@ -627,6 +634,7 @@ static int do_loopback(struct nameidata
+@@ -627,7 +634,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 @@ static int do_move_mount(struct nameidat
+
+@@ -701,7 +709,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 @@ long do_mount(char * dev_name, char * di
- 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;
---- linux-2.6.9.orig/fs/open.c
-+++ linux-2.6.9/fs/open.c
-@@ -216,12 +216,12 @@ static inline long do_sys_truncate(const
+@@ -1036,7 +1045,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 -urNp RH_2_6_9_42_0_3.orig/fs/nfs/dir.c RH_2_6_9_42_0_3/fs/nfs/dir.c
+--- RH_2_6_9_42_0_3.orig/fs/nfs/dir.c 2006-10-23 13:32:56.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/nfs/dir.c 2007-01-29 17:47:35.000000000 +0200
+@@ -827,7 +827,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)
+@@ -902,7 +902,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;
+ }
+@@ -923,7 +923,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 */
+@@ -935,7 +935,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);
+@@ -954,7 +954,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:
+@@ -992,7 +992,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;
+@@ -1200,7 +1200,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 -urNp RH_2_6_9_42_0_3.orig/fs/nfs/nfs4proc.c RH_2_6_9_42_0_3/fs/nfs/nfs4proc.c
+--- RH_2_6_9_42_0_3.orig/fs/nfs/nfs4proc.c 2006-10-23 13:32:56.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/nfs/nfs4proc.c 2007-01-29 17:47:35.000000000 +0200
+@@ -803,17 +803,17 @@ nfs4_atomic_open(struct inode *dir, stru
+ struct nfs4_state *state;
+
+ 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);
+ }
+
+ 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))
+ return (struct inode *)state;
+diff -urNp RH_2_6_9_42_0_3.orig/fs/open.c RH_2_6_9_42_0_3/fs/open.c
+--- RH_2_6_9_42_0_3.orig/fs/open.c 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/open.c 2007-01-29 17:47:35.000000000 +0200
+@@ -192,9 +192,10 @@ out:
+ return error;
+ }
+
+-int do_truncate(struct dentry *dentry, loff_t length)
++int do_truncate(struct dentry *dentry, loff_t length, int called_from_open)
+ {
+ 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. */
+@@ -205,7 +206,14 @@ int do_truncate(struct dentry *dentry, l
+ newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
+ down(&dentry->d_inode->i_sem);
+ down_write(&dentry->d_inode->i_alloc_sem);
+- err = notify_change(dentry, &newattrs);
++ if (called_from_open)
++ newattrs.ia_valid |= ATTR_FROM_OPEN;
++ if (op->setattr_raw) {
++ newattrs.ia_valid |= ATTR_RAW;
++ newattrs.ia_ctime = CURRENT_TIME;
++ err = op->setattr_raw(dentry->d_inode, &newattrs);
++ } else
++ err = notify_change(dentry, &newattrs);
+ up_write(&dentry->d_inode->i_alloc_sem);
+ up(&dentry->d_inode->i_sem);
+ return err;
+@@ -216,12 +224,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;
-@@ -475,6 +475,7 @@ asmlinkage long sys_access(const char __
+@@ -261,7 +270,7 @@ static inline long do_sys_truncate(const
+ error = locks_verify_truncate(inode, NULL, length);
+ if (!error) {
+ DQUOT_INIT(inode);
+- error = do_truncate(nd.dentry, length);
++ error = do_truncate(nd.dentry, length, 0);
+ }
+ put_write_access(inode);
+
+@@ -313,7 +322,7 @@ static inline long do_sys_ftruncate(unsi
+
+ error = locks_verify_truncate(inode, file, length);
+ if (!error)
+- error = do_truncate(dentry, length);
++ error = do_truncate(dentry, length, 0);
+ out_putf:
+ fput(file);
+ out:
+@@ -392,9 +401,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:
+@@ -445,9 +464,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:
+@@ -475,6 +504,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;
-@@ -499,13 +500,14 @@ asmlinkage long sys_access(const char __
+@@ -499,13 +529,14 @@ asmlinkage long sys_access(const char __
else
current->cap_effective = current->cap_permitted;
path_release(&nd);
}
-@@ -520,8 +522,9 @@ asmlinkage long sys_chdir(const char __u
+@@ -520,8 +551,9 @@ asmlinkage long sys_chdir(const char __u
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -573,8 +576,9 @@ asmlinkage long sys_chroot(const char __
+@@ -573,8 +605,9 @@ asmlinkage long sys_chroot(const char __
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -741,8 +745,6 @@ asmlinkage long sys_fchown(unsigned int
+@@ -597,36 +630,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;
+@@ -635,32 +684,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;
+-
+- error = -EPERM;
+- if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+- goto dput_and_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;
+- error = notify_change(nd.dentry, &newattrs);
+- up(&inode->i_sem);
+-
+-dput_and_out:
++ error = chmod_common(nd.dentry, mode);
+ path_release(&nd);
+ out:
+ return error;
+@@ -681,6 +711,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;
+@@ -694,6 +736,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);
+@@ -741,8 +784,6 @@ asmlinkage long sys_fchown(unsigned int
return error;
}
/*
* Note that while the flag value (low two bits) for sys_open means:
* 00 - read-only
-@@ -760,8 +762,9 @@ static struct file *__dentry_open(struct
+@@ -760,8 +801,9 @@ static struct file *__dentry_open(struct
struct file *filp_open(const char * filename, int flags, int mode)
{
int namei_flags, error;
namei_flags = flags;
if ((namei_flags+1) & O_ACCMODE)
-@@ -769,16 +772,11 @@ struct file *filp_open(const char * file
+@@ -769,16 +811,11 @@ struct file *filp_open(const char * file
if (namei_flags & O_TRUNC)
namei_flags |= 2;
+ if (!error) {
+ temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
+ return temp_filp;
-+ }
++ }
return ERR_PTR(error);
}
-@@ -786,29 +784,27 @@ EXPORT_SYMBOL(filp_open);
+@@ -786,29 +823,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) {
- mntput(mnt);
- return ERR_PTR(error);
- }
-+ struct lookup_intent it;
-+ intent_init(&it, IT_LOOKUP);
-
+-
- return __dentry_open(dentry, mnt, flags, f);
+ return dentry_open_it(dentry, mnt, flags, &it);
}
inode = dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = get_write_access(inode);
-@@ -827,6 +823,7 @@ static struct file *__dentry_open(struct
+@@ -827,6 +862,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);
-@@ -851,6 +848,8 @@ cleanup_all:
+@@ -851,6 +887,8 @@ cleanup_all:
f->f_vfsmnt = NULL;
cleanup_file:
put_filp(f);
dput(dentry);
mntput(mnt);
return ERR_PTR(error);
---- linux-2.6.9.orig/fs/stat.c
-+++ linux-2.6.9/fs/stat.c
+diff -urNp RH_2_6_9_42_0_3.orig/fs/stat.c RH_2_6_9_42_0_3/fs/stat.c
+--- RH_2_6_9_42_0_3.orig/fs/stat.c 2004-10-19 00:53:37.000000000 +0300
++++ RH_2_6_9_42_0_3/fs/stat.c 2007-01-29 17:47:35.000000000 +0200
@@ -37,7 +37,7 @@ void generic_fillattr(struct inode *inod
EXPORT_SYMBOL(generic_fillattr);
fput(f);
}
return error;
---- linux-2.6.9.orig/include/linux/dcache.h
-+++ linux-2.6.9/include/linux/dcache.h
+diff -urNp RH_2_6_9_42_0_3.orig/include/linux/dcache.h RH_2_6_9_42_0_3/include/linux/dcache.h
+--- RH_2_6_9_42_0_3.orig/include/linux/dcache.h 2006-10-23 13:33:00.000000000 +0300
++++ RH_2_6_9_42_0_3/include/linux/dcache.h 2007-01-29 17:47:35.000000000 +0200
@@ -4,6 +4,7 @@
#ifdef __KERNEL__
struct dentry_stat_t {
int nr_dentry;
int nr_unused;
---- linux-2.6.9.orig/include/linux/fs.h
-+++ linux-2.6.9/include/linux/fs.h
-@@ -81,6 +81,11 @@ extern int leases_enable, dir_notify_ena
- #define FMODE_PREAD 8
- #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
-
-+/* File is being opened for execution. Primary users of this flag are
-+ distributed filesystems that can use it to achieve correct ETXTBUSY
-+ behavior for cross-node execution/opening_for_writing of files */
-+#define FMODE_EXEC 16
-+
- #define RW_MASK 1
- #define RWA_MASK 2
- #define READ 0
+diff -urNp RH_2_6_9_42_0_3.orig/include/linux/fs.h RH_2_6_9_42_0_3/include/linux/fs.h
+--- RH_2_6_9_42_0_3.orig/include/linux/fs.h 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/include/linux/fs.h 2007-01-29 17:47:35.000000000 +0200
+@@ -75,6 +75,7 @@ extern int leases_enable, dir_notify_ena
+
+ #define FMODE_READ 1
+ #define FMODE_WRITE 2
++#define FMODE_EXEC 4
+
+ /* Internal kernel extensions */
+ #define FMODE_LSEEK 4
@@ -259,6 +260,8 @@ typedef void (dio_iodone_t)(struct inode
#define ATTR_ATTR_FLAG 1024
#define ATTR_KILL_SUID 2048
};
extern spinlock_t files_lock;
#define file_list_lock() spin_lock(&files_lock);
-@@ -962,7 +967,9 @@ struct inode_operations {
+@@ -949,20 +954,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);
-@@ -1002,6 +1009,7 @@ struct super_operations {
+@@ -1002,6 +1016,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 *);
};
-@@ -1194,6 +1202,7 @@ extern int unregister_filesystem(struct
+@@ -1194,6 +1209,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 *);
-@@ -1258,6 +1267,7 @@ static inline int break_lease(struct ino
- extern int do_truncate(struct dentry *, loff_t start);
+@@ -1255,9 +1271,10 @@ static inline int break_lease(struct ino
+
+ /* fs/open.c */
+
+-extern int do_truncate(struct dentry *, loff_t start);
++extern int do_truncate(struct dentry *, loff_t start, int called_from_open);
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 *);
---- linux-2.6.9.orig/include/linux/mount.h
-+++ linux-2.6.9/include/linux/mount.h
+diff -urNp RH_2_6_9_42_0_3.orig/include/linux/mount.h RH_2_6_9_42_0_3/include/linux/mount.h
+--- RH_2_6_9_42_0_3.orig/include/linux/mount.h 2004-10-19 00:53:11.000000000 +0300
++++ RH_2_6_9_42_0_3/include/linux/mount.h 2007-01-29 17:47:35.000000000 +0200
@@ -34,6 +34,8 @@ struct vfsmount
struct list_head mnt_list;
struct list_head mnt_fslink; /* link in fs-specific expiry list */
};
static inline struct vfsmount *mntget(struct vfsmount *mnt)
---- linux-2.6.9.orig/include/linux/namei.h
-+++ linux-2.6.9/include/linux/namei.h
+diff -urNp RH_2_6_9_42_0_3.orig/include/linux/namei.h RH_2_6_9_42_0_3/include/linux/namei.h
+--- RH_2_6_9_42_0_3.orig/include/linux/namei.h 2006-10-23 13:33:09.000000000 +0300
++++ RH_2_6_9_42_0_3/include/linux/namei.h 2007-01-29 17:47:47.000000000 +0200
@@ -2,14 +2,55 @@
#define _LINUX_NAMEI_H
/*
* Intent data
-@@ -56,6 +96,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -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) \
-@@ -68,7 +114,6 @@ extern void path_release_on_umount(struc
-
- 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 **);
-
+ __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 *);
----
- fs/9p/vfs_inode.c | 2
- fs/exec.c | 8 ++
- fs/fuse/dir.c | 2
- fs/inode.c | 1
- fs/namei.c | 137 ++++++++++++++++++++++++++++++++++++++++++-------
- fs/namespace.c | 10 +++
- fs/nfsctl.c | 1
- fs/open.c | 31 ++++++-----
- fs/stat.c | 24 ++++++--
- include/linux/dcache.h | 3 +
- include/linux/fs.h | 10 +++
- include/linux/mount.h | 2
- include/linux/namei.h | 65 ++++++++++++++++++++---
- 13 files changed, 248 insertions(+), 48 deletions(-)
-
---- linux-2.6.16.21-0.8.orig/fs/inode.c
-+++ linux-2.6.16.21-0.8/fs/inode.c
-@@ -236,6 +236,7 @@ void __iget(struct inode * inode)
- inodes_stat.nr_unused--;
- }
-
-+EXPORT_SYMBOL(__iget);
- /**
- * clear_inode - clear an inode
- * @inode: inode to clear
---- linux-2.6.16.21-0.8.orig/fs/open.c
-+++ linux-2.6.16.21-0.8/fs/open.c
-@@ -224,12 +224,12 @@ static long do_sys_truncate(const char _
- 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);
-+ error = user_path_walk_it(path, &nd);
- if (error)
- goto out;
- inode = nd.dentry->d_inode;
-@@ -494,6 +494,7 @@ asmlinkage long sys_faccessat(int dfd, c
- int old_fsuid, old_fsgid;
- kernel_cap_t old_cap;
- int res;
-+ intent_init(&nd.intent, IT_GETATTR);
+diff -urNp linux-2.6.16.21-0.8.orig/fs/9p/vfs_inode.c linux-2.6.16.21-0.8/fs/9p/vfs_inode.c
+--- linux-2.6.16.21-0.8.orig/fs/9p/vfs_inode.c 2006-10-04 02:18:10.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/9p/vfs_inode.c 2007-01-29 18:20:42.000000000 +0200
+@@ -469,7 +469,7 @@ v9fs_vfs_create(struct inode *dir, struc
+ perm = unixmode2p9mode(v9ses, mode);
- if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
- return -EINVAL;
-@@ -518,7 +519,7 @@ asmlinkage long sys_faccessat(int dfd, c
+ if (nd && nd->flags & LOOKUP_OPEN)
+- flags = nd->intent.open.flags - 1;
++ flags = nd->intent.flags - 1;
else
- current->cap_effective = current->cap_permitted;
+ flags = O_RDWR;
-- res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
-+ res = __user_walk_fd_it(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
- if (!res) {
- res = vfs_permission(&nd, mode);
- /* SuS v2 requires we report a read only fs too */
-@@ -544,8 +545,9 @@ asmlinkage long sys_chdir(const char __u
- {
- struct nameidata nd;
- int error;
-+ intent_init(&nd.intent, IT_GETATTR);
+diff -urNp linux-2.6.16.21-0.8.orig/fs/cifs/dir.c linux-2.6.16.21-0.8/fs/cifs/dir.c
+--- linux-2.6.16.21-0.8.orig/fs/cifs/dir.c 2006-10-04 02:18:10.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/cifs/dir.c 2007-01-29 18:20:42.000000000 +0200
+@@ -147,7 +147,7 @@ cifs_create(struct inode *inode, struct
+ }
-- error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
-+ error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
- if (error)
- goto out;
+ if(nd && (nd->flags & LOOKUP_OPEN)) {
+- int oflags = nd->intent.open.flags;
++ int oflags = nd->intent.flags;
-@@ -595,8 +597,9 @@ asmlinkage long sys_chroot(const char __
- {
+ desiredAccess = 0;
+ if (oflags & FMODE_READ)
+diff -urNp linux-2.6.16.21-0.8.orig/fs/exec.c linux-2.6.16.21-0.8/fs/exec.c
+--- linux-2.6.16.21-0.8.orig/fs/exec.c 2006-10-04 02:18:10.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/exec.c 2007-01-29 18:20:42.000000000 +0200
+@@ -128,7 +128,9 @@ asmlinkage long sys_uselib(const char __
struct nameidata nd;
int error;
-+ intent_init(&nd.intent, IT_GETATTR);
-- error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
-+ error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
+- error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd, FMODE_READ);
++ intent_init(&nd.intent, IT_OPEN);
++ error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd,
++ FMODE_READ | FMODE_EXEC);
if (error)
goto out;
-@@ -817,6 +820,7 @@ static struct file *__dentry_open(struct
- error = open(inode, f);
- if (error)
- goto cleanup_all;
-+ intent_release(f->f_it);
- }
-
- f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-@@ -843,6 +847,7 @@ cleanup_all:
- f->f_dentry = NULL;
- f->f_vfsmnt = NULL;
- cleanup_file:
-+ intent_release(f->f_it);
- put_filp(f);
- dput(dentry);
- mntput(mnt);
-@@ -868,6 +873,7 @@ static struct file *do_filp_open(int dfd
- {
- int namei_flags, error;
- struct nameidata nd;
-+ intent_init(&nd.intent, IT_OPEN);
+@@ -478,7 +480,9 @@ struct file *open_exec(const char *name)
+ int err;
+ struct file *file;
- namei_flags = flags;
- if ((namei_flags+1) & O_ACCMODE)
-@@ -904,19 +910,19 @@ EXPORT_SYMBOL(filp_open);
- struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
- int (*open)(struct inode *, struct file *))
- {
-- if (IS_ERR(nd->intent.open.file))
-+ if (IS_ERR(nd->intent.file))
- goto out;
- if (IS_ERR(dentry))
- goto out_err;
-- nd->intent.open.file = __dentry_open(dget(dentry), mntget(nd->mnt),
-- nd->intent.open.flags - 1,
-- nd->intent.open.file,
-+ nd->intent.file = __dentry_open(dget(dentry), mntget(nd->mnt),
-+ nd->intent.flags - 1,
-+ nd->intent.file,
- open);
- out:
-- return nd->intent.open.file;
-+ return nd->intent.file;
- out_err:
- release_open_intent(nd);
-- nd->intent.open.file = (struct file *)dentry;
-+ nd->intent.file = (struct file *)dentry;
- goto out;
- }
- EXPORT_SYMBOL_GPL(lookup_instantiate_filp);
-@@ -933,7 +939,8 @@ struct file *nameidata_to_filp(struct na
- struct file *filp;
+- err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd, FMODE_READ);
++ intent_init(&nd.intent, IT_OPEN);
++ err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd,
++ FMODE_READ | FMODE_EXEC, 0);
+ file = ERR_PTR(err);
- /* Pick up the filp from the open intent */
-- filp = nd->intent.open.file;
-+ filp = nd->intent.file;
-+ filp->f_it = &nd->intent;
- /* Has the filesystem initialised the file for us? */
- if (filp->f_dentry == NULL)
- filp = __dentry_open(nd->dentry, nd->mnt, flags, filp, NULL);
---- linux-2.6.16.21-0.8.orig/fs/nfsctl.c
-+++ linux-2.6.16.21-0.8/fs/nfsctl.c
-@@ -26,6 +26,7 @@ static struct file *do_open(char *name,
- struct nameidata nd;
- int error;
+ if (!err) {
+@@ -1520,7 +1524,7 @@ int do_coredump(long signr, int exit_cod
+ goto close_fail;
+ if (!file->f_op->write)
+ goto close_fail;
+- if (do_truncate(file->f_dentry, 0, 0, file) != 0)
++ if (do_truncate(file->f_dentry, 0, 0, file, 0) != 0)
+ goto close_fail;
+
+ retval = binfmt->core_dump(signr, regs, file);
+diff -urNp linux-2.6.16.21-0.8.orig/fs/fuse/dir.c linux-2.6.16.21-0.8/fs/fuse/dir.c
+--- linux-2.6.16.21-0.8.orig/fs/fuse/dir.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/fuse/dir.c 2007-01-29 18:20:42.000000000 +0200
+@@ -242,7 +242,7 @@ static int fuse_create_open(struct inode
+ struct fuse_entry_out outentry;
+ struct fuse_file *ff;
+ struct file *file;
+- int flags = nd->intent.open.flags - 1;
++ int flags = nd->intent.flags - 1;
-+ intent_init(&nd.intent, IT_OPEN);
- nd.mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
+ err = -ENOSYS;
+ if (fc->no_create)
+diff -urNp linux-2.6.16.21-0.8.orig/fs/inode.c linux-2.6.16.21-0.8/fs/inode.c
+--- linux-2.6.16.21-0.8.orig/fs/inode.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/inode.c 2007-01-29 18:20:42.000000000 +0200
+@@ -236,6 +236,7 @@ void __iget(struct inode * inode)
+ inodes_stat.nr_unused--;
+ }
- if (IS_ERR(nd.mnt))
---- linux-2.6.16.21-0.8.orig/fs/namei.c
-+++ linux-2.6.16.21-0.8/fs/namei.c
++EXPORT_SYMBOL(__iget);
+ /**
+ * clear_inode - clear an inode
+ * @inode: inode to clear
+diff -urNp linux-2.6.16.21-0.8.orig/fs/namei.c linux-2.6.16.21-0.8/fs/namei.c
+--- linux-2.6.16.21-0.8.orig/fs/namei.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/namei.c 2007-01-29 18:21:10.000000000 +0200
@@ -337,8 +337,19 @@ int deny_write_access(struct file * file
return 0;
}
if (err)
break;
inode = next.dentry->d_inode;
-@@ -1148,13 +1218,13 @@ static int __path_lookup_intent_open(int
+@@ -1066,7 +1136,7 @@ set_it:
+ }
+
+ /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
+-static int fastcall do_path_lookup(int dfd, const char *name,
++static int fastcall do_path_lookup_it(int dfd, const char *name,
+ unsigned int flags, struct nameidata *nd)
+ {
+ int retval = 0;
+@@ -1133,10 +1203,23 @@ unlock_fail:
+ return retval;
+ }
+
+-int fastcall path_lookup(const char *name, unsigned int flags,
++static int fastcall do_path_lookup(int dfd, const char *name,
++ unsigned int flags, struct nameidata *nd)
++{
++ intent_init(&nd->intent, IT_GETATTR);
++ return do_path_lookup_it(dfd, name, flags, nd);
++}
++
++int fastcall path_lookup_it(const char *name, unsigned int flags,
+ struct nameidata *nd)
+ {
+- return do_path_lookup(AT_FDCWD, name, flags, nd);
++ return do_path_lookup_it(AT_FDCWD, name, flags, nd);
++}
++
++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);
+ }
+
+ static int __path_lookup_intent_open(int dfd, const char *name,
+@@ -1148,13 +1231,13 @@ static int __path_lookup_intent_open(int
if (filp == NULL)
return -ENFILE;
- nd->intent.open.file = filp;
- nd->intent.open.flags = open_flags;
- nd->intent.open.create_mode = create_mode;
+- err = do_path_lookup(dfd, name, lookup_flags|LOOKUP_OPEN, nd);
+- if (IS_ERR(nd->intent.open.file)) {
+ nd->intent.file = filp;
+ nd->intent.flags = open_flags;
+ nd->intent.create_mode = create_mode;
- err = do_path_lookup(dfd, name, lookup_flags|LOOKUP_OPEN, nd);
-- if (IS_ERR(nd->intent.open.file)) {
++ err = do_path_lookup_it(dfd, name, lookup_flags|LOOKUP_OPEN, nd);
+ if (IS_ERR(nd->intent.file)) {
if (err == 0) {
- err = PTR_ERR(nd->intent.open.file);
path_release(nd);
}
} else if (err != 0)
-@@ -1257,7 +1327,7 @@ struct dentry * lookup_hash(struct namei
+@@ -1171,10 +1254,10 @@ static int __path_lookup_intent_open(int
+ * @open_flags: open intent flags
+ */
+ int path_lookup_open(int dfd, const char *name, unsigned int lookup_flags,
+- struct nameidata *nd, int open_flags)
++ struct nameidata *nd, int open_flags, int create_mode)
+ {
+ return __path_lookup_intent_open(dfd, name, lookup_flags, nd,
+- open_flags, 0);
++ open_flags, create_mode);
+ }
+
+ /**
+@@ -1257,7 +1340,7 @@ struct dentry * lookup_hash(struct namei
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -1277,11 +1347,17 @@ struct dentry * lookup_one_len(const cha
+@@ -1277,11 +1360,17 @@ struct dentry * lookup_one_len(const cha
}
this.hash = end_name_hash(hash);
/*
* namei()
*
-@@ -1293,8 +1369,9 @@ access:
+@@ -1293,22 +1382,36 @@ access:
* that namei follows links, while lnamei does not.
* SMP-safe
*/
{
char *tmp = getname(name);
int err = PTR_ERR(tmp);
-@@ -1306,9 +1383,22 @@ int fastcall __user_walk_fd(int dfd, con
+
+ if (!IS_ERR(tmp)) {
+- err = do_path_lookup(dfd, tmp, flags, nd);
++ err = do_path_lookup_it(dfd, tmp, flags, nd);
+ putname(tmp);
+ }
return err;
}
}
/*
-@@ -1588,6 +1678,8 @@ int open_namei(int dfd, const char *path
- if (flag & O_APPEND)
- acc_mode |= MAY_APPEND;
-
-+ nd->intent.it_flags = flag;
-+ nd->intent.it_create_mode = mode;
- /*
- * The simplest case - just a plain lookup.
+@@ -1543,7 +1646,7 @@ int may_open(struct nameidata *nd, int a
+ if (!error) {
+ DQUOT_INIT(inode);
+
+- error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME, NULL);
++ error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME, NULL, 1);
+ }
+ put_write_access(inode);
+ if (error)
+@@ -1593,7 +1696,7 @@ int open_namei(int dfd, const char *path
*/
-@@ -1602,6 +1694,7 @@ int open_namei(int dfd, const char *path
+ if (!(flag & O_CREAT)) {
+ error = path_lookup_open(dfd, pathname, lookup_flags(flag),
+- nd, flag);
++ nd, flag, mode);
+ if (error)
+ return error;
+ goto ok;
+@@ -1602,6 +1705,7 @@ int open_namei(int dfd, const char *path
/*
* Create - we need to know the parent.
*/
error = path_lookup_create(dfd,pathname,LOOKUP_PARENT,nd,flag,mode);
if (error)
return error;
-@@ -1618,7 +1711,9 @@ int open_namei(int dfd, const char *path
+@@ -1618,7 +1722,9 @@ int open_namei(int dfd, const char *path
dir = nd->dentry;
nd->flags &= ~LOOKUP_PARENT;
mutex_lock(&dir->d_inode->i_mutex);
path.mnt = nd->mnt;
do_last:
-@@ -1628,9 +1723,9 @@ do_last:
+@@ -1628,9 +1734,9 @@ do_last:
goto exit;
}
goto exit_dput;
}
-@@ -1683,7 +1778,7 @@ ok:
+@@ -1683,7 +1789,7 @@ ok:
exit_dput:
dput_path(&path, nd);
exit:
release_open_intent(nd);
path_release(nd);
return error;
-@@ -1726,7 +1821,9 @@ do_link:
+@@ -1726,7 +1832,9 @@ do_link:
}
dir = nd->dentry;
mutex_lock(&dir->d_inode->i_mutex);
path.mnt = nd->mnt;
__putname(nd->last.name);
goto do_last;
-@@ -2238,6 +2335,8 @@ asmlinkage long sys_linkat(int olddfd, c
- int error;
- char * to;
+@@ -1811,15 +1919,26 @@ asmlinkage long sys_mknodat(int dfd, con
+ struct dentry * dentry;
+ struct nameidata nd;
+
++
+ if (S_ISDIR(mode))
+ return -EPERM;
+ tmp = getname(filename);
+ if (IS_ERR(tmp))
+ return PTR_ERR(tmp);
+- error = do_path_lookup(dfd, tmp, LOOKUP_PARENT, &nd);
+ intent_init(&nd.intent, IT_LOOKUP);
-+ intent_init(&old_nd.intent, IT_LOOKUP);
- if (flags != 0)
- return -EINVAL;
++ error = do_path_lookup_it(dfd, 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);
+
+@@ -1846,6 +1965,7 @@ asmlinkage long sys_mknodat(int dfd, con
+ dput(dentry);
+ }
+ mutex_unlock(&nd.dentry->d_inode->i_mutex);
++out2:
+ path_release(&nd);
+ out:
+ putname(tmp);
+@@ -1891,9 +2011,18 @@ asmlinkage long sys_mkdirat(int dfd, con
+ struct dentry *dentry;
+ struct nameidata nd;
+
+- error = do_path_lookup(dfd, tmp, LOOKUP_PARENT, &nd);
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(dfd, 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)) {
+@@ -1903,6 +2032,7 @@ asmlinkage long sys_mkdirat(int dfd, con
+ dput(dentry);
+ }
+ mutex_unlock(&nd.dentry->d_inode->i_mutex);
++out2:
+ path_release(&nd);
+ out:
+ putname(tmp);
+@@ -1987,8 +2117,9 @@ static long do_rmdir(int dfd, const char
+ name = getname(pathname);
+ if(IS_ERR(name))
+ return PTR_ERR(name);
+-
+- error = do_path_lookup(dfd, name, LOOKUP_PARENT, &nd);
++
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(dfd, name, LOOKUP_PARENT, &nd);
+ if (error)
+ goto exit;
-@@ -2245,7 +2344,7 @@ asmlinkage long sys_linkat(int olddfd, c
+@@ -2003,6 +2134,14 @@ static long do_rmdir(int dfd, const char
+ 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;
++ }
+ mutex_lock(&nd.dentry->d_inode->i_mutex);
+ dentry = lookup_hash(&nd);
+ error = PTR_ERR(dentry);
+@@ -2071,12 +2210,20 @@ static long do_unlinkat(int dfd, const c
+ if(IS_ERR(name))
+ return PTR_ERR(name);
+
+- error = do_path_lookup(dfd, name, LOOKUP_PARENT, &nd);
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(dfd, 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;
++ }
+ mutex_lock(&nd.dentry->d_inode->i_mutex);
+ dentry = lookup_hash(&nd);
+ error = PTR_ERR(dentry);
+@@ -2159,9 +2306,17 @@ asmlinkage long sys_symlinkat(const char
+ struct dentry *dentry;
+ struct nameidata nd;
+
+- error = do_path_lookup(newdfd, to, LOOKUP_PARENT, &nd);
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(newdfd, 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)) {
+@@ -2169,6 +2324,7 @@ asmlinkage long sys_symlinkat(const char
+ dput(dentry);
+ }
+ mutex_unlock(&nd.dentry->d_inode->i_mutex);
++out2:
+ path_release(&nd);
+ out:
+ putname(to);
+@@ -2245,15 +2401,25 @@ asmlinkage long sys_linkat(int olddfd, c
if (IS_ERR(to))
return PTR_ERR(to);
- error = __user_walk_fd(olddfd, oldname, 0, &old_nd);
++ intent_init(&old_nd.intent, IT_LOOKUP);
+ error = __user_walk_fd_it(olddfd, oldname, 0, &old_nd);
if (error)
goto exit;
- error = do_path_lookup(newdfd, to, LOOKUP_PARENT, &nd);
---- linux-2.6.16.21-0.8.orig/fs/stat.c
-+++ linux-2.6.16.21-0.8/fs/stat.c
-@@ -38,7 +38,7 @@ void generic_fillattr(struct inode *inod
-
- EXPORT_SYMBOL(generic_fillattr);
-
--int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
-+int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
- {
- struct inode *inode = dentry->d_inode;
- int retval;
-@@ -47,6 +47,8 @@ int vfs_getattr(struct vfsmount *mnt, st
- if (retval)
- return retval;
-
-+ if (inode->i_op->getattr_it)
-+ return inode->i_op->getattr_it(mnt, dentry, it, stat);
- if (inode->i_op->getattr)
- return inode->i_op->getattr(mnt, dentry, stat);
+- error = do_path_lookup(newdfd, to, LOOKUP_PARENT, &nd);
++
++ intent_init(&nd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(newdfd, 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)) {
+@@ -2430,12 +2596,14 @@ static int do_rename(int olddfd, const c
+ struct dentry * old_dentry, *new_dentry;
+ struct dentry * trap;
+ struct nameidata oldnd, newnd;
+-
+- error = do_path_lookup(olddfd, oldname, LOOKUP_PARENT, &oldnd);
++
++ intent_init(&oldnd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(olddfd, oldname, LOOKUP_PARENT, &oldnd);
+ if (error)
+ goto exit;
+-
+- error = do_path_lookup(newdfd, newname, LOOKUP_PARENT, &newnd);
++
++ intent_init(&newnd.intent, IT_LOOKUP);
++ error = do_path_lookup_it(newdfd, newname, LOOKUP_PARENT, &newnd);
+ if (error)
+ goto exit1;
-@@ -61,6 +63,11 @@ int vfs_getattr(struct vfsmount *mnt, st
- return 0;
- }
+@@ -2452,6 +2620,13 @@ static int do_rename(int olddfd, const c
+ if (newnd.last_type != LAST_NORM)
+ goto exit2;
-+int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
-+{
-+ return vfs_getattr_it(mnt, dentry, NULL, stat);
-+}
++ 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;
++ }
+
- EXPORT_SYMBOL(vfs_getattr);
-
- int vfs_stat_fd(int dfd, char __user *name, struct kstat *stat)
-@@ -68,9 +75,10 @@ int vfs_stat_fd(int dfd, char __user *na
- struct nameidata nd;
- int error;
-
-- error = __user_walk_fd(dfd, name, LOOKUP_FOLLOW, &nd);
-+ intent_init(&nd.intent, IT_GETATTR);
-+ error = __user_walk_fd_it(dfd, name, LOOKUP_FOLLOW, &nd);
- if (!error) {
-- error = vfs_getattr(nd.mnt, nd.dentry, stat);
-+ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
- path_release(&nd);
- }
- return error;
-@@ -88,9 +96,10 @@ int vfs_lstat_fd(int dfd, char __user *n
- struct nameidata nd;
- int error;
-
-- error = __user_walk_fd(dfd, name, 0, &nd);
-+ intent_init(&nd.intent, IT_GETATTR);
-+ error = __user_walk_fd_it(dfd, name, 0, &nd);
- if (!error) {
-- error = vfs_getattr(nd.mnt, nd.dentry, stat);
-+ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
- path_release(&nd);
- }
- return error;
-@@ -107,9 +116,12 @@ int vfs_fstat(unsigned int fd, struct ks
- {
- struct file *f = fget(fd);
- int error = -EBADF;
-+ struct nameidata nd;
-+ intent_init(&nd.intent, IT_GETATTR);
-
- if (f) {
-- error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
-+ error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
-+ intent_release(&nd.intent);
- fput(f);
- }
- return error;
---- linux-2.6.16.21-0.8.orig/fs/namespace.c
-+++ linux-2.6.16.21-0.8/fs/namespace.c
-@@ -75,6 +75,7 @@ struct vfsmount *alloc_vfsmnt(const char
- INIT_LIST_HEAD(&mnt->mnt_share);
- INIT_LIST_HEAD(&mnt->mnt_slave_list);
- INIT_LIST_HEAD(&mnt->mnt_slave);
-+ INIT_LIST_HEAD(&mnt->mnt_lustre_list);
- if (name) {
- int size = strlen(name) + 1;
- char *newname = kmalloc(size, GFP_KERNEL);
-@@ -155,6 +156,7 @@ static void __touch_namespace(struct nam
+ trap = lock_rename(new_dir, old_dir);
+
+ old_dentry = lookup_hash(&oldnd);
+@@ -2483,8 +2658,7 @@ static int do_rename(int olddfd, const c
+ 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:
+@@ -2690,6 +2864,7 @@ EXPORT_SYMBOL(__page_symlink);
+ 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 linux-2.6.16.21-0.8.orig/fs/namespace.c linux-2.6.16.21-0.8/fs/namespace.c
+--- linux-2.6.16.21-0.8.orig/fs/namespace.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/namespace.c 2007-01-29 18:20:42.000000000 +0200
+@@ -75,6 +75,7 @@ struct vfsmount *alloc_vfsmnt(const char
+ INIT_LIST_HEAD(&mnt->mnt_share);
+ INIT_LIST_HEAD(&mnt->mnt_slave_list);
+ INIT_LIST_HEAD(&mnt->mnt_slave);
++ INIT_LIST_HEAD(&mnt->mnt_lustre_list);
+ if (name) {
+ int size = strlen(name) + 1;
+ char *newname = kmalloc(size, GFP_KERNEL);
+@@ -155,6 +156,7 @@ static void __touch_namespace(struct nam
static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
{
if ((flags & MNT_FORCE) && sb->s_op->umount_begin)
sb->s_op->umount_begin(sb);
unlock_kernel();
-@@ -871,6 +878,7 @@ static int do_loopback(struct nameidata
+@@ -871,7 +878,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;
-@@ -956,6 +964,7 @@ static int do_move_mount(struct nameidat
+
+@@ -956,7 +964,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;
+
@@ -1271,6 +1280,7 @@ long do_mount(char *dev_name, char *dir_
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;
---- linux-2.6.16.21-0.8.orig/fs/exec.c
-+++ linux-2.6.16.21-0.8/fs/exec.c
-@@ -128,7 +128,9 @@ asmlinkage long sys_uselib(const char __
+@@ -1301,7 +1311,8 @@ long do_mount(char *dev_name, char *dir_
+ MS_NOATIME | MS_NODIRATIME);
+
+ /* ... 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 -urNp linux-2.6.16.21-0.8.orig/fs/nfs/dir.c linux-2.6.16.21-0.8/fs/nfs/dir.c
+--- linux-2.6.16.21-0.8.orig/fs/nfs/dir.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/nfs/dir.c 2007-01-29 18:20:42.000000000 +0200
+@@ -831,7 +831,7 @@ int nfs_is_exclusive_create(struct inode
+ return 0;
+ if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_CREATE) == 0)
+ 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)
+@@ -902,7 +902,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;
+ }
+@@ -923,7 +923,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) {
+ d_add(dentry, NULL);
+ goto out;
+ }
+@@ -938,7 +938,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);
+ res = nfs4_atomic_open(dir, dentry, nd);
+ nfs_end_data_update(dir);
+@@ -957,7 +957,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:
+@@ -993,7 +993,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;
+@@ -1126,7 +1126,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;
+
+ lock_kernel();
+ nfs_begin_data_update(dir);
+diff -urNp linux-2.6.16.21-0.8.orig/fs/nfs/nfs4proc.c linux-2.6.16.21-0.8/fs/nfs/nfs4proc.c
+--- linux-2.6.16.21-0.8.orig/fs/nfs/nfs4proc.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/nfs/nfs4proc.c 2007-01-29 18:20:42.000000000 +0200
+@@ -1220,7 +1220,7 @@ static void nfs4_intent_set_file(struct
+ ctx = (struct nfs_open_context *)filp->private_data;
+ ctx->state = state;
+ } else
+- nfs4_close_state(state, nd->intent.open.flags);
++ nfs4_close_state(state, nd->intent.flags);
+ }
+
+ struct dentry *
+@@ -1232,19 +1232,19 @@ nfs4_atomic_open(struct inode *dir, stru
+ struct dentry *res;
+
+ if (nd->flags & LOOKUP_CREATE) {
+- attr.ia_mode = nd->intent.open.create_mode;
++ attr.ia_mode = nd->intent.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.flags & O_CREAT);
+ }
+
+ cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
+ if (IS_ERR(cred))
+ return (struct dentry *)cred;
+- state = nfs4_do_open(dir, dentry, nd->intent.open.flags, &attr, cred);
++ state = nfs4_do_open(dir, dentry, nd->intent.flags, &attr, cred);
+ put_rpccred(cred);
+ if (IS_ERR(state)) {
+ if (PTR_ERR(state) == -ENOENT)
+diff -urNp linux-2.6.16.21-0.8.orig/fs/nfsctl.c linux-2.6.16.21-0.8/fs/nfsctl.c
+--- linux-2.6.16.21-0.8.orig/fs/nfsctl.c 2006-10-04 02:18:11.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/nfsctl.c 2007-01-29 18:20:42.000000000 +0200
+@@ -26,6 +26,7 @@ static struct file *do_open(char *name,
struct nameidata nd;
int error;
-- error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd, FMODE_READ);
-+ intent_init(&nd.intent, IT_OPEN);
-+ error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd,
-+ FMODE_READ | FMODE_EXEC);
++ intent_init(&nd.intent, IT_OPEN);
+ nd.mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
+
+ if (IS_ERR(nd.mnt))
+diff -urNp linux-2.6.16.21-0.8.orig/fs/open.c linux-2.6.16.21-0.8/fs/open.c
+--- linux-2.6.16.21-0.8.orig/fs/open.c 2006-10-04 02:18:12.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/open.c 2007-01-29 18:20:42.000000000 +0200
+@@ -197,9 +197,10 @@ out:
+ }
+
+ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
+- struct file *filp)
++ struct file *filp, int called_from_open)
+ {
+ 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. */
+@@ -214,7 +215,17 @@ int do_truncate(struct dentry *dentry, l
+ }
+
+ mutex_lock(&dentry->d_inode->i_mutex);
+- err = notify_change(dentry, &newattrs);
++ if (called_from_open)
++ newattrs.ia_valid |= ATTR_FROM_OPEN;
++ 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);
++
+ mutex_unlock(&dentry->d_inode->i_mutex);
+ return err;
+ }
+@@ -224,12 +235,12 @@ static long do_sys_truncate(const char _
+ 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);
++ error = user_path_walk_it(path, &nd);
if (error)
goto out;
+ inode = nd.dentry->d_inode;
+@@ -269,7 +280,7 @@ static long do_sys_truncate(const char _
+ error = locks_verify_truncate(inode, NULL, length);
+ if (!error) {
+ DQUOT_INIT(inode);
+- error = do_truncate(nd.dentry, length, 0, NULL);
++ error = do_truncate(nd.dentry, length, 0, NULL, 0);
+ }
+ put_write_access(inode);
-@@ -478,7 +480,9 @@ struct file *open_exec(const char *name)
- int err;
- struct file *file;
+@@ -321,7 +332,7 @@ static long do_sys_ftruncate(unsigned in
-- err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd, FMODE_READ);
-+ intent_init(&nd.intent, IT_OPEN);
-+ err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd,
-+ FMODE_READ | FMODE_EXEC);
- file = ERR_PTR(err);
+ error = locks_verify_truncate(inode, file, length);
+ if (!error)
+- error = do_truncate(dentry, length, 0, file);
++ error = do_truncate(dentry, length, 0, file, 0);
+ out_putf:
+ fput(file);
+ out:
+@@ -406,9 +417,20 @@ asmlinkage long sys_utime(char __user *
+ (error = vfs_permission(&nd, MAY_WRITE)) != 0)
+ goto dput_and_out;
+ }
+- mutex_lock(&inode->i_mutex);
+- error = notify_change(nd.dentry, &newattrs);
+- mutex_unlock(&inode->i_mutex);
++ 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 {
++ mutex_lock(&inode->i_mutex);
++ error = notify_change(nd.dentry, &newattrs);
++ mutex_unlock(&inode->i_mutex);
++ }
++
+ dput_and_out:
+ path_release(&nd);
+ out:
+@@ -494,6 +516,7 @@ asmlinkage long sys_faccessat(int dfd, c
+ int old_fsuid, old_fsgid;
+ kernel_cap_t old_cap;
+ int res;
++ intent_init(&nd.intent, IT_GETATTR);
- if (!err) {
---- linux-2.6.16.21-0.8.orig/include/linux/dcache.h
-+++ linux-2.6.16.21-0.8/include/linux/dcache.h
+ if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
+ return -EINVAL;
+@@ -518,7 +541,7 @@ asmlinkage long sys_faccessat(int dfd, c
+ else
+ current->cap_effective = current->cap_permitted;
+
+- res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
++ res = __user_walk_fd_it(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
+ if (!res) {
+ res = vfs_permission(&nd, mode);
+ /* SuS v2 requires we report a read only fs too */
+@@ -544,8 +567,9 @@ asmlinkage long sys_chdir(const char __u
+ {
+ struct nameidata nd;
+ int error;
++ intent_init(&nd.intent, IT_GETATTR);
+
+- error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
++ error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
+ if (error)
+ goto out;
+
+@@ -595,8 +619,9 @@ asmlinkage long sys_chroot(const char __
+ {
+ struct nameidata nd;
+ int error;
++ intent_init(&nd.intent, IT_GETATTR);
+
+- error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
++ error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
+ if (error)
+ goto out;
+
+@@ -617,36 +642,52 @@ out:
+ return error;
+ }
+
++int chmod_common(struct dentry *dentry, mode_t mode)
++{
++ struct inode * inode = dentry->d_inode;
++ struct iattr newattrs;
++ int error = -EROFS;
++
++ if (IS_RDONLY(inode))
++ goto out;
++
++ if (inode->i_op->setattr_raw) {
++ struct inode_operations *op = dentry->d_inode->i_op;
++
++ 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 normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out;
++ }
++
++ error = -EPERM;
++ if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
++ goto out;
++
++ mutex_lock(&inode->i_mutex);
++ 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(dentry, &newattrs);
++ mutex_unlock(&inode->i_mutex);
++out:
++ return error;
++}
++
+ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
+ {
+- struct inode * inode;
+- struct dentry * dentry;
+ struct file * file;
+ int err = -EBADF;
+- struct iattr newattrs;
+
+ file = fget(fd);
+ if (!file)
+ goto out;
+
+- dentry = file->f_dentry;
+- inode = dentry->d_inode;
+-
+- err = -EROFS;
+- if (IS_RDONLY(inode))
+- goto out_putf;
+- err = -EPERM;
+- if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+- goto out_putf;
+- mutex_lock(&inode->i_mutex);
+- 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);
+- mutex_unlock(&inode->i_mutex);
+-
+-out_putf:
++ err = chmod_common(file->f_dentry, mode);
+ fput(file);
+ out:
+ return err;
+@@ -656,32 +697,12 @@ asmlinkage long sys_fchmodat(int dfd, co
+ mode_t mode)
+ {
+ struct nameidata nd;
+- struct inode * inode;
+ int error;
+- struct iattr newattrs;
+
+ error = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW, &nd);
+ if (error)
+ goto out;
+- inode = nd.dentry->d_inode;
+-
+- error = -EROFS;
+- if (IS_RDONLY(inode))
+- goto dput_and_out;
+-
+- error = -EPERM;
+- if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+- goto dput_and_out;
+-
+- mutex_lock(&inode->i_mutex);
+- 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);
+- mutex_unlock(&inode->i_mutex);
+-
+-dput_and_out:
++ error = chmod_common(nd.dentry, mode);
+ path_release(&nd);
+ out:
+ return error;
+@@ -707,6 +728,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;
+@@ -817,6 +850,7 @@ static struct file *__dentry_open(struct
+ error = open(inode, f);
+ if (error)
+ goto cleanup_all;
++ intent_release(f->f_it);
+ }
+
+ f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
+@@ -843,6 +877,7 @@ cleanup_all:
+ f->f_dentry = NULL;
+ f->f_vfsmnt = NULL;
+ cleanup_file:
++ intent_release(f->f_it);
+ put_filp(f);
+ dput(dentry);
+ mntput(mnt);
+@@ -868,6 +903,7 @@ static struct file *do_filp_open(int dfd
+ {
+ int namei_flags, error;
+ struct nameidata nd;
++ intent_init(&nd.intent, IT_OPEN);
+
+ namei_flags = flags;
+ if ((namei_flags+1) & O_ACCMODE)
+@@ -904,19 +940,19 @@ EXPORT_SYMBOL(filp_open);
+ struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
+ int (*open)(struct inode *, struct file *))
+ {
+- if (IS_ERR(nd->intent.open.file))
++ if (IS_ERR(nd->intent.file))
+ goto out;
+ if (IS_ERR(dentry))
+ goto out_err;
+- nd->intent.open.file = __dentry_open(dget(dentry), mntget(nd->mnt),
+- nd->intent.open.flags - 1,
+- nd->intent.open.file,
++ nd->intent.file = __dentry_open(dget(dentry), mntget(nd->mnt),
++ nd->intent.flags - 1,
++ nd->intent.file,
+ open);
+ out:
+- return nd->intent.open.file;
++ return nd->intent.file;
+ out_err:
+ release_open_intent(nd);
+- nd->intent.open.file = (struct file *)dentry;
++ nd->intent.file = (struct file *)dentry;
+ goto out;
+ }
+ EXPORT_SYMBOL_GPL(lookup_instantiate_filp);
+@@ -933,7 +969,8 @@ struct file *nameidata_to_filp(struct na
+ struct file *filp;
+
+ /* Pick up the filp from the open intent */
+- filp = nd->intent.open.file;
++ filp = nd->intent.file;
++ filp->f_it = &nd->intent;
+ /* Has the filesystem initialised the file for us? */
+ if (filp->f_dentry == NULL)
+ filp = __dentry_open(nd->dentry, nd->mnt, flags, filp, NULL);
+diff -urNp linux-2.6.16.21-0.8.orig/fs/stat.c linux-2.6.16.21-0.8/fs/stat.c
+--- linux-2.6.16.21-0.8.orig/fs/stat.c 2006-10-04 02:18:12.000000000 +0300
++++ linux-2.6.16.21-0.8/fs/stat.c 2007-01-29 18:20:42.000000000 +0200
+@@ -38,7 +38,7 @@ void generic_fillattr(struct inode *inod
+
+ EXPORT_SYMBOL(generic_fillattr);
+
+-int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
++int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
+ {
+ struct inode *inode = dentry->d_inode;
+ int retval;
+@@ -47,6 +47,8 @@ int vfs_getattr(struct vfsmount *mnt, st
+ if (retval)
+ return retval;
+
++ if (inode->i_op->getattr_it)
++ return inode->i_op->getattr_it(mnt, dentry, it, stat);
+ if (inode->i_op->getattr)
+ return inode->i_op->getattr(mnt, dentry, stat);
+
+@@ -61,6 +63,11 @@ int vfs_getattr(struct vfsmount *mnt, st
+ return 0;
+ }
+
++int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
++{
++ return vfs_getattr_it(mnt, dentry, NULL, stat);
++}
++
+ EXPORT_SYMBOL(vfs_getattr);
+
+ int vfs_stat_fd(int dfd, char __user *name, struct kstat *stat)
+@@ -68,9 +75,10 @@ int vfs_stat_fd(int dfd, char __user *na
+ struct nameidata nd;
+ int error;
+
+- error = __user_walk_fd(dfd, name, LOOKUP_FOLLOW, &nd);
++ intent_init(&nd.intent, IT_GETATTR);
++ error = __user_walk_fd_it(dfd, name, LOOKUP_FOLLOW, &nd);
+ if (!error) {
+- error = vfs_getattr(nd.mnt, nd.dentry, stat);
++ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
+ path_release(&nd);
+ }
+ return error;
+@@ -88,9 +96,10 @@ int vfs_lstat_fd(int dfd, char __user *n
+ struct nameidata nd;
+ int error;
+
+- error = __user_walk_fd(dfd, name, 0, &nd);
++ intent_init(&nd.intent, IT_GETATTR);
++ error = __user_walk_fd_it(dfd, name, 0, &nd);
+ if (!error) {
+- error = vfs_getattr(nd.mnt, nd.dentry, stat);
++ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
+ path_release(&nd);
+ }
+ return error;
+@@ -107,9 +116,12 @@ int vfs_fstat(unsigned int fd, struct ks
+ {
+ struct file *f = fget(fd);
+ int error = -EBADF;
++ struct nameidata nd;
++ intent_init(&nd.intent, IT_GETATTR);
+
+ if (f) {
+- error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
++ error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
++ intent_release(&nd.intent);
+ fput(f);
+ }
+ return error;
+diff -urNp linux-2.6.16.21-0.8.orig/include/linux/dcache.h linux-2.6.16.21-0.8/include/linux/dcache.h
+--- linux-2.6.16.21-0.8.orig/include/linux/dcache.h 2006-10-04 02:18:15.000000000 +0300
++++ linux-2.6.16.21-0.8/include/linux/dcache.h 2007-01-29 18:20:42.000000000 +0200
@@ -36,6 +36,9 @@ struct qstr {
const unsigned char *name;
};
struct dentry_stat_t {
int nr_dentry;
int nr_unused;
---- linux-2.6.16.21-0.8.orig/include/linux/fs.h
-+++ linux-2.6.16.21-0.8/include/linux/fs.h
-@@ -81,6 +81,11 @@ extern int leases_enable, dir_notify_ena
- #define FMODE_PREAD 8
- #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
-
-+/* File is being opened for execution. Primary users of this flag are
-+ distributed filesystems that can use it to achieve correct ETXTBUSY
-+ behavior for cross-node execution/opening_for_writing of files */
-+#define FMODE_EXEC 16
-+
- #define RW_MASK 1
- #define RWA_MASK 2
- #define READ 0
+diff -urNp linux-2.6.16.21-0.8.orig/include/linux/fs.h linux-2.6.16.21-0.8/include/linux/fs.h
+--- linux-2.6.16.21-0.8.orig/include/linux/fs.h 2006-10-04 02:18:16.000000000 +0300
++++ linux-2.6.16.21-0.8/include/linux/fs.h 2007-01-29 18:20:42.000000000 +0200
+@@ -59,6 +59,7 @@ extern int dir_notify_enable;
+
+ #define FMODE_READ 1
+ #define FMODE_WRITE 2
++#define FMODE_EXEC 16
+
+ /* Internal kernel extensions */
+ #define FMODE_LSEEK 4
@@ -265,6 +266,8 @@ typedef void (dio_iodone_t)(struct kiocb
#define ATTR_KILL_SUID 2048
#define ATTR_KILL_SGID 4096
};
extern spinlock_t files_lock;
#define file_list_lock() spin_lock(&files_lock);
-@@ -1049,7 +1054,9 @@ struct inode_operations {
+@@ -1036,20 +1041,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);
+ void * (*follow_link) (struct dentry *, struct nameidata *);
+ void (*put_link) (struct dentry *, struct nameidata *, void *);
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);
-@@ -1090,6 +1097,7 @@ struct super_operations {
+@@ -1090,6 +1104,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 *);
-@@ -1292,6 +1300,7 @@ extern int may_umount_tree(struct vfsmou
+@@ -1292,6 +1307,7 @@ extern int may_umount_tree(struct vfsmou
extern int may_umount(struct vfsmount *);
extern void umount_tree(struct vfsmount *, int, struct list_head *);
extern void release_mounts(struct list_head *);
extern long do_mount(char *, char *, char *, unsigned long, void *);
extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
-@@ -1353,6 +1362,7 @@ extern long do_sys_open(int fdf, const c
+@@ -1348,11 +1364,12 @@ static inline int break_lease(struct ino
+ /* fs/open.c */
+
+ extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
+- struct file *filp);
++ struct file *filp, int called_from_open);
+ extern long do_sys_open(int fdf, const char __user *filename, int flags,
int mode);
extern struct file *filp_open(const char *, int, int);
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
extern int filp_close(struct file *, fl_owner_t id);
extern char * getname(const char __user *);
---- linux-2.6.16.21-0.8.orig/include/linux/namei.h
-+++ linux-2.6.16.21-0.8/include/linux/namei.h
+diff -urNp linux-2.6.16.21-0.8.orig/include/linux/mount.h linux-2.6.16.21-0.8/include/linux/mount.h
+--- linux-2.6.16.21-0.8.orig/include/linux/mount.h 2006-10-04 02:18:16.000000000 +0300
++++ linux-2.6.16.21-0.8/include/linux/mount.h 2007-01-29 18:20:42.000000000 +0200
+@@ -46,6 +46,8 @@ struct vfsmount {
+ struct list_head mnt_slave; /* slave list entry */
+ struct vfsmount *mnt_master; /* slave is on master->mnt_slave_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) */
+ int mnt_pinned;
+ };
+
+diff -urNp linux-2.6.16.21-0.8.orig/include/linux/namei.h linux-2.6.16.21-0.8/include/linux/namei.h
+--- linux-2.6.16.21-0.8.orig/include/linux/namei.h 2006-10-04 02:18:16.000000000 +0300
++++ linux-2.6.16.21-0.8/include/linux/namei.h 2007-01-29 18:20:49.000000000 +0200
@@ -5,10 +5,39 @@
struct vfsmount;
/*
* Intent data
*/
-@@ -57,10 +99,19 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -57,18 +99,29 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *));
+extern void intent_release(struct lookup_intent *);
+
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 *));
---- linux-2.6.16.21-0.8.orig/include/linux/mount.h
-+++ linux-2.6.16.21-0.8/include/linux/mount.h
-@@ -46,6 +46,8 @@ struct vfsmount {
- struct list_head mnt_slave; /* slave list entry */
- struct vfsmount *mnt_master; /* slave is on master->mnt_slave_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) */
- int mnt_pinned;
- };
-
---- linux-2.6.16.21-0.8.orig/fs/9p/vfs_inode.c
-+++ linux-2.6.16.21-0.8/fs/9p/vfs_inode.c
-@@ -469,7 +469,7 @@ v9fs_vfs_create(struct inode *dir, struc
- perm = unixmode2p9mode(v9ses, mode);
-
- if (nd && nd->flags & LOOKUP_OPEN)
-- flags = nd->intent.open.flags - 1;
-+ flags = nd->intent.flags - 1;
- else
- flags = O_RDWR;
-
---- linux-2.6.16.21-0.8.orig/fs/fuse/dir.c
-+++ linux-2.6.16.21-0.8/fs/fuse/dir.c
-@@ -242,7 +242,7 @@ static int fuse_create_open(struct inode
- struct fuse_entry_out outentry;
- struct fuse_file *ff;
- struct file *file;
-- int flags = nd->intent.open.flags - 1;
-+ int flags = nd->intent.flags - 1;
-
- err = -ENOSYS;
- if (fc->no_create)
+ extern void path_release(struct nameidata *);
+ extern void path_release_on_umount(struct nameidata *);
+
+ extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags);
+-extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags);
++extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *,
++ int open_flags, int create_mode);
+ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
+ int (*open)(struct inode *, struct file *));
+ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
----
- fs/exec.c | 14 +++---
- fs/inode.c | 1
- fs/namei.c | 99 +++++++++++++++++++++++++++++++++++++++++++++----
- fs/namespace.c | 10 ++++
- fs/open.c | 70 +++++++++++++++++++++-------------
- fs/stat.c | 24 ++++++++---
- include/linux/dcache.h | 3 +
- include/linux/fs.h | 10 ++++
- include/linux/mount.h | 2
- include/linux/namei.h | 61 ++++++++++++++++++++++++++----
- 10 files changed, 241 insertions(+), 53 deletions(-)
-
--- linux-2.6.12.6.orig/fs/exec.c
+++ linux-2.6.12.6/fs/exec.c
-@@ -122,9 +122,10 @@ asmlinkage long sys_uselib(const char __
+@@ -122,9 +122,10 @@
struct file * file;
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -136,7 +137,7 @@ asmlinkage long sys_uselib(const char __
+@@ -136,7 +137,7 @@
if (error)
goto exit;
error = PTR_ERR(file);
if (IS_ERR(file))
goto out;
-@@ -492,8 +493,9 @@ struct file *open_exec(const char *name)
+@@ -492,8 +493,9 @@
int err;
struct file *file;
file = ERR_PTR(err);
if (!err) {
-@@ -506,7 +508,7 @@ struct file *open_exec(const char *name)
+@@ -506,7 +508,7 @@
err = -EACCES;
file = ERR_PTR(err);
if (!err) {
if (err) {
--- linux-2.6.12.6.orig/fs/namei.c
+++ linux-2.6.12.6/fs/namei.c
-@@ -301,8 +301,19 @@ int deny_write_access(struct file * file
+@@ -301,8 +301,19 @@
return 0;
}
dput(nd->dentry);
mntput(nd->mnt);
}
-@@ -392,8 +403,11 @@ static struct dentry * real_lookup(struc
+@@ -392,8 +403,11 @@
{
struct dentry * result;
struct inode *dir = parent->d_inode;
/*
* First re-do the cached lookup just in case it was created
* while we waited for the directory semaphore..
-@@ -427,13 +441,16 @@ static struct dentry * real_lookup(struc
+@@ -427,13 +441,16 @@
* Uhhuh! Nasty case: the cache was re-populated while
* we waited on the semaphore. Need to revalidate.
*/
return result;
}
-@@ -462,6 +479,7 @@ static inline int __vfs_follow_link(stru
+@@ -462,6 +479,7 @@
{
int res = 0;
char *name;
if (IS_ERR(link))
goto fail;
-@@ -471,6 +489,7 @@ static inline int __vfs_follow_link(stru
+@@ -471,6 +489,7 @@
/* weird __emul_prefix() stuff did it */
goto out;
}
res = link_path_walk(link, nd);
out:
if (nd->depth || res || nd->last_type!=LAST_NORM)
-@@ -703,6 +722,33 @@ fail:
+@@ -703,6 +722,33 @@
return PTR_ERR(dentry);
}
/*
* Name resolution.
* This is the basic name resolution function, turning a pathname into
-@@ -800,7 +846,11 @@ static fastcall int __link_path_walk(con
+@@ -800,7 +846,11 @@
goto out_dput;
if (inode->i_op->follow_link) {
if (err)
goto return_err;
err = -ENOENT;
-@@ -839,6 +889,23 @@ last_component:
+@@ -839,6 +889,23 @@
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
goto return_reval;
}
if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
-@@ -846,7 +913,9 @@ last_component:
+@@ -846,7 +913,9 @@
if (err < 0)
break;
}
if (err)
break;
inode = next.dentry->d_inode;
-@@ -1097,7 +1166,7 @@ struct dentry * lookup_hash(struct qstr
+@@ -1097,7 +1166,7 @@
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -1117,11 +1186,16 @@ struct dentry * lookup_one_len(const cha
+@@ -1117,11 +1186,16 @@
}
this.hash = end_name_hash(hash);
/*
* namei()
*
-@@ -1133,7 +1207,7 @@ access:
+@@ -1133,7 +1207,7 @@
* that namei follows links, while lnamei does not.
* SMP-safe
*/
{
char *tmp = getname(name);
int err = PTR_ERR(tmp);
-@@ -1145,6 +1219,12 @@ int fastcall __user_walk(const char __us
+@@ -1145,6 +1219,12 @@
return err;
}
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -1426,8 +1506,8 @@ int open_namei(const char * pathname, in
+@@ -1426,8 +1506,8 @@
acc_mode |= MAY_APPEND;
/* Fill in the open() intent data */
/*
* The simplest case - just a plain lookup.
-@@ -1442,6 +1522,7 @@ int open_namei(const char * pathname, in
+@@ -1442,6 +1522,7 @@
/*
* Create - we need to know the parent.
*/
error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
if (error)
return error;
-@@ -1458,7 +1539,9 @@ int open_namei(const char * pathname, in
+@@ -1458,7 +1539,9 @@
dir = nd->dentry;
nd->flags &= ~LOOKUP_PARENT;
down(&dir->d_inode->i_sem);
path.mnt = nd->mnt;
do_last:
-@@ -1564,7 +1647,9 @@ do_link:
+@@ -1564,7 +1647,9 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
goto do_last;
--- linux-2.6.12.6.orig/fs/namespace.c
+++ linux-2.6.12.6/fs/namespace.c
-@@ -62,6 +62,7 @@ struct vfsmount *alloc_vfsmnt(const char
+@@ -62,6 +62,7 @@
INIT_LIST_HEAD(&mnt->mnt_mounts);
INIT_LIST_HEAD(&mnt->mnt_list);
INIT_LIST_HEAD(&mnt->mnt_fslink);
if (name) {
int size = strlen(name)+1;
char *newname = kmalloc(size, GFP_KERNEL);
-@@ -113,6 +114,7 @@ static inline int check_mnt(struct vfsmo
+@@ -113,6 +114,7 @@
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;
-@@ -176,6 +178,9 @@ void __mntput(struct vfsmount *mnt)
+@@ -176,6 +178,9 @@
{
struct super_block *sb = mnt->mnt_sb;
dput(mnt->mnt_root);
free_vfsmnt(mnt);
deactivate_super(sb);
}
-@@ -402,6 +407,8 @@ static int do_umount(struct vfsmount *mn
+@@ -402,6 +407,8 @@
*/
lock_kernel();
if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
sb->s_op->umount_begin(sb);
unlock_kernel();
-@@ -627,6 +634,7 @@ static int do_loopback(struct nameidata
+@@ -627,6 +634,7 @@
return err;
if (!old_name || !*old_name)
return -EINVAL;
err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
if (err)
return err;
-@@ -701,6 +709,7 @@ static int do_move_mount(struct nameidat
+@@ -701,6 +709,7 @@
return -EPERM;
if (!old_name || !*old_name)
return -EINVAL;
err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
if (err)
return err;
-@@ -1012,6 +1021,7 @@ long do_mount(char * dev_name, char * di
+@@ -1012,6 +1021,7 @@
int retval = 0;
int mnt_flags = 0;
flags &= ~MS_MGC_MSK;
--- linux-2.6.12.6.orig/fs/open.c
+++ linux-2.6.12.6/fs/open.c
-@@ -215,12 +215,12 @@ static inline long do_sys_truncate(const
+@@ -215,12 +215,12 @@
struct nameidata nd;
struct inode * inode;
int error;
if (error)
goto out;
inode = nd.dentry->d_inode;
-@@ -474,6 +474,7 @@ asmlinkage long sys_access(const char __
+@@ -474,6 +474,7 @@
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 @@ asmlinkage long sys_access(const char __
+@@ -498,13 +499,14 @@
else
current->cap_effective = current->cap_permitted;
path_release(&nd);
}
-@@ -519,8 +521,9 @@ asmlinkage long sys_chdir(const char __u
+@@ -519,8 +521,9 @@
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -570,8 +573,9 @@ asmlinkage long sys_chroot(const char __
+@@ -570,8 +573,9 @@
{
struct nameidata nd;
int error;
if (error)
goto out;
-@@ -750,27 +754,8 @@ asmlinkage long sys_fchown(unsigned int
+@@ -750,27 +754,8 @@
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
*/
{
struct file * f;
struct inode *inode;
-@@ -782,6 +767,7 @@ struct file *dentry_open(struct dentry *
+@@ -782,6 +767,7 @@
goto cleanup_dentry;
f->f_flags = flags;
f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
inode = dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = get_write_access(inode);
-@@ -800,6 +786,7 @@ struct file *dentry_open(struct dentry *
+@@ -800,6 +786,7 @@
error = f->f_op->open(inode,f);
if (error)
goto cleanup_all;
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-@@ -825,6 +812,7 @@ cleanup_all:
+@@ -825,6 +812,7 @@
cleanup_file:
put_filp(f);
cleanup_dentry:
dput(dentry);
mntput(mnt);
return ERR_PTR(error);
-@@ -832,6 +820,36 @@ cleanup_dentry:
+@@ -832,6 +820,36 @@
EXPORT_SYMBOL(dentry_open);
*/
--- linux-2.6.12.6.orig/fs/stat.c
+++ linux-2.6.12.6/fs/stat.c
-@@ -38,7 +38,7 @@ void generic_fillattr(struct inode *inod
+@@ -38,7 +38,7 @@
EXPORT_SYMBOL(generic_fillattr);
{
struct inode *inode = dentry->d_inode;
int retval;
-@@ -47,6 +47,8 @@ int vfs_getattr(struct vfsmount *mnt, st
+@@ -47,6 +47,8 @@
if (retval)
return retval;
if (inode->i_op->getattr)
return inode->i_op->getattr(mnt, dentry, stat);
-@@ -63,14 +65,20 @@ int vfs_getattr(struct vfsmount *mnt, st
+@@ -63,14 +65,20 @@
EXPORT_SYMBOL(vfs_getattr);
path_release(&nd);
}
return error;
-@@ -82,10 +90,11 @@ int vfs_lstat(char __user *name, struct
+@@ -82,10 +90,11 @@
{
struct nameidata nd;
int error;
path_release(&nd);
}
return error;
-@@ -97,9 +106,12 @@ int vfs_fstat(unsigned int fd, struct ks
+@@ -97,9 +106,12 @@
{
struct file *f = fget(fd);
int error = -EBADF;
return error;
--- linux-2.6.12.6.orig/fs/inode.c
+++ linux-2.6.12.6/fs/inode.c
-@@ -230,6 +230,7 @@ void __iget(struct inode * inode)
+@@ -230,6 +230,7 @@
inodes_stat.nr_unused--;
}
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/cache.h>
-@@ -37,6 +38,8 @@ struct qstr {
+@@ -37,6 +38,8 @@
const unsigned char *name;
};
int nr_unused;
--- linux-2.6.12.6.orig/include/linux/fs.h
+++ linux-2.6.12.6/include/linux/fs.h
-@@ -58,6 +58,7 @@ extern int dir_notify_enable;
+@@ -58,6 +58,7 @@
#define FMODE_READ 1
#define FMODE_WRITE 2
/* Internal kernel extensions */
#define FMODE_LSEEK 4
-@@ -260,6 +261,8 @@ typedef void (dio_iodone_t)(struct inode
+@@ -260,6 +261,8 @@
#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
-@@ -463,6 +466,7 @@ struct inode {
+@@ -463,6 +466,7 @@
struct block_device *i_bdev;
struct cdev *i_cdev;
int i_cindex;
__u32 i_generation;
-@@ -600,6 +604,7 @@ struct file {
+@@ -600,6 +604,7 @@
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);
-@@ -968,7 +973,9 @@ struct inode_operations {
+@@ -968,7 +973,9 @@
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);
-@@ -1008,6 +1015,7 @@ struct super_operations {
+@@ -1008,6 +1015,7 @@
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 *);
-@@ -1210,6 +1218,7 @@ extern int unregister_filesystem(struct
+@@ -1210,6 +1218,7 @@
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 *);
-@@ -1262,6 +1271,7 @@ static inline int break_lease(struct ino
+@@ -1262,6 +1271,7 @@
extern int do_truncate(struct dentry *, loff_t start);
extern struct file *filp_open(const char *, int, int);
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
enum { MAX_NESTED_LINKS = 5 };
struct nameidata {
-@@ -21,10 +62,7 @@ struct nameidata {
+@@ -21,10 +62,7 @@
unsigned depth;
char *saved_names[MAX_NESTED_LINKS + 1];
};
/*
-@@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -47,6 +85,8 @@
#define LOOKUP_PARENT 16
#define LOOKUP_NOALT 32
#define LOOKUP_REVAL 64
/*
* Intent data
*/
-@@ -55,6 +95,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -55,6 +95,12 @@
#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 +113,6 @@ extern void path_release_on_umount(struc
+@@ -67,7 +113,6 @@
extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
--- linux-2.6.12.6.orig/include/linux/mount.h
+++ linux-2.6.12.6/include/linux/mount.h
-@@ -36,6 +36,8 @@ struct vfsmount
+@@ -36,6 +36,8 @@
struct list_head mnt_list;
struct list_head mnt_fslink; /* link in fs-specific expiry list */
struct namespace *mnt_namespace; /* containing namespace */
lustre_version.patch
vfs_intent-2.6-rhel4.patch
-vfs_nointent-2.6-rhel4.patch
vfs_races-2.6-rhel4.patch
-nfs-cifs-intent-2.6-rhel4.patch
iopen-misc-2.6-suse.patch
export-truncate-2.6-suse.patch
export_symbols-2.6-rhel4.patch
lustre_version.patch
vfs_intent-2.6-rhel4.patch
-vfs_nointent-2.6-rhel4.patch
vfs_races-2.6-rhel4.patch
-nfs-cifs-intent-2.6-rhel4.patch
iopen-misc-2.6-suse.patch
export-truncate-2.6-suse.patch
export_symbols-2.6-rhel4.patch
lustre_version.patch
vfs_intent-2.6-sles10.patch
-vfs_nointent-2.6-sles10.patch
vfs_races-2.6.18-vanilla.patch
jbd-2.6.10-jcberr.patch
-nfs-cifs-intent-2.6-fc5.patch
iopen-misc-2.6.12.patch
export-truncate-2.6-suse.patch
export_symbols-2.6.12.patch
lustre_version.patch
vfs_intent-2.6.12.patch
-vfs_nointent-2.6.12.patch
vfs_races-2.6.12.patch
jbd-2.6.10-jcberr.patch
-nfs-cifs-intent-2.6.12.patch
iopen-misc-2.6.12.patch
export-truncate-2.6-suse.patch
export_symbols-2.6.12.patch