X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fkernel_patches%2Fpatches%2Fvfs_intent-2.4.21-chaos.patch;h=be9054e473cc76e1635dc9de2ac05517cda1bc0f;hb=d2c1ee7e70c7320ae64e5995c7a1e27c5259f637;hp=09ef2f9520dd1b05121daeec5822edf93945883e;hpb=090c677210ee2946d99c71412e4ff762bb300f4f;p=fs%2Flustre-release.git diff --git a/lustre/kernel_patches/patches/vfs_intent-2.4.21-chaos.patch b/lustre/kernel_patches/patches/vfs_intent-2.4.21-chaos.patch index 09ef2f9..be9054e 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.4.21-chaos.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.4.21-chaos.patch @@ -147,7 +147,7 @@ Index: linux-ia64/fs/namei.c struct dentry * dentry = d_lookup(parent, name); + if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) { -+ if (!dentry->d_op->d_revalidate_it(dentry, flags, it) && ++ if (!dentry->d_op->d_revalidate_it(dentry, flags, NULL, it) && + !d_invalidate(dentry)) { + dput(dentry); + dentry = NULL; @@ -179,7 +179,7 @@ Index: linux-ia64/fs/namei.c if (dentry) { lock_kernel(); + if (dir->i_op->lookup_it) -+ result = dir->i_op->lookup_it(dir, dentry, it, flags); ++ result = dir->i_op->lookup_it(dir, dentry, NULL, it, flags); + else result = dir->i_op->lookup(dir, dentry); unlock_kernel(); @@ -189,7 +189,7 @@ Index: linux-ia64/fs/namei.c result = ERR_PTR(-ENOENT); } + } else if (result->d_op && result->d_op->d_revalidate_it) { -+ if (!result->d_op->d_revalidate_it(result, flags, it) && ++ if (!result->d_op->d_revalidate_it(result, flags, NULL, it) && + !d_invalidate(result)) { + dput(result); + if (counter > 10) @@ -306,20 +306,20 @@ Index: linux-ia64/fs/namei.c dentry = nd->dentry; + if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) { + err = -ESTALE; -+ if (!dentry->d_op->d_revalidate_it(dentry, 0, it)) { ++ if (!dentry->d_op->d_revalidate_it(dentry, 0, NULL, it)) { + struct dentry *new; + err = permission(dentry->d_parent->d_inode, -+ MAY_EXEC); ++ MAY_EXEC); + if (err) + break; + new = real_lookup(dentry->d_parent, -+ &dentry->d_name, 0, NULL); -+ d_invalidate(dentry); -+ dput(dentry); ++ &dentry->d_name, 0, it); + if (IS_ERR(new)) { + err = PTR_ERR(new); + break; + } ++ d_invalidate(dentry); ++ dput(dentry); + nd->dentry = new; + } + if (!nd->dentry->d_inode) @@ -407,7 +407,7 @@ Index: linux-ia64/fs/namei.c goto out; lock_kernel(); + if (inode->i_op->lookup_it) -+ dentry = inode->i_op->lookup_it(inode, new, it, 0); ++ dentry = inode->i_op->lookup_it(inode, new, NULL, it, 0); + else dentry = inode->i_op->lookup(inode, new); unlock_kernel(); @@ -554,7 +554,7 @@ Index: linux-ia64/fs/namei.c if (!IS_POSIXACL(dir->d_inode)) mode &= ~current->fs->umask; - error = vfs_create(dir->d_inode, dentry, mode); -+ error = vfs_create_it(dir->d_inode, dentry, mode, it); ++ error = vfs_create_it(dir->d_inode, dentry, mode, it); up(&dir->d_inode->i_sem); dput(nd->dentry); nd->dentry = dentry; @@ -607,7 +607,7 @@ Index: linux-ia64/fs/namei.c + /* SMP-safe */ -static struct dentry *lookup_create(struct nameidata *nd, int is_dir) -+static struct dentry *lookup_create(struct nameidata *nd, int is_dir, ++struct dentry *lookup_create(struct nameidata *nd, int is_dir, + struct lookup_intent *it) { struct dentry *dentry; @@ -894,6 +894,15 @@ Index: linux-ia64/fs/namespace.c list_add(&mnt->mnt_hash, mount_hashtable+hash(nd->mnt, nd->dentry)); list_add(&mnt->mnt_child, &nd->mnt->mnt_mounts); nd->dentry->d_mounted++; +@@ -286,7 +293,7 @@ + } + } + +-static int do_umount(struct vfsmount *mnt, int flags) ++int do_umount(struct vfsmount *mnt, int flags) + { + struct super_block * sb = mnt->mnt_sb; + int retval = 0; @@ -488,14 +490,17 @@ static int do_loopback(struct nameidata { struct nameidata old_nd; @@ -930,7 +939,7 @@ Index: linux-ia64/fs/namespace.c int retval = 0; int mnt_flags = 0; -@@ -725,10 +732,11 @@ long do_mount(char * dev_name, char * di +@@ -725,9 +732,11 @@ long do_mount(char * dev_name, char * di flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV); /* ... and get the mountpoint */ @@ -940,11 +949,10 @@ Index: linux-ia64/fs/namespace.c + if (retval) { + intent_release(&it); return retval; -- + } + if (flags & MS_REMOUNT) retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, - data_page); @@ -739,6 +747,8 @@ long do_mount(char * dev_name, char * di else retval = do_add_mount(&nd, type_page, flags, mnt_flags, @@ -1202,7 +1210,7 @@ Index: linux-ia64/fs/open.c - error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW | - LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd); + error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW | -+ LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it); ++ LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it); if (error) goto out; @@ -1560,7 +1568,7 @@ Index: linux-ia64/include/linux/dcache.h =================================================================== --- linux-ia64.orig/include/linux/dcache.h 2004-03-17 15:47:15.000000000 -0800 +++ linux-ia64/include/linux/dcache.h 2004-03-17 16:05:28.000000000 -0800 -@@ -6,6 +6,51 @@ +@@ -6,6 +6,52 @@ #include #include #include @@ -1575,6 +1583,7 @@ Index: linux-ia64/include/linux/dcache.h +#define IT_GETXATTR 0x0040 +#define IT_EXEC 0x0080 +#define IT_PIN 0x0100 ++#define IT_CHDIR 0x0200 + +#define IT_FL_LOCKED 0x0001 +#define IT_FL_FOLLOWED 0x0002 /* set by vfs_follow_link */ @@ -1612,11 +1621,20 @@ Index: linux-ia64/include/linux/dcache.h /* * linux/include/linux/dcache.h +@@ -84,6 +130,8 @@ + unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ + }; + ++struct nameidata; ++ + struct dentry_operations { + int (*d_revalidate)(struct dentry *, int); + int (*d_hash) (struct dentry *, struct qstr *); @@ -96,8 +141,22 @@ struct dentry_operations { int (*d_delete)(struct dentry *); void (*d_release)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); -+ int (*d_revalidate_it)(struct dentry *, int, struct lookup_intent *); ++ int (*d_revalidate_it)(struct dentry *, int, struct nameidata *, struct lookup_intent *); + void (*d_pin)(struct dentry *, struct vfsmount * , int); + void (*d_unpin)(struct dentry *, struct vfsmount *, int); }; @@ -1661,7 +1679,7 @@ Index: linux-ia64/include/linux/fs.h #define ATTR_ATTR_FLAG 1024 +#define ATTR_RAW 0x0800 /* file system, not vfs will massage attrs */ +#define ATTR_FROM_OPEN 0x1000 /* called from open path, ie O_TRUNC */ -+#define ATTR_CTIME_SET 0x2000 ++#define ATTR_CTIME_SET 0x2000 /* * This is the Inode Attributes structure, used for notify_change(). It @@ -1705,7 +1723,7 @@ Index: linux-ia64/include/linux/fs.h int (*create) (struct inode *,struct dentry *,int); + int (*create_it) (struct inode *,struct dentry *,int, struct lookup_intent *); struct dentry * (*lookup) (struct inode *,struct dentry *); -+ struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct lookup_intent *, int flags); ++ struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct nameidata *, struct lookup_intent *, int flags); int (*link) (struct dentry *,struct inode *,struct dentry *); + int (*link_raw) (struct nameidata *,struct nameidata *); int (*unlink) (struct inode *,struct dentry *); @@ -1732,12 +1750,22 @@ Index: linux-ia64/include/linux/fs.h int (*getattr) (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); -@@ -1131,10 +1150,14 @@ static inline int get_lease(struct inode +@@ -938,6 +957,7 @@ + int (*remount_fs) (struct super_block *, int *, char *); + void (*clear_inode) (struct inode *); + void (*umount_begin) (struct super_block *); ++ void (*umount_lustre) (struct super_block *); + + /* Following are for knfsd to interact with "interesting" filesystems + * Currently just reiserfs, but possibly FAT and others later +@@ -1131,10 +1150,16 @@ 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); ++struct dentry *lookup_create(struct nameidata *nd, int is_dir, ++ struct lookup_intent *it); extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); @@ -1845,11 +1873,33 @@ Index: linux-ia64/kernel/ksyms.c =================================================================== --- linux-ia64.orig/kernel/ksyms.c 2004-03-17 16:05:28.000000000 -0800 +++ linux-ia64/kernel/ksyms.c 2004-03-17 16:05:51.000000000 -0800 -@@ -318,6 +318,7 @@ EXPORT_SYMBOL(read_cache_page); +@@ -318,6 +318,9 @@ EXPORT_SYMBOL(read_cache_page); EXPORT_SYMBOL(set_page_dirty); EXPORT_SYMBOL(vfs_readlink); EXPORT_SYMBOL(vfs_follow_link); +EXPORT_SYMBOL(vfs_follow_link_it); ++EXPORT_SYMBOL(do_umount); ++EXPORT_SYMBOL(lookup_create); EXPORT_SYMBOL(page_readlink); EXPORT_SYMBOL(page_follow_link); EXPORT_SYMBOL(page_symlink_inode_operations); +===== include/linux/mount.h 1.7 vs edited ===== +--- linux-ia64.orig/include/linux/mount.h Tue Feb 5 09:49:35 2002 ++++ linux-ia64/include/linux/mount.h Tue May 4 19:23:48 2004 +@@ -29,6 +29,8 @@ + int mnt_flags; + char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ + struct list_head mnt_list; ++ struct list_head mnt_lustre_list; /* GNS mount list */ ++ unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */ + }; + + static inline struct vfsmount *mntget(struct vfsmount *mnt) +@@ -39,6 +39,7 @@ + } + + extern void __mntput(struct vfsmount *mnt); ++extern int do_umount(struct vfsmount *mnt, int flags); + + static inline void mntput(struct vfsmount *mnt) + {