From eb43bd8a4adcb17dbd996bdd1782a436d8023b16 Mon Sep 17 00:00:00 2001 From: braam Date: Sun, 1 Jun 2003 07:20:07 +0000 Subject: [PATCH] - remove unused references to d_it etc. - make fixes for getattr and setattr methods --- .../patches/vfs_intent_2.5.69_rev1.patch | 231 ++++++++++++++++----- 1 file changed, 184 insertions(+), 47 deletions(-) diff --git a/lustre/kernel_patches/patches/vfs_intent_2.5.69_rev1.patch b/lustre/kernel_patches/patches/vfs_intent_2.5.69_rev1.patch index 05169d4..3c2f8a2 100644 --- a/lustre/kernel_patches/patches/vfs_intent_2.5.69_rev1.patch +++ b/lustre/kernel_patches/patches/vfs_intent_2.5.69_rev1.patch @@ -1,17 +1,18 @@ - fs/dcache.c | 15 +++++- - fs/namei.c | 114 ++++++++++++++++++++++++++++++++++++++++--------- + fs/dcache.c | 15 ++++- + fs/namei.c | 132 ++++++++++++++++++++++++++++++++++++++++--------- fs/namespace.c | 1 - fs/open.c | 70 ++++++++++++++++++++---------- + fs/open.c | 70 +++++++++++++++++-------- + fs/stat.c | 23 ++++++-- fs/sysfs/inode.c | 2 - include/linux/dcache.h | 28 ++++++++++++ - include/linux/fs.h | 9 +++ - include/linux/namei.h | 3 - - kernel/ksyms.c | 7 +++ + include/linux/dcache.h | 28 ++++++++++ + include/linux/fs.h | 10 +++ + include/linux/namei.h | 8 ++ + kernel/ksyms.c | 7 ++ net/unix/af_unix.c | 2 - 10 files changed, 203 insertions(+), 48 deletions(-) + 11 files changed, 241 insertions(+), 57 deletions(-) ---- uml-2.5/fs/sysfs/inode.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:15.000000000 -0600 -+++ uml-2.5-braam/fs/sysfs/inode.c 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/fs/sysfs/inode.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:20.000000000 -0600 ++++ uml-2.5-braam/fs/sysfs/inode.c 2003-05-31 22:24:46.000000000 -0600 @@ -80,7 +80,7 @@ struct dentry * sysfs_get_dentry(struct qstr.name = name; qstr.len = strlen(name); @@ -21,8 +22,8 @@ } void sysfs_hash_and_remove(struct dentry * dir, const char * name) ---- uml-2.5/fs/namei.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:13.000000000 -0600 -+++ uml-2.5-braam/fs/namei.c 2003-05-30 03:00:32.000000000 -0600 +--- uml-2.5/fs/namei.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:15.000000000 -0600 ++++ uml-2.5-braam/fs/namei.c 2003-06-01 00:44:04.000000000 -0600 @@ -263,8 +263,15 @@ int deny_write_access(struct file * file return 0; } @@ -133,7 +134,17 @@ } static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry) -@@ -539,7 +573,7 @@ done: +@@ -531,7 +565,8 @@ static int do_lookup(struct nameidata *n + + if (!dentry) + goto need_lookup; +- if (dentry->d_op && dentry->d_op->d_revalidate) ++ if (dentry->d_op && (dentry->d_op->d_revalidate || ++ dentry->d_op->d_revalidate_it) ) + goto need_revalidate; + done: + path->mnt = mnt; +@@ -539,13 +574,17 @@ done: return 0; need_lookup: @@ -142,7 +153,18 @@ if (IS_ERR(dentry)) goto fail; goto done; -@@ -673,7 +707,7 @@ int link_path_walk(const char * name, st + + need_revalidate: +- if (dentry->d_op->d_revalidate(dentry, flags)) ++ if (dentry->d_op->d_revalidate && ++ dentry->d_op->d_revalidate(dentry, flags)) ++ goto done; ++ if (dentry->d_op->d_revalidate_it && ++ dentry->d_op->d_revalidate_it(dentry, flags, &nd->it)) + goto done; + if (d_invalidate(dentry)) + goto done; +@@ -673,7 +712,7 @@ int link_path_walk(const char * name, st nd->dentry = next.dentry; } err = -ENOTDIR; @@ -151,7 +173,7 @@ break; continue; /* here ends the main loop */ -@@ -724,7 +758,8 @@ last_component: +@@ -724,7 +763,8 @@ last_component: break; if (lookup_flags & LOOKUP_DIRECTORY) { err = -ENOTDIR; @@ -161,7 +183,7 @@ break; } goto return_base; -@@ -866,7 +901,8 @@ int path_lookup(const char *name, unsign +@@ -866,7 +906,8 @@ int path_lookup(const char *name, unsign * needs parent already locked. Doesn't follow mounts. * SMP-safe. */ @@ -171,7 +193,7 @@ { struct dentry * dentry; struct inode *inode; -@@ -889,13 +925,16 @@ struct dentry * lookup_hash(struct qstr +@@ -889,13 +930,16 @@ struct dentry * lookup_hash(struct qstr goto out; } @@ -190,7 +212,7 @@ if (!dentry) dentry = new; else -@@ -906,7 +945,7 @@ out: +@@ -906,7 +950,7 @@ out: } /* SMP-safe */ @@ -199,7 +221,7 @@ { unsigned long hash; struct qstr this; -@@ -926,11 +965,16 @@ struct dentry * lookup_one_len(const cha +@@ -926,11 +970,16 @@ struct dentry * lookup_one_len(const cha } this.hash = end_name_hash(hash); @@ -217,7 +239,33 @@ /* * namei() * -@@ -1093,6 +1137,32 @@ void unlock_rename(struct dentry *p1, st +@@ -942,10 +991,11 @@ access: + * that namei follows links, while lnamei does not. + * SMP-safe + */ +-int __user_walk(const char __user *name, unsigned flags, struct nameidata *nd) ++int __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd) + { + char *tmp = getname(name); + int err = PTR_ERR(tmp); ++ + + if (!IS_ERR(tmp)) { + err = path_lookup(tmp, flags, nd); +@@ -954,6 +1004,12 @@ int __user_walk(const char __user *name, + return err; + } + ++int __user_walk(const char __user *name, unsigned flags, struct nameidata *nd) ++{ ++ nd->it = ((struct lookup_intent) {0}); ++ return __user_walk_it(name, flags, nd); ++} ++ + /* + * It's inline, so penalty for filesystems that don't use sticky bit is + * minimal. +@@ -1093,6 +1149,32 @@ void unlock_rename(struct dentry *p1, st } } @@ -250,7 +298,7 @@ int vfs_create(struct inode *dir, struct dentry *dentry, int mode) { int error = may_create(dir, dentry); -@@ -1232,6 +1302,9 @@ int open_namei(const char * pathname, in +@@ -1232,6 +1314,9 @@ int open_namei(const char * pathname, in /* * Create - we need to know the parent. */ @@ -260,7 +308,7 @@ error = path_lookup(pathname, LOOKUP_PARENT, nd); if (error) return error; -@@ -1247,7 +1320,7 @@ int open_namei(const char * pathname, in +@@ -1247,7 +1332,7 @@ int open_namei(const char * pathname, in dir = nd->dentry; down(&dir->d_inode->i_sem); @@ -269,7 +317,7 @@ do_last: error = PTR_ERR(dentry); -@@ -1255,12 +1328,13 @@ do_last: +@@ -1255,12 +1340,13 @@ do_last: up(&dir->d_inode->i_sem); goto exit; } @@ -285,7 +333,7 @@ up(&dir->d_inode->i_sem); dput(nd->dentry); nd->dentry = dentry; -@@ -1285,7 +1359,7 @@ do_last: +@@ -1285,7 +1371,7 @@ do_last: error = -ELOOP; if (flag & O_NOFOLLOW) goto exit_dput; @@ -294,7 +342,7 @@ } error = -ENOENT; if (!dentry->d_inode) -@@ -1328,7 +1402,7 @@ do_link: +@@ -1328,7 +1414,7 @@ do_link: if (error) goto exit_dput; UPDATE_ATIME(dentry->d_inode); @@ -303,7 +351,7 @@ dput(dentry); if (error) return error; -@@ -1350,7 +1424,7 @@ do_link: +@@ -1350,7 +1436,7 @@ do_link: } dir = nd->dentry; down(&dir->d_inode->i_sem); @@ -312,7 +360,7 @@ putname(nd->last.name); goto do_last; } -@@ -1364,7 +1438,7 @@ static struct dentry *lookup_create(stru +@@ -1364,7 +1450,7 @@ static struct dentry *lookup_create(stru dentry = ERR_PTR(-EEXIST); if (nd->last_type != LAST_NORM) goto fail; @@ -321,8 +369,8 @@ if (IS_ERR(dentry)) goto fail; if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode) ---- uml-2.5/fs/dcache.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:12.000000000 -0600 -+++ uml-2.5-braam/fs/dcache.c 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/fs/dcache.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:15.000000000 -0600 ++++ uml-2.5-braam/fs/dcache.c 2003-05-31 22:24:46.000000000 -0600 @@ -1134,14 +1134,23 @@ void d_delete(struct dentry * dentry) * Adds a dentry to the hash according to its name. */ @@ -350,8 +398,8 @@ } #define do_switch(x,y) do { \ ---- uml-2.5/fs/namespace.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:13.000000000 -0600 -+++ uml-2.5-braam/fs/namespace.c 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/fs/namespace.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:16.000000000 -0600 ++++ uml-2.5-braam/fs/namespace.c 2003-05-31 22:24:46.000000000 -0600 @@ -927,6 +927,7 @@ void set_fs_pwd(struct fs_struct *fs, st mntput(old_pwdmnt); } @@ -360,8 +408,8 @@ static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd) { ---- uml-2.5/fs/open.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:13.000000000 -0600 -+++ uml-2.5-braam/fs/open.c 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/fs/open.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:16.000000000 -0600 ++++ uml-2.5-braam/fs/open.c 2003-05-31 22:24:46.000000000 -0600 @@ -97,7 +97,8 @@ static inline long do_sys_truncate(const struct nameidata nd; struct inode * inode; @@ -513,8 +561,80 @@ /* * Find an empty file descriptor entry, and mark it busy. */ ---- uml-2.5/include/linux/dcache.h~vfs_intent_2.5.69_rev1 2003-05-30 02:20:28.000000000 -0600 -+++ uml-2.5-braam/include/linux/dcache.h 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/fs/stat.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:16.000000000 -0600 ++++ uml-2.5-braam/fs/stat.c 2003-06-01 01:06:38.000000000 -0600 +@@ -33,7 +33,7 @@ void generic_fillattr(struct inode *inod + stat->blksize = inode->i_blksize; + } + +-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; +@@ -44,6 +44,8 @@ int vfs_getattr(struct vfsmount *mnt, st + + if (inode->i_op->getattr) + return inode->i_op->getattr(mnt, dentry, stat); ++ if (inode->i_op->getattr_it) ++ return inode->i_op->getattr_it(mnt, dentry, it, stat); + + generic_fillattr(inode, stat); + if (!stat->blksize) { +@@ -56,14 +58,20 @@ 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); ++} ++ + int vfs_stat(char __user *name, struct kstat *stat) + { + struct nameidata nd; + int error; ++ nd.it = ((struct lookup_intent) { IT_GETATTR }); + +- error = user_path_walk(name, &nd); ++ error = user_path_walk_it(name, &nd); + if (!error) { +- error = vfs_getattr(nd.mnt, nd.dentry, stat); ++ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.it, stat); + path_release(&nd); + } + return error; +@@ -73,10 +81,11 @@ int vfs_lstat(char __user *name, struct + { + struct nameidata nd; + int error; ++ nd.it = ((struct lookup_intent) { IT_GETATTR }); + +- error = user_path_walk_link(name, &nd); ++ error = user_path_walk_link_it(name, &nd); + if (!error) { +- error = vfs_getattr(nd.mnt, nd.dentry, stat); ++ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.it, stat); + path_release(&nd); + } + return error; +@@ -86,11 +95,13 @@ int vfs_fstat(unsigned int fd, struct ks + { + struct file *f = fget(fd); + int error = -EBADF; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; + + if (f) { +- error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat); ++ error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &it, stat); + fput(f); + } ++ intent_release(f->f_dentry, &it); + return error; + } + +--- uml-2.5/include/linux/dcache.h~vfs_intent_2.5.69_rev1 2003-05-30 03:33:40.000000000 -0600 ++++ uml-2.5-braam/include/linux/dcache.h 2003-05-31 22:24:46.000000000 -0600 @@ -12,6 +12,27 @@ struct vfsmount; @@ -578,8 +698,8 @@ extern spinlock_t dcache_lock; ---- uml-2.5/include/linux/fs.h~vfs_intent_2.5.69_rev1 2003-05-30 02:20:29.000000000 -0600 -+++ uml-2.5-braam/include/linux/fs.h 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/include/linux/fs.h~vfs_intent_2.5.69_rev1 2003-05-30 03:33:41.000000000 -0600 ++++ uml-2.5-braam/include/linux/fs.h 2003-06-01 00:13:35.000000000 -0600 @@ -237,6 +237,9 @@ typedef int (get_blocks_t)(struct inode #define ATTR_ATTR_FLAG 1024 #define ATTR_KILL_SUID 2048 @@ -601,15 +721,17 @@ int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct inode *,struct dentry *,const char *); -@@ -743,6 +749,7 @@ struct inode_operations { +@@ -743,7 +749,9 @@ struct inode_operations { void (*truncate) (struct inode *); int (*permission) (struct inode *, int); int (*setattr) (struct dentry *, struct iattr *); + int (*setattr_raw) (struct inode *, struct iattr *); int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); ++ int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *); int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); -@@ -956,6 +963,7 @@ extern int register_filesystem(struct fi + ssize_t (*listxattr) (struct dentry *, char *, size_t); +@@ -956,6 +964,7 @@ extern int register_filesystem(struct fi extern int unregister_filesystem(struct file_system_type *); extern struct vfsmount *kern_mount(struct file_system_type *); extern int may_umount(struct vfsmount *); @@ -617,7 +739,7 @@ extern long do_mount(char *, char *, char *, unsigned long, void *); extern int vfs_statfs(struct super_block *, struct statfs *); -@@ -1116,6 +1124,7 @@ extern void sync_filesystems(int wait); +@@ -1116,6 +1125,7 @@ extern void sync_filesystems(int wait); extern sector_t bmap(struct inode *, sector_t); extern int setattr_mask(unsigned int); extern int notify_change(struct dentry *, struct iattr *); @@ -625,8 +747,8 @@ extern int permission(struct inode *, int); extern int vfs_permission(struct inode *, int); extern int get_write_access(struct inode *); ---- uml-2.5/include/linux/namei.h~vfs_intent_2.5.69_rev1 2003-05-30 02:20:30.000000000 -0600 -+++ uml-2.5-braam/include/linux/namei.h 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/include/linux/namei.h~vfs_intent_2.5.69_rev1 2003-05-30 03:33:42.000000000 -0600 ++++ uml-2.5-braam/include/linux/namei.h 2003-06-01 00:45:52.000000000 -0600 @@ -11,6 +11,7 @@ struct nameidata { struct qstr last; unsigned int flags; @@ -635,7 +757,22 @@ }; /* -@@ -44,7 +45,7 @@ extern int FASTCALL(link_path_walk(const +@@ -34,17 +35,22 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA + + + extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); ++extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)); + #define user_path_walk(name,nd) \ + __user_walk(name, LOOKUP_FOLLOW, nd) + #define user_path_walk_link(name,nd) \ + __user_walk(name, 0, nd) ++#define user_path_walk_it(name,nd) \ ++ __user_walk_it(name, LOOKUP_FOLLOW, nd) ++#define user_path_walk_link_it(name,nd) \ ++ __user_walk_it(name, 0, nd) + extern int FASTCALL(path_lookup(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 *); extern struct dentry * lookup_one_len(const char *, struct dentry *, int); @@ -644,8 +781,8 @@ extern int follow_down(struct vfsmount **, struct dentry **); extern int follow_up(struct vfsmount **, struct dentry **); ---- uml-2.5/kernel/ksyms.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:37.000000000 -0600 -+++ uml-2.5-braam/kernel/ksyms.c 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/kernel/ksyms.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:49.000000000 -0600 ++++ uml-2.5-braam/kernel/ksyms.c 2003-05-31 22:24:46.000000000 -0600 @@ -374,6 +374,7 @@ EXPORT_SYMBOL(unregister_filesystem); EXPORT_SYMBOL(kern_mount); EXPORT_SYMBOL(__mntput); @@ -667,8 +804,8 @@ /* waitqueue handling */ EXPORT_SYMBOL(add_wait_queue); EXPORT_SYMBOL(add_wait_queue_exclusive); ---- uml-2.5/net/unix/af_unix.c~vfs_intent_2.5.69_rev1 2003-05-30 02:20:48.000000000 -0600 -+++ uml-2.5-braam/net/unix/af_unix.c 2003-05-30 02:53:42.000000000 -0600 +--- uml-2.5/net/unix/af_unix.c~vfs_intent_2.5.69_rev1 2003-05-30 03:33:52.000000000 -0600 ++++ uml-2.5-braam/net/unix/af_unix.c 2003-05-31 22:24:46.000000000 -0600 @@ -721,7 +721,7 @@ static int unix_bind(struct socket *sock /* * Do the final lookup. -- 1.8.3.1