Whamcloud - gitweb
- make HEAD from b_post_cmd3
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent-2.6-fc3.patch
index c0f6a0d..234e6ca 100644 (file)
@@ -1,19 +1,6 @@
----
- 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;
@@ -26,7 +13,7 @@
        if (error)
                goto out;
  
-@@ -138,7 +139,7 @@ asmlinkage long sys_uselib(const char __
+@@ -138,7 +139,7 @@
        if (error)
                goto exit;
  
@@ -35,7 +22,7 @@
        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;
  
@@ -47,7 +34,7 @@
        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) {
@@ -58,7 +45,7 @@
                                        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--;
  }
  
@@ -68,7 +55,7 @@
   * @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;
  }
  
@@ -88,7 +75,7 @@
        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;
@@ -99,7 +86,7 @@
        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 *);