- fs/dcache.c | 3
- fs/namei.c | 306 ++++++++++++++++++++++++++++++++++++++++---------
+ fs/dcache.c | 8
+ fs/namei.c | 335 +++++++++++++++++----
fs/nfsd/vfs.c | 2
- fs/open.c | 63 +++++++---
- fs/stat.c | 29 +++-
- include/linux/dcache.h | 31 ++++
- include/linux/fs.h | 22 +++
+ fs/open.c | 142 +++++++-
+ fs/stat.c | 24 +
+ include/linux/dcache.h | 26 +
+ include/linux/fs.h | 27 +
kernel/ksyms.c | 1
- 8 files changed, 384 insertions(+), 73 deletions(-)
+ fs/exec.c | 18 -
+ 9 files changed, 487 insertions(+), 96 deletions(-)
---- linux-2.4.19-hp2_pnnl2/fs/dcache.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/fs/dcache.c Sun Jan 19 19:04:47 2003
+--- linux-2.4.19-hp2_pnnl4/fs/dcache.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/fs/dcache.c Sun Jan 19 19:04:47 2003
@@ -186,6 +188,13 @@ int d_invalidate(struct dentry * dentry)
spin_unlock(&dcache_lock);
return 0;
INIT_LIST_HEAD(&dentry->d_hash);
INIT_LIST_HEAD(&dentry->d_lru);
INIT_LIST_HEAD(&dentry->d_subdirs);
---- linux-2.4.19-hp2_pnnl2/fs/namei.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/fs/namei.c Sun Jan 19 19:35:55 2003
+--- linux-2.4.19-hp2_pnnl4/fs/namei.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/fs/namei.c Sun Jan 19 19:35:55 2003
@@ -94,6 +97,13 @@
* XEmacs seems to be relying on it...
*/
spin_lock(&dcache_lock);
mounted = lookup_mnt(*mnt, *dentry);
if (mounted) {
-+ int opc, mode;
++ int opc = 0, mode = 0;
*mnt = mntget(mounted);
spin_unlock(&dcache_lock);
+ if (it) {
goto do_link;
dput(nd->dentry);
+@@ -1145,7 +1231,7 @@ do_last:
+ if (!error) {
+ DQUOT_INIT(inode);
+
+- error = do_truncate(dentry, 0);
++ error = do_truncate(dentry, 0, 1);
+ }
+ put_write_access(inode);
+ if (error)
@@ -1157,8 +1243,10 @@ ok:
return 0;
+ nd.last.name,
+ nd.last.len,
+ mode, dev);
-+ /* the file system want to use normal vfs path now */
++ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto out2;
+ }
+ nd.last.name,
+ nd.last.len,
+ mode);
-+ /* the file system want to use normal vfs path now */
++ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto out2;
+ }
+ error = op->rmdir2(nd.dentry->d_inode,
+ nd.last.name,
+ nd.last.len);
-+ /* the file system want to use normal vfs path now */
++ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto exit1;
+ }
+ error = op->unlink2(nd.dentry->d_inode,
+ nd.last.name,
+ nd.last.len);
-+ /* the file system want to use normal vfs path now */
++ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto exit1;
+ }
+ nd.last.name,
+ nd.last.len,
+ from);
-+ /* the file system want to use normal vfs path now */
++ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto out2;
+ }
+ nd.dentry->d_inode,
+ nd.last.name,
+ nd.last.len);
-+ /* the file system want to use normal vfs path now */
++ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto out_release;
+ }
if (!error) {
if (old_dir == new_dir)
inode_dir_notify(old_dir, DN_RENAME);
-@@ -1886,9 +2068,23 @@ static inline int do_rename(const char *
- if (newnd.last_type != LAST_NORM)
- goto exit2;
+@@ -1888,7 +2070,7 @@ static inline int do_rename(const char *
-+ if (old_dir->d_inode->i_op->rename2) {
-+ lock_kernel();
-+ error = old_dir->d_inode->i_op->rename2(old_dir->d_inode,
-+ new_dir->d_inode,
-+ oldnd.last.name,
-+ oldnd.last.len,
-+ newnd.last.name,
-+ newnd.last.len);
-+ unlock_kernel();
-+ /* the file system want to use normal vfs path now */
-+ if (error != -EOPNOTSUPP)
-+ goto exit2;
-+ }
-+
double_lock(new_dir, old_dir);
- old_dentry = lookup_hash(&oldnd.last, old_dir);
error = PTR_ERR(old_dentry);
if (IS_ERR(old_dentry))
goto exit3;
-@@ -1904,14 +2100,14 @@ static inline int do_rename(const char *
+@@ -1904,16 +2086,37 @@ static inline int do_rename(const char *
if (newnd.last.name[newnd.last.len])
goto exit4;
}
if (IS_ERR(new_dentry))
goto exit4;
++ if (old_dir->d_inode->i_op->rename2) {
++ lock_kernel();
++ /* don't rename mount point. mds will take care of
++ * the rest sanity checking */
++ if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) {
++ error = -EBUSY;
++ goto exit5;
++ }
++
++ error = old_dir->d_inode->i_op->rename2(old_dir->d_inode,
++ new_dir->d_inode,
++ oldnd.last.name,
++ oldnd.last.len,
++ newnd.last.name,
++ newnd.last.len);
++ unlock_kernel();
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto exit5;
++ }
++
lock_kernel();
error = vfs_rename(old_dir->d_inode, old_dentry,
- new_dir->d_inode, new_dentry);
+ new_dir->d_inode, new_dentry, NULL);
unlock_kernel();
-
+-
++exit5:
dput(new_dentry);
+ exit4:
+ dput(old_dentry);
@@ -1964,7 +2163,8 @@ out:
}
if (page) {
kunmap(page);
page_cache_release(page);
---- linux-2.4.19-hp2_pnnl2/fs/nfsd/vfs.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/fs/nfsd/vfs.c Sun Jan 19 19:37:57 2003
+--- linux-2.4.19-hp2_pnnl4/fs/nfsd/vfs.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/fs/nfsd/vfs.c Sun Jan 19 19:37:57 2003
@@ -1295,7 +1295,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
err = nfserr_perm;
} else
if (!err && EX_ISSYNC(tfhp->fh_export)) {
nfsd_sync_dir(tdentry);
nfsd_sync_dir(fdentry);
---- linux-2.4.19-hp2_pnnl2/fs/open.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/fs/open.c Sun Jan 19 19:41:00 2003
-@@ -19,6 +19,9 @@
+--- linux-2.4.19-hp2_pnnl4/fs/open.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/fs/open.c Sun Jan 19 19:41:00 2003
+@@ -19,6 +19,8 @@
#include <asm/uaccess.h>
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
+extern int path_walk_it(const char *name, struct nameidata *nd,
+ struct lookup_intent *it);
-+extern void intent_release(struct dentry *de, struct lookup_intent *it);
int vfs_statfs(struct super_block *sb, struct statfs *buf)
{
+@@ -95,9 +97,10 @@ void fd_install(unsigned int fd, struct
+ write_unlock(&files->file_lock);
+ }
+
+-int do_truncate(struct dentry *dentry, loff_t length)
++int do_truncate(struct dentry *dentry, loff_t length, int called_from_open)
+ {
+ struct inode *inode = dentry->d_inode;
++ struct inode_operations *op = dentry->d_inode->i_op;
+ int error;
+ struct iattr newattrs;
+
+@@ -108,7 +111,14 @@ int do_truncate(struct dentry *dentry, l
+ down(&inode->i_sem);
+ newattrs.ia_size = length;
+ newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
+- error = 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;
++ error = op->setattr_raw(inode, &newattrs);
++ } else
++ error = notify_change(dentry, &newattrs);
+ up(&inode->i_sem);
+ return error;
+ }
@@ -118,12 +121,13 @@ static inline long do_sys_truncate(const
struct nameidata nd;
struct inode * inode;
int error;
-+ struct lookup_intent it = { .it_op = IT_TRUNC };
++ struct lookup_intent it = { .it_op = IT_GETATTR };
error = -EINVAL;
if (length < 0) /* sorry, but loff_t says... */
if (error)
goto out;
inode = nd.dentry->d_inode;
-@@ -168,6 +172,7 @@ static inline long do_sys_truncate(const
+@@ -163,11 +167,13 @@ 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);
++ intent_release(nd.dentry, &it);
++ error = do_truncate(nd.dentry, length, 0);
+ }
put_write_access(inode);
dput_and_out:
path_release(&nd);
out:
return error;
-@@ -259,8 +264,9 @@ asmlinkage long sys_utime(char * filenam
- struct nameidata nd;
+@@ -215,7 +228,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:
+@@ -260,14 +273,16 @@ asmlinkage long sys_utime(char * filenam
struct inode * inode;
struct iattr newattrs;
-+ struct lookup_intent it = { .it_op = IT_SETATTR };
- error = user_path_walk(filename, &nd);
-+ error = user_path_walk_it(filename, &nd, &it);
++ error = user_path_walk_it(filename, &nd, NULL);
if (error)
goto out;
inode = nd.dentry->d_inode;
-@@ -286,6 +292,7 @@ asmlinkage long sys_utime(char * filenam
+
+- error = -EROFS;
+- if (IS_RDONLY(inode))
+- goto dput_and_out;
++ /* this is safe without a Lustre lock because it only depends
++ on the super block */
++ error = -EROFS;
++ if (IS_RDONLY(inode))
++ goto dput_and_out;
+
+ /* Don't worry, the checks are done in inode_change_ok() */
+ newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME;
+@@ -279,11 +294,29 @@ asmlinkage long sys_utime(char * filenam
+ goto dput_and_out;
+
+ newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET;
+- } else {
++ }
++
++ 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;
++ }
++
++ error = -EROFS;
++ if (IS_RDONLY(inode))
++ goto dput_and_out;
++
++ error = -EPERM;
++ if (!times) {
+ if (current->fsuid != inode->i_uid &&
+ (error = permission(inode,MAY_WRITE)) != 0)
+ goto dput_and_out;
}
++
error = notify_change(nd.dentry, &newattrs);
dput_and_out:
-+ intent_release(nd.dentry, &it);
path_release(&nd);
- out:
- return error;
-@@ -303,8 +310,9 @@ asmlinkage long sys_utimes(char * filena
- struct nameidata nd;
+@@ -304,16 +337,18 @@ asmlinkage long sys_utimes(char * filena
struct inode * inode;
struct iattr newattrs;
-+ struct lookup_intent it = { .it_op = IT_SETATTR };
- error = user_path_walk(filename, &nd);
-+ error = user_path_walk_it(filename, &nd, &it);
++ error = user_path_walk_it(filename, &nd, NULL);
if (error)
goto out;
-@@ -331,6 +339,7 @@ asmlinkage long sys_utimes(char * filena
- }
- error = notify_change(nd.dentry, &newattrs);
- dput_and_out:
-+ intent_release(nd.dentry, &it);
- path_release(&nd);
- out:
- return error;
+ inode = nd.dentry->d_inode;
+
+- error = -EROFS;
+- if (IS_RDONLY(inode))
+- goto dput_and_out;
+-
++ /* this is safe without a Lustre lock because it only depends
++ on the super block */
++ error = -EROFS;
++ if (IS_RDONLY(inode))
++ goto dput_and_out;
++
+ /* Don't worry, the checks are done in inode_change_ok() */
+ newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME;
+ if (utimes) {
+@@ -324,7 +359,20 @@ asmlinkage long sys_utimes(char * filena
+ newattrs.ia_atime = times[0].tv_sec;
+ newattrs.ia_mtime = times[1].tv_sec;
+ newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET;
+- } else {
++ }
++
++ 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;
++ }
++
++ error = -EPERM;
++ if (!utimes) {
+ if (current->fsuid != inode->i_uid &&
+ (error = permission(inode,MAY_WRITE)) != 0)
+ goto dput_and_out;
@@ -347,6 +356,7 @@ asmlinkage long sys_access(const char *
int old_fsuid, old_fsgid;
kernel_cap_t old_cap;
path_release(&nd);
out:
return error;
-@@ -515,8 +530,9 @@ asmlinkage long sys_chmod(const char * f
- struct inode * inode;
- int error;
- struct iattr newattrs;
-+ struct lookup_intent it = { .it_op = IT_SETATTR };
+@@ -508,6 +564,18 @@ asmlinkage long sys_chmod(const char * f
+ if (IS_RDONLY(inode))
+ goto dput_and_out;
-- error = user_path_walk(filename, &nd);
-+ error = user_path_walk_it(filename, &nd, &it);
- if (error)
++ if (inode->i_op->setattr_raw) {
++ struct inode_operations *op = nd.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 dput_and_out;
++ }
++
+ error = -EPERM;
+ if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+ goto dput_and_out;
+@@ -538,6 +606,20 @@ static int chown_common(struct dentry *
+ 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_uid = user;
++ newattrs.ia_gid = group;
++ newattrs.ia_valid = ATTR_UID | ATTR_GID;
++ 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;
++ }
++
+ error = -EPERM;
+ if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
goto out;
- inode = nd.dentry->d_inode;
-@@ -536,6 +552,7 @@ asmlinkage long sys_chmod(const char * f
- error = notify_change(nd.dentry, &newattrs);
-
- dput_and_out:
-+ intent_release(nd.dentry, &it);
- path_release(&nd);
- out:
- return error;
-@@ -605,10 +622,12 @@ asmlinkage long sys_chown(const char * f
- {
- struct nameidata nd;
- int error;
-+ struct lookup_intent it = { .it_op = IT_SETATTR };
-
-- error = user_path_walk(filename, &nd);
-+ error = user_path_walk_it(filename, &nd, &it);
- if (!error) {
- error = chown_common(nd.dentry, user, group);
-+ intent_release(nd.dentry, &it);
- path_release(&nd);
- }
- return error;
-@@ -618,10 +637,12 @@ asmlinkage long sys_lchown(const char *
- {
- struct nameidata nd;
- int error;
-+ struct lookup_intent it = { .it_op = IT_SETATTR };
-
-- error = user_path_walk_link(filename, &nd);
-+ error = user_path_walk_link_it(filename, &nd, &it);
- if (!error) {
- error = chown_common(nd.dentry, user, group);
-+ intent_release(nd.dentry, &it);
- path_release(&nd);
- }
- return error;
@@ -655,10 +676,16 @@ asmlinkage long sys_fchown(unsigned int
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
/*
* Find an empty file descriptor entry, and mark it busy.
*/
---- linux-2.4.19-hp2_pnnl2/fs/stat.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/fs/stat.c Sun Jan 19 19:44:51 2003
-@@ -13,6 +13,7 @@
-
- #include <asm/uaccess.h>
-
-+extern void intent_release(struct dentry *de, struct lookup_intent *it);
- /*
- * Revalidate the inode. This is required for proper NFS attribute caching.
- */
+--- linux-2.4.19-hp2_pnnl4/fs/stat.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/fs/stat.c Sun Jan 19 19:44:51 2003
@@ -135,13 +136,15 @@ static int cp_new_stat(struct inode * in
asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
{
path_release(&nd);
}
return error;
---- linux-2.4.18-18.8.0-l9/fs/exec.c~vfs_intent-2.4.18-18 Sun Feb 9 01:14:52 2003
-+++ linux-2.4.18-18.8.0-l9-braam/fs/exec.c Sun Feb 9 01:29:49 2003
-@@ -344,15 +344,19 @@ int setup_arg_pages(struct linux_binprm
- return 0;
- }
-
+--- linux-2.4.19-hp2_pnnl4/fs/exec.c~vfs_intent_hp Sun Feb 9 01:14:52 2003
++++ linux-2.4.19-hp2_pnnl4-root/fs/exec.c Sun Feb 9 01:29:49 2003
+@@ -103,13 +104,18 @@ static inline void put_binfmt(struct lin
+ *
+ * Also note that we take the address to load from from the file itself.
+ */
+extern struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
+ int flags, struct lookup_intent *it);
-+
- struct file *open_exec(const char *name)
++int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd,
++ struct lookup_intent *it);
+ asmlinkage long sys_uselib(const char * library)
{
+ struct file * file;
struct nameidata nd;
+ int error;
++ struct lookup_intent it = { .it_op = IT_OPEN, .it_flags = O_RDONLY };
+
+- error = user_path_walk(library, &nd);
++ error = user_path_walk_it(library, &nd, &it);
+ if (error)
+ goto out;
+
+@@ -121,7 +127,8 @@ asmlinkage long sys_uselib(const char *
+ if (error)
+ goto exit;
+
+- file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
++ file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &it);
++ intent_release(nd.dentry, &it);
+ error = PTR_ERR(file);
+ if (IS_ERR(file))
+ goto out;
+@@ -350,9 +350,10 @@ struct file *open_exec(const char *name)
struct inode *inode;
struct file *file;
int err = 0;
if (!IS_ERR(file)) {
err = deny_write_access(file);
if (err) {
---- linux-2.4.19-hp2_pnnl2/include/linux/dcache.h~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/include/linux/dcache.h Sun Jan 19 19:04:48 2003
-@@ -6,6 +6,26 @@
+@@ -976,7 +986,7 @@ int do_coredump(long signr, struct pt_re
+ 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);
+--- linux-2.4.19-hp2_pnnl4/include/linux/dcache.h~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/include/linux/dcache.h Sun Jan 19 19:04:48 2003
+@@ -6,6 +6,25 @@
#include <asm/atomic.h>
#include <linux/mount.h>
+#define IT_CREAT (1<<1)
+#define IT_READDIR (1<<2)
+#define IT_GETATTR (1<<3)
-+#define IT_SETATTR (1<<4)
-+#define IT_TRUNC (1<<5)
-+#define IT_LOOKUP (1<<7)
++#define IT_LOOKUP (1<<4)
++#define IT_UNLINK (1<<5)
+
+struct lookup_intent {
+ int it_op;
unsigned long d_vfs_flags;
void * d_fsdata; /* fs-specific data */
unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
-@@ -90,6 +119,8 @@ struct dentry_operations {
+@@ -90,8 +119,13 @@ struct dentry_operations {
int (*d_delete)(struct dentry *);
void (*d_release)(struct dentry *);
void (*d_iput)(struct dentry *, struct inode *);
+ void (*d_intent_release)(struct dentry *, struct lookup_intent *);
};
++/* defined in fs/namei.c */
++extern void intent_release(struct dentry *de, struct lookup_intent *it);
++
/* the dentry parameter passed to d_hash and d_compare is the parent
-@@ -124,6 +148,7 @@ d_iput: no no yes
+ * directory of the entries to be compared. It is used in case these
+ * functions need any directory specific information for determining
+@@ -124,6 +149,7 @@ d_iput: no no yes
* s_nfsd_free_path semaphore will be down
*/
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
extern spinlock_t dcache_lock;
---- linux-2.4.19-hp2_pnnl2/include/linux/fs.h~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/include/linux/fs.h Sun Jan 19 19:04:48 2003
+--- linux-2.4.19-hp2_pnnl4/include/linux/fs.h~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/include/linux/fs.h Sun Jan 19 19:04:48 2003
+@@ -338,6 +338,8 @@ extern void set_bh_page(struct buffer_he
+ #define ATTR_MTIME_SET 256
+ #define ATTR_FORCE 512 /* Not a change, but a change it */
+ #define ATTR_ATTR_FLAG 1024
++#define ATTR_RAW 2048 /* file system, not vfs will massage attrs */
++#define ATTR_FROM_OPEN 4096 /* called from open path, ie O_TRUNC */
+
+ /*
+ * This is the Inode Attributes structure, used for notify_change(). It
@@ -575,6 +575,7 @@ struct file {
/* needed for tty driver, and maybe others */
/*
* File types
-@@ -876,16 +879,28 @@ struct file_operations {
+@@ -876,20 +879,33 @@ struct file_operations {
struct inode_operations {
int (*create) (struct inode *,struct dentry *,int);
struct dentry * (*lookup) (struct inode *,struct dentry *);
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int);
int (*revalidate) (struct dentry *);
+ int (*setattr) (struct dentry *, struct iattr *);
++ int (*setattr_raw) (struct inode *, struct iattr *);
+ int (*getattr) (struct dentry *, struct iattr *);
+ int (*setxattr) (struct dentry *, const char *, void *, size_t, int);
+ ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
+@@ -1112,7 +1130,7 @@ static inline int get_lease(struct inode
+
+ asmlinkage long sys_open(const char *, int, int);
+ asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */
+-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);
@@ -1354,6 +1369,7 @@ typedef int (*read_actor_t)(read_descrip
extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
extern int page_readlink(struct dentry *, char *, int);
extern int page_follow_link(struct dentry *, struct nameidata *);
extern struct inode_operations page_symlink_inode_operations;
---- linux-2.4.19-hp2_pnnl2/kernel/ksyms.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
-+++ linux-2.4.19-hp2_pnnl2-root/kernel/ksyms.c Sun Jan 19 19:04:48 2003
+--- linux-2.4.19-hp2_pnnl4/kernel/ksyms.c~vfs_intent_hp Sun Jan 19 19:04:47 2003
++++ linux-2.4.19-hp2_pnnl4-root/kernel/ksyms.c Sun Jan 19 19:04:48 2003
@@ -293,6 +293,7 @@ EXPORT_SYMBOL(read_cache_page);
EXPORT_SYMBOL(set_page_dirty);
EXPORT_SYMBOL(vfs_readlink);