Whamcloud - gitweb
b=19625
authorgirish <girish>
Thu, 16 Jul 2009 07:40:12 +0000 (07:40 +0000)
committergirish <girish>
Thu, 16 Jul 2009 07:40:12 +0000 (07:40 +0000)
i=girish
i=johann
i=tianzy
o=adilger

- simplified wantedi patch with /proc for testing
- cleanup for ldiskfs-ext4 patches on SLES11

ldiskfs/kernel_patches/patches/ext4-alloc-policy-2.6-sles11.patch
ldiskfs/kernel_patches/patches/ext4-ext_generation-sles11.patch
ldiskfs/kernel_patches/patches/ext4-fiemap-2.6-sles11.patch
ldiskfs/kernel_patches/patches/ext4-force_over_8tb-sles11.patch
ldiskfs/kernel_patches/patches/ext4-max-dir-size-sles11.patch
ldiskfs/kernel_patches/patches/ext4-misc-sles11.patch
ldiskfs/kernel_patches/patches/ext4-mmp-sles11.patch
ldiskfs/kernel_patches/patches/ext4-wantedi-2.6-sles11.patch
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series

index a39fb88..b5febbf 100644 (file)
@@ -1,8 +1,8 @@
 Index: linux-2.6.27.21-0.1/fs/ext4/ialloc.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ialloc.c
-+++ linux-2.6.27.21-0.1/fs/ext4/ialloc.c
-@@ -1005,6 +1005,36 @@ fail_drop:
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ialloc.c  2009-07-07 14:47:04.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ialloc.c       2009-07-07 15:04:02.000000000 +0530
+@@ -953,6 +953,36 @@
        return ERR_PTR(err);
  }
  
@@ -41,24 +41,10 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ialloc.c
  {
 Index: linux-2.6.27.21-0.1/fs/ext4/namei.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/namei.c
-+++ linux-2.6.27.21-0.1/fs/ext4/namei.c
-@@ -151,14 +151,24 @@ struct dx_map_entry
-       u16 size;
- };
-+/*
-+ * dentry_param used by ext4_new_inode_wantedi()
-+ */
- #define LVFS_DENTRY_PARAM_MAGIC               20070216UL
- struct lvfs_dentry_params
- {
--      unsigned long   p_inum;
--      void        *p_ptr;
--      u32          magic;
-+      unsigned long   ldp_inum;
-+      long            ldp_flags;
-+      u32             ldp_magic;
+--- linux-2.6.27.21-0.1.orig/fs/ext4/namei.c   2009-07-07 14:47:05.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/namei.c        2009-07-07 15:04:21.000000000 +0530
+@@ -161,6 +161,12 @@
+       u32             ldp_magic;
  };
  
 +/* Only use the least 3 bits of ldp_flags for goal policy */
@@ -67,35 +53,35 @@ Index: linux-2.6.27.21-0.1/fs/ext4/namei.c
 +      DP_LASTGROUP_REVERSE = 1,
 +} dp_policy_t;
 +
-+
  static inline ext4_lblk_t dx_get_block(struct dx_entry *entry);
  static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value);
  static inline unsigned dx_get_hash(struct dx_entry *entry);
-@@ -1770,8 +1780,13 @@ static struct inode * ext4_new_inode_wan
+@@ -1771,8 +1777,14 @@
        if (dentry->d_fsdata != NULL) {
                struct lvfs_dentry_params *param = dentry->d_fsdata;
  
--              if (param->magic == LVFS_DENTRY_PARAM_MAGIC)
--                      inum = param->p_inum;
+-              if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC)
+-                      inum = param->ldp_inum;
 +              if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC) {
 +                      if ((dp_policy_t)(param->ldp_flags & 0x7) ==
 +                          DP_LASTGROUP_REVERSE)
-+                              inum = ext4_find_reverse(dir->i_sb);
-+                        else /* DP_GOAL_POLICY */
++                              inum = ext4_find_reverse(sb);
++                      else /* DP_GOAL_POLICY */
 +                              inum = param->ldp_inum;
-+                }
++              }
++
        }
-       return ext4_new_inode(handle, dir, mode, inum);
+       return inum;
  }
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4.h
-@@ -1089,6 +1089,7 @@ extern int ext4fs_dirhash(const char *na
- /* ialloc.c */
- extern struct inode * ext4_new_inode(handle_t *, struct inode *, int,
-                                    unsigned long);
-+extern unsigned long ext4_find_reverse(struct super_block *);
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h    2009-07-07 14:47:22.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-07-07 15:04:02.000000000 +0530
+@@ -1101,6 +1101,7 @@
+                                  EXT4_SB(dir->i_sb)->s_inode_goal);
+ }
  extern void ext4_free_inode(handle_t *, struct inode *);
++extern unsigned long ext4_find_reverse(struct super_block *);
  extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
  extern unsigned long ext4_count_free_inodes(struct super_block *);
+ extern unsigned long ext4_count_dirs(struct super_block *);
index 742d0ab..6d51ad3 100644 (file)
@@ -1,14 +1,14 @@
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_extents.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
-@@ -203,6 +203,11 @@ static inline unsigned short ext_depth(s
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_extents.h    2009-07-07 14:47:22.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h 2009-07-07 14:49:31.000000000 +0530
+@@ -203,6 +203,11 @@
        return le16_to_cpu(ext_inode_hdr(inode)->eh_depth);
  }
  
 +static inline void ext4_ext_tree_changed(struct inode *inode)
 +{
-+        EXT4_I(inode)->i_ext_generation++;
++      EXT4_I(inode)->i_ext_generation++;
 +}
 +
  static inline void
@@ -16,21 +16,21 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
  {
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_i.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_i.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_i.h
-@@ -114,6 +114,7 @@ struct ext4_inode_info {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_i.h  2009-07-07 14:47:13.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_i.h       2009-07-07 14:50:07.000000000 +0530
+@@ -114,6 +114,7 @@
        struct inode vfs_inode;
        struct jbd2_inode jinode;
  
-+        unsigned long i_ext_generation;
++      unsigned long i_ext_generation;
        struct ext4_ext_cache i_cached_extent;
        /*
         * File creation time. Its function is same as that of
 Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c
-+++ linux-2.6.27.21-0.1/fs/ext4/extents.c
-@@ -1618,6 +1618,7 @@ cleanup:
+--- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c 2009-07-07 14:48:03.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/extents.c      2009-07-07 14:48:58.000000000 +0530
+@@ -1618,6 +1618,7 @@
                ext4_ext_drop_refs(npath);
                kfree(npath);
        }
@@ -38,7 +38,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
        ext4_ext_invalidate_cache(inode);
        return err;
  }
-@@ -2278,6 +2279,7 @@ static int ext4_ext_remove_space(struct 
+@@ -2279,6 +2280,7 @@
                }
        }
  out:
index 6631a5b..090a829 100644 (file)
@@ -3,8 +3,8 @@ upstream kernel.
 
 Index: linux-2.6.27.21-0.1/fs/ext4/ioctl.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ioctl.c
-+++ linux-2.6.27.21-0.1/fs/ext4/ioctl.c
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ioctl.c   2009-07-07 14:08:22.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ioctl.c        2009-07-07 14:38:12.000000000 +0530
 @@ -18,6 +18,162 @@
  #include "ext4_jbd2.h"
  #include "ext4.h"
@@ -168,7 +168,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ioctl.c
  long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
  {
        struct inode *inode = filp->f_dentry->d_inode;
-@@ -263,6 +419,10 @@ setversion_out:
+@@ -263,6 +419,10 @@
                return err;
        }
  
@@ -181,9 +181,9 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ioctl.c
        }
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4.h
-@@ -302,7 +302,8 @@ struct ext4_new_group_data {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h    2009-07-07 14:36:58.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-07-07 14:46:12.000000000 +0530
+@@ -302,7 +302,8 @@
  #define EXT4_IOC_GROUP_EXTEND         _IOW('f', 7, unsigned long)
  #define EXT4_IOC_GROUP_ADD            _IOW('f', 8, struct ext4_new_group_input)
  #define EXT4_IOC_MIGRATE              _IO('f', 9)
@@ -193,7 +193,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
  
  /*
   * ioctl commands in 32 bit emulation
-@@ -320,6 +321,8 @@ struct ext4_new_group_data {
+@@ -320,6 +321,8 @@
  #define EXT4_IOC32_GETVERSION_OLD     FS_IOC32_GETVERSION
  #define EXT4_IOC32_SETVERSION_OLD     FS_IOC32_SETVERSION
  
@@ -202,7 +202,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
  
  /*
   *  Mount options
-@@ -1132,6 +1135,9 @@ extern int ext4_page_mkwrite(struct vm_a
+@@ -1138,6 +1141,9 @@
  /* ioctl.c */
  extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
  extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
@@ -214,9 +214,9 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
  extern int ext4_ext_migrate(struct inode *);
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_extents.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
-@@ -128,6 +128,22 @@ struct ext4_ext_path {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_extents.h    2009-07-07 14:08:22.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h 2009-07-07 14:46:11.000000000 +0530
+@@ -128,6 +128,22 @@
  #define EXT_MAX_BLOCK 0xffffffff
  
  /*
@@ -239,7 +239,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
   * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
   * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
   * MSB of ee_len field in the extent datastructure to signify if this
-@@ -219,6 +235,8 @@ extern int ext4_ext_try_to_merge(struct 
+@@ -219,6 +235,8 @@
                                 struct ext4_extent *);
  extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
  extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
@@ -250,8 +250,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
  extern int ext4_ext_search_left(struct inode *, struct ext4_ext_path *,
 Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c
-+++ linux-2.6.27.21-0.1/fs/ext4/extents.c
+--- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c 2009-07-07 14:08:22.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/extents.c      2009-07-07 14:46:59.000000000 +0530
 @@ -42,7 +42,7 @@
  #include <asm/uaccess.h>
  #include "ext4_jbd2.h"
@@ -261,7 +261,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
  
  /*
   * ext_pblock:
-@@ -1622,6 +1622,113 @@ cleanup:
+@@ -1622,6 +1622,114 @@
        return err;
  }
  
@@ -371,11 +371,12 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
 +
 +      return err;
 +}
++EXPORT_SYMBOL(ext4_ext_walk_space);
 +
  static void
  ext4_ext_put_in_cache(struct inode *inode, ext4_lblk_t block,
                        __u32 len, ext4_fsblk_t start, int type)
-@@ -2966,3 +3073,100 @@ retry:
+@@ -2966,3 +3074,100 @@
        mutex_unlock(&inode->i_mutex);
        return ret > 0 ? ret2 : ret;
  }
@@ -478,8 +479,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
 +}
 Index: linux-2.6.27.21-0.1/fs/ext4/fiemap.h
 ===================================================================
---- /dev/null
-+++ linux-2.6.27.21-0.1/fs/ext4/fiemap.h
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.27.21-0.1/fs/ext4/fiemap.h       2009-07-07 14:38:12.000000000 +0530
 @@ -0,0 +1,85 @@
 +/*
 + * FIEMAP ioctl infrastructure.
index 1e15050..c16578e 100644 (file)
@@ -1,7 +1,7 @@
 Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/super.c
-+++ linux-2.6.27.21-0.1/fs/ext4/super.c
+--- linux-2.6.27.21-0.1.orig/fs/ext4/super.c   2009-07-07 15:00:32.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/super.c        2009-07-07 15:01:30.000000000 +0530
 @@ -52,6 +52,8 @@
  
  struct proc_dir_entry *ext4_proc_root;
@@ -11,24 +11,24 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
                             unsigned long journal_devnum);
  static int ext4_create_journal(struct super_block *, struct ext4_super_block *,
-@@ -1295,7 +1297,7 @@ enum {
+@@ -1287,7 +1289,7 @@
+       Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
+       Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
+       Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
+-      Opt_mballoc,
++      Opt_mballoc, Opt_force_over_8tb,
        Opt_stripe, Opt_delalloc, Opt_nodelalloc,
        Opt_inode_readahead_blks, Opt_bigendian_extents,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
--      Opt_mballoc
-+      Opt_mballoc, Opt_force_over_8tb
- };
- static match_table_t tokens = {
-@@ -1358,6 +1360,7 @@ static match_table_t tokens = {
-       {Opt_inode_readahead_blks, "inode_readahead_blks=%u"},
-       {Opt_bigendian_extents, "bigendian_extents"},
+@@ -1349,6 +1351,7 @@
+       {Opt_stripe, "stripe=%u"},
+       {Opt_resize, "resize"},
        {Opt_mballoc, "mballoc"},
 +      {Opt_force_over_8tb, "force_over_8tb"},
-       {Opt_err, NULL},
- };
-@@ -1778,6 +1781,9 @@ set_qf_format:
+       {Opt_delalloc, "delalloc"},
+       {Opt_nodelalloc, "nodelalloc"},
+       {Opt_inode_readahead_blks, "inode_readahead_blks=%u"},
+@@ -1773,6 +1776,9 @@
                        break;
                case Opt_mballoc:
                        break;
@@ -38,7 +38,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
                default:
                        printk(KERN_ERR
                               "EXT4-fs: Unrecognized mount option \"%s\" "
-@@ -2639,6 +2645,17 @@ static int ext4_fill_super(struct super_
+@@ -2634,6 +2640,17 @@
                goto failed_mount;
        }
  
index 4b0db60..fb7cb5a 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-stage/fs/ext4/ialloc.c
+Index: linux-2.6.27.21-0.1/fs/ext4/ialloc.c
 ===================================================================
---- linux-stage.orig/fs/ext4/ialloc.c
-+++ linux-stage/fs/ext4/ialloc.c
-@@ -700,12 +700,15 @@ struct inode *ext4_new_inode(handle_t *h
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ialloc.c  2009-07-07 14:35:55.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ialloc.c       2009-07-07 14:38:17.000000000 +0530
+@@ -700,12 +700,15 @@
                return ERR_PTR(-EPERM);
  
        sb = dir->i_sb;
@@ -18,11 +18,11 @@ Index: linux-stage/fs/ext4/ialloc.c
 -      sbi = EXT4_SB(sb);
        es = sbi->s_es;
  
-       if (goal) {
-Index: linux-stage/fs/ext4/super.c
+       if (goal && goal < le32_to_cpu(es->s_inodes_count)) {
+Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 ===================================================================
---- linux-stage.orig/fs/ext4/super.c
-+++ linux-stage/fs/ext4/super.c
+--- linux-2.6.27.21-0.1.orig/fs/ext4/super.c   2009-07-07 14:38:06.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/super.c        2009-07-07 14:38:41.000000000 +0530
 @@ -41,6 +41,7 @@
  #include <asm/uaccess.h>
  #include <linux/kthread.h>
@@ -31,7 +31,7 @@ Index: linux-stage/fs/ext4/super.c
  
  #include "ext4.h"
  #include "ext4_jbd2.h"
-@@ -71,6 +72,8 @@ static void ext4_write_super(struct supe
+@@ -71,6 +72,8 @@
  static void ext4_write_super_lockfs(struct super_block *sb);
  
  
@@ -40,15 +40,7 @@ Index: linux-stage/fs/ext4/super.c
  ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
                               struct ext4_group_desc *bg)
  {
-@@ -564,6 +567,7 @@ static void ext4_put_super(struct super_
-       }
-       if (sbi->s_proc) {
-               remove_proc_entry("inode_readahead_blks", sbi->s_proc);
-+              remove_proc_entry(EXT4_MAX_DIR_SIZE_NAME, sbi->s_proc);
-               remove_proc_entry(sb->s_id, ext4_proc_root);
-       }
-@@ -602,6 +606,7 @@ static void ext4_put_super(struct super_
+@@ -603,6 +606,7 @@
        }
        if (sbi->s_mmp_tsk)
                kthread_stop(sbi->s_mmp_tsk);
@@ -56,7 +48,7 @@ Index: linux-stage/fs/ext4/super.c
        sb->s_fs_info = NULL;
        kfree(sbi);
        return;
-@@ -2287,6 +2292,46 @@ static unsigned long ext4_get_stripe_siz
+@@ -2283,6 +2287,46 @@
        return 0;
  }
  
@@ -103,7 +95,7 @@ Index: linux-stage/fs/ext4/super.c
  static int ext4_fill_super(struct super_block *sb, void *data, int silent)
                                __releases(kernel_lock)
                                __acquires(kernel_lock)
-@@ -2311,6 +2356,7 @@ static int ext4_fill_super(struct super_
+@@ -2307,6 +2351,7 @@
        int needs_recovery, has_huge_files;
        int features;
        __u64 blocks_count;
@@ -111,7 +103,7 @@ Index: linux-stage/fs/ext4/super.c
        int err;
  
        sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
-@@ -2880,6 +2926,22 @@ static int ext4_fill_super(struct super_
+@@ -2880,6 +2925,22 @@
               test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered":
               "writeback");
  
@@ -134,7 +126,15 @@ Index: linux-stage/fs/ext4/super.c
        lock_kernel();
        return 0;
  
-@@ -3253,7 +3315,6 @@ static void ext4_commit_super(struct sup
+@@ -2906,6 +2967,7 @@
+ failed_mount:
+       if (sbi->s_proc) {
+               remove_proc_entry("inode_readahead_blks", sbi->s_proc);
++              remove_proc_entry(EXT4_MAX_DIR_SIZE_NAME, sbi->s_proc);
+               remove_proc_entry("inode_goal", sbi->s_proc);
+               remove_proc_entry(sb->s_id, ext4_proc_root);
+       }
+@@ -3254,7 +3316,6 @@
        }
  }
  
@@ -142,11 +142,11 @@ Index: linux-stage/fs/ext4/super.c
  /*
   * Have we just finished recovery?  If so, and if we are mounting (or
   * remounting) the filesystem readonly, then we will end up with a
-Index: linux-stage/fs/ext4/ext4_sb.h
+Index: linux-2.6.27.21-0.1/fs/ext4/ext4_sb.h
 ===================================================================
---- linux-stage.orig/fs/ext4/ext4_sb.h
-+++ linux-stage/fs/ext4/ext4_sb.h
-@@ -118,6 +118,7 @@ struct ext4_sb_info {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_sb.h 2009-07-07 14:36:58.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_sb.h      2009-07-07 14:38:17.000000000 +0530
+@@ -119,6 +119,7 @@
        /* where last allocation was done - for stream allocation */
        unsigned long s_mb_last_group;
        unsigned long s_mb_last_start;
@@ -154,11 +154,11 @@ Index: linux-stage/fs/ext4/ext4_sb.h
  
        /* history to debug policy */
        struct ext4_mb_history *s_mb_history;
-Index: linux-stage/fs/ext4/ext4.h
+Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
 ===================================================================
---- linux-stage.orig/fs/ext4/ext4.h
-+++ linux-stage/fs/ext4/ext4.h
-@@ -1017,6 +1017,14 @@ struct mmp_struct {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h    2009-07-07 14:38:12.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-07-07 14:38:17.000000000 +0530
+@@ -1017,6 +1017,14 @@
   */
  #define EXT4_MMP_MIN_CHECK_INTERVAL   5
  
@@ -173,11 +173,11 @@ Index: linux-stage/fs/ext4/ext4.h
  /*
   * Function prototypes
   */
-Index: linux-stage/fs/ext4/mballoc.c
+Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
 ===================================================================
---- linux-stage.orig/fs/ext4/mballoc.c
-+++ linux-stage/fs/ext4/mballoc.c
-@@ -2943,6 +2943,7 @@ err_out:
+--- linux-2.6.27.21-0.1.orig/fs/ext4/mballoc.c 2009-07-07 14:08:21.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/mballoc.c      2009-07-07 14:38:17.000000000 +0530
+@@ -2943,6 +2943,7 @@
        remove_proc_entry(EXT4_MB_MIN_TO_SCAN_NAME, sbi->s_proc);
        remove_proc_entry(EXT4_MB_MAX_TO_SCAN_NAME, sbi->s_proc);
        remove_proc_entry(EXT4_MB_STATS_NAME, sbi->s_proc);
@@ -185,7 +185,7 @@ Index: linux-stage/fs/ext4/mballoc.c
        return -ENOMEM;
  #else
        return 0;
-@@ -2963,6 +2964,7 @@ static int ext4_mb_destroy_per_dev_proc(
+@@ -2963,6 +2964,7 @@
        remove_proc_entry(EXT4_MB_MIN_TO_SCAN_NAME, sbi->s_proc);
        remove_proc_entry(EXT4_MB_MAX_TO_SCAN_NAME, sbi->s_proc);
        remove_proc_entry(EXT4_MB_STATS_NAME, sbi->s_proc);
index 9899574..b0a08bf 100644 (file)
@@ -1,7 +1,7 @@
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_jbd2.h       2009-06-02 18:39:19.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.h    2009-06-04 17:01:43.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_jbd2.h       2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.h    2009-07-07 14:47:22.000000000 +0530
 @@ -35,6 +35,9 @@
        (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)   \
                || test_opt(sb, EXTENTS) ? 27U : 8U)
@@ -14,8 +14,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.h
   * and the superblock, which are already accounted for. */
 Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c 2009-06-04 17:01:43.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/extents.c      2009-06-04 17:01:48.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c 2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/extents.c      2009-07-07 14:48:03.000000000 +0530
 @@ -48,7 +48,7 @@
   * ext_pblock:
   * combine low and high parts of physical block number into ext4_fsblk_t
@@ -61,7 +61,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
   * ext4_idx_store_pblock:
   * stores a large physical block number into an index struct,
   * breaking it into parts
-@@ -1851,6 +1851,56 @@
+@@ -1852,6 +1852,56 @@
  }
  
  /*
@@ -118,7 +118,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
   * ext4_ext_calc_credits_for_single_extent:
   * This routine returns max. credits that needed to insert an extent
   * to the extent tree.
-@@ -3170,3 +3220,14 @@
+@@ -3171,3 +3221,13 @@
  
        return error;
  }
@@ -129,14 +129,13 @@ Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
 +EXPORT_SYMBOL(ext_pblock);
 +EXPORT_SYMBOL(ext4_ext_insert_extent);
 +EXPORT_SYMBOL(ext4_mb_new_blocks);
-+EXPORT_SYMBOL(ext4_ext_walk_space);
 +EXPORT_SYMBOL(ext4_ext_calc_credits_for_insert);
 +EXPORT_SYMBOL(ext4_mark_inode_dirty);
 +
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_extents.h    2009-06-04 17:01:43.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h 2009-06-04 17:01:48.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_extents.h    2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h 2009-07-07 14:47:22.000000000 +0530
 @@ -59,6 +59,11 @@
   */
  #define EXT_STATS_
@@ -174,9 +173,9 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4_extents.h
                                                   struct ext4_ext_path *path);
 Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/mballoc.c 2009-06-04 17:01:43.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/mballoc.c      2009-06-04 17:01:43.000000000 +0530
-@@ -4354,6 +4354,13 @@
+--- linux-2.6.27.21-0.1.orig/fs/ext4/mballoc.c 2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/mballoc.c      2009-07-07 14:47:22.000000000 +0530
+@@ -4355,6 +4355,13 @@
                kmem_cache_free(ext4_ac_cachep, ac);
  }
  
@@ -190,7 +189,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
  /*
   * finds all preallocated spaces and return blocks being freed to them
   * if preallocated space becomes full (no block is used from the space)
-@@ -5176,3 +5183,6 @@
+@@ -5177,3 +5184,6 @@
                kmem_cache_free(ext4_ac_cachep, ac);
        return;
  }
@@ -199,8 +198,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
 +
 Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/super.c   2009-06-04 17:01:43.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/super.c        2009-06-04 17:01:46.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/super.c   2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/super.c        2009-07-07 14:48:53.000000000 +0530
 @@ -91,6 +91,7 @@
                (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ?
                (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_bitmap_hi) << 32 : 0);
@@ -209,23 +208,23 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  
  ext4_fsblk_t ext4_inode_table(struct super_block *sb,
                              struct ext4_group_desc *bg)
-@@ -1295,6 +1296,7 @@
+@@ -1286,6 +1287,7 @@
+       Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
+       Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
+       Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
++      Opt_mballoc,
        Opt_stripe, Opt_delalloc, Opt_nodelalloc,
        Opt_inode_readahead_blks, Opt_bigendian_extents,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
-+      Opt_mballoc
- };
- static const match_table_t tokens = {
-@@ -1356,6 +1358,7 @@
+@@ -1346,6 +1348,7 @@
+       {Opt_i_version, "i_version"},
+       {Opt_stripe, "stripe=%u"},
+       {Opt_resize, "resize"},
++      {Opt_mballoc, "mballoc"},
+       {Opt_delalloc, "delalloc"},
        {Opt_nodelalloc, "nodelalloc"},
        {Opt_inode_readahead_blks, "inode_readahead_blks=%u"},
-       {Opt_bigendian_extents, "bigendian_extents"},
-+      {Opt_mballoc, "mballoc"},
-       {Opt_err, NULL},
- };
-@@ -1774,6 +1777,8 @@
+@@ -1768,6 +1771,8 @@
                case Opt_bigendian_extents:
                        bigendian_extents = 1;
                        break;
@@ -245,8 +244,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  {
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_jbd2.c       2009-06-02 18:39:19.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.c    2009-06-04 17:01:43.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_jbd2.c       2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.c    2009-07-07 14:47:22.000000000 +0530
 @@ -21,6 +21,7 @@
                ext4_journal_abort_handle(where, __func__, bh, handle, err);
        return err;
@@ -262,8 +261,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4_jbd2.c
 +EXPORT_SYMBOL(__ext4_journal_dirty_metadata);
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h    2009-06-04 17:01:43.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-06-04 17:02:07.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h    2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-07-07 14:47:22.000000000 +0530
 @@ -26,6 +26,9 @@
   * The fourth extended filesystem constants/structures
   */
@@ -283,7 +282,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
  
  #define EXT4_EPOCH_BITS 2
  #define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
-@@ -1115,6 +1120,8 @@
+@@ -1123,6 +1128,8 @@
  extern int ext4_mb_get_buddy_cache_lock(struct super_block *, ext4_group_t);
  extern void ext4_mb_put_buddy_cache_lock(struct super_block *,
                                                ext4_group_t, int);
@@ -294,8 +293,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
                struct buffer_head *bh, ext4_fsblk_t blocknr);
 Index: linux-2.6.27.21-0.1/fs/ext4/inode.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/inode.c   2009-06-04 17:01:43.000000000 +0530
-+++ linux-2.6.27.21-0.1/fs/ext4/inode.c        2009-06-04 17:01:43.000000000 +0530
+--- linux-2.6.27.21-0.1.orig/fs/ext4/inode.c   2009-07-07 14:47:19.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/inode.c        2009-07-07 14:47:22.000000000 +0530
 @@ -4240,6 +4240,7 @@
        iget_failed(inode);
        return ERR_PTR(ret);
index 827cbae..0223f7e 100644 (file)
@@ -1,7 +1,7 @@
 Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/super.c
-+++ linux-2.6.27.21-0.1/fs/ext4/super.c
+--- linux-2.6.27.21-0.1.orig/fs/ext4/super.c   2009-07-07 14:36:58.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/super.c        2009-07-07 14:38:06.000000000 +0530
 @@ -39,6 +39,8 @@
  #include <linux/log2.h>
  #include <linux/crc16.h>
@@ -11,7 +11,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  
  #include "ext4.h"
  #include "ext4_jbd2.h"
-@@ -598,6 +600,8 @@ static void ext4_put_super(struct super_
+@@ -599,6 +601,8 @@
                invalidate_bdev(sbi->journal_bdev);
                ext4_blkdev_remove(sbi);
        }
@@ -20,7 +20,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
        sb->s_fs_info = NULL;
        kfree(sbi);
        return;
-@@ -806,7 +810,6 @@ static int ext4_show_options(struct seq_
+@@ -807,7 +811,6 @@
        if (!test_opt(sb, DELALLOC))
                seq_puts(seq, ",nodelalloc");
  
@@ -28,7 +28,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
        if (sbi->s_stripe)
                seq_printf(seq, ",stripe=%lu", sbi->s_stripe);
        /*
-@@ -829,6 +832,330 @@ static int ext4_show_options(struct seq_
+@@ -830,6 +833,325 @@
  }
  
  
@@ -63,11 +63,9 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 +      if (*bh)
 +              clear_buffer_uptodate(*bh);
 +
-+#if 0
-+      brelse(*bh);
-+
-+      *bh = sb_bread(sb, mmp_block);
-+#else
++      /* This would be sb_bread(sb, mmp_block), except we need to be sure
++       * that the MD RAID device cache has been bypassed, and that the read
++       * is not blocked in the elevator. */
 +      if (!*bh)
 +              *bh = sb_getblk(sb, mmp_block);
 +      if (*bh) {
@@ -81,7 +79,6 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 +                      *bh = NULL;
 +              }
 +      }
-+#endif
 +      if (!*bh) {
 +              ext4_warning(sb, __FUNCTION__,
 +                           "Error while reading MMP block %lu", mmp_block);
@@ -142,10 +139,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
 +      mmp->mmp_check_interval = cpu_to_le16(mmp_check_interval);
 +      bdevname(bh->b_bdev, mmp->mmp_bdevname);
 +
-+      down_read(&uts_sem);
 +      memcpy(mmp->mmp_nodename, init_utsname()->sysname,
 +             sizeof(mmp->mmp_nodename));
-+      up_read(&uts_sem);
 +
 +      while (!kthread_should_stop()) {
 +              if (++seq > EXT4_MMP_SEQ_MAX)
@@ -359,7 +354,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  static struct inode *ext4_nfs_get_inode(struct super_block *sb,
                u64 ino, u32 generation)
  {
-@@ -2366,6 +2693,11 @@ static int ext4_fill_super(struct super_
+@@ -2370,6 +2692,11 @@
                          EXT4_HAS_INCOMPAT_FEATURE(sb,
                                    EXT4_FEATURE_INCOMPAT_RECOVER));
  
@@ -371,7 +366,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
        /*
         * The first inode we look at is the journal inode.  Don't try
         * root first: it may be modified in the journal!
-@@ -2566,6 +2898,8 @@ failed_mount3:
+@@ -2570,6 +2897,8 @@
        percpu_counter_destroy(&sbi->s_freeinodes_counter);
        percpu_counter_destroy(&sbi->s_dirs_counter);
        percpu_counter_destroy(&sbi->s_dirtyblocks_counter);
@@ -380,7 +375,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  failed_mount2:
        for (i = 0; i < db_count; i++)
                brelse(sbi->s_group_desc[i]);
-@@ -3080,7 +3414,7 @@ static int ext4_remount(struct super_blo
+@@ -3085,7 +3414,7 @@
        unsigned long old_sb_flags;
        struct ext4_mount_options old_opts;
        ext4_group_t g;
@@ -389,7 +384,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  #ifdef CONFIG_QUOTA
        int i;
  #endif
-@@ -3205,6 +3539,13 @@ static int ext4_remount(struct super_blo
+@@ -3210,6 +3539,13 @@
                                goto restore_opts;
                        if (!ext4_setup_super(sb, es, 0))
                                sb->s_flags &= ~MS_RDONLY;
@@ -405,9 +400,9 @@ Index: linux-2.6.27.21-0.1/fs/ext4/super.c
  #ifdef CONFIG_QUOTA
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4.h
-@@ -660,7 +660,7 @@ struct ext4_super_block {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h    2009-07-07 14:36:00.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-07-07 14:36:58.000000000 +0530
+@@ -660,7 +660,7 @@
        __le16  s_want_extra_isize;     /* New inodes should reserve # bytes */
        __le32  s_flags;                /* Miscellaneous flags */
        __le16  s_raid_stride;          /* RAID stride */
@@ -416,7 +411,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
        __le64  s_mmp_block;            /* Block for multi-mount protection */
        __le32  s_raid_stripe_width;    /* blocks on all data disks (N*stride)*/
        __u8    s_log_groups_per_flex;  /* FLEX_BG group size */
-@@ -777,7 +777,8 @@ static inline int ext4_valid_inum(struct
+@@ -777,7 +777,8 @@
                                         EXT4_FEATURE_INCOMPAT_META_BG| \
                                         EXT4_FEATURE_INCOMPAT_EXTENTS| \
                                         EXT4_FEATURE_INCOMPAT_64BIT| \
@@ -426,7 +421,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
  #define EXT4_FEATURE_RO_COMPAT_SUPP   (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
-@@ -981,6 +982,39 @@ do {                                                                      \
+@@ -981,6 +982,39 @@
  #endif
  
  /*
@@ -468,9 +463,9 @@ Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h
  
 Index: linux-2.6.27.21-0.1/fs/ext4/ext4_sb.h
 ===================================================================
---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_sb.h
-+++ linux-2.6.27.21-0.1/fs/ext4/ext4_sb.h
-@@ -150,6 +150,8 @@ struct ext4_sb_info {
+--- linux-2.6.27.21-0.1.orig/fs/ext4/ext4_sb.h 2009-07-07 14:36:00.000000000 +0530
++++ linux-2.6.27.21-0.1/fs/ext4/ext4_sb.h      2009-07-07 14:36:58.000000000 +0530
+@@ -149,6 +149,8 @@
  
        unsigned int s_log_groups_per_flex;
        struct flex_groups *s_flex_groups;
index 77097ec..edfa94e 100644 (file)
@@ -7,144 +7,123 @@ Index: linux-stage/fs/ext4/ialloc.c
   * group to find a free inode.
   */
 -struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
-+struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
-+                           unsigned long goal)
++struct inode *ext4_new_inode_goal(handle_t *handle, struct inode *dir,
++                                int mode, unsigned goal)
  {
        struct super_block *sb;
        struct buffer_head *inode_bitmap_bh = NULL;
-@@ -706,6 +707,51 @@ struct inode *ext4_new_inode(handle_t *h
+@@ -706,6 +707,14 @@ struct inode *ext4_new_inode(handle_t *h
        sbi = EXT4_SB(sb);
        es = sbi->s_es;
  
-+      if (goal) {
++      if (goal && goal <= le32_to_cpu(es->s_inodes_count)) {
 +              group = (goal - 1) / EXT4_INODES_PER_GROUP(sb);
 +              ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb);
-+              err = -EIO;
 +
-+              gdp = ext4_get_group_desc(sb, group, &group_desc_bh);
-+              if (!gdp)
-+                      goto fail;
-+
-+              inode_bitmap_bh = ext4_read_inode_bitmap(sb, group);
-+              if (!inode_bitmap_bh)
-+                      goto fail;
-+
-+              BUFFER_TRACE(bh, "get_write_access");
-+              err = ext4_journal_get_write_access(handle, inode_bitmap_bh);
-+              if (err)
-+                      goto fail;
-+
-+              BUFFER_TRACE(group_desc_bh, "get_write_access");
-+              err = ext4_journal_get_write_access(handle, group_desc_bh);
-+              if (err)
-+                      goto fail;
-+
-+              err = ext4_claim_inode(sb, inode_bitmap_bh, ino, group, mode);
-+              if (err) {
-+                      printk(KERN_ERR "goal inode %lu unavailable\n", goal);
-+                      /* Oh well, we tried. */
-+                      jbd2_journal_release_buffer(handle, inode_bitmap_bh);
-+                      jbd2_journal_release_buffer(handle, group_desc_bh);
-+                      goto continue_allocation;
-+              }
-+
-+              /* we won it */
-+              BUFFER_TRACE(inode_bitmap_bh,
-+                           "call ext4_journal_dirty_metadata");
-+              err = ext4_journal_dirty_metadata(handle, inode_bitmap_bh);
-+              if (err)
-+                      goto fail;
-+
-+              /* zero bit is inode number 1*/
-+              ino++;
-+              goto got;
++              ret2 = 0;
++              goto got_group;
 +      }
 +
-+continue_allocation:
        if (sbi->s_log_groups_per_flex) {
                ret2 = find_group_flex(sb, dir, &group);
                goto got_group;
+@@ -724,7 +733,7 @@ got_group:
+       if (ret2 == -1)
+               goto out;
+-      for (i = 0; i < sbi->s_groups_count; i++) {
++      for (i = 0; i < sbi->s_groups_count; i++, ino = 0) {
+               err = -EIO;
+               gdp = ext4_get_group_desc(sb, group, &group_desc_bh);
+@@ -736,8 +745,6 @@ got_group:
+               if (!inode_bitmap_bh)
+                       goto fail;
+-              ino = 0;
+-
+ repeat_in_this_group:
+               ino = ext4_find_next_zero_bit((unsigned long *)
+                                       inode_bitmap_bh->b_data,
 Index: linux-stage/fs/ext4/namei.c
 ===================================================================
 --- linux-stage.orig/fs/ext4/namei.c
 +++ linux-stage/fs/ext4/namei.c
-@@ -104,6 +104,7 @@ struct dx_entry
-       __le32 block;
- };
-+
- /*
-  * dx_root_info is laid out so that if it should somehow get overlaid by a
-  * dirent the two low bits of the hash version will be zero.  Therefore, the
-@@ -149,6 +150,14 @@ struct dx_map_entry
+@@ -149,6 +149,17 @@ struct dx_map_entry
        u16 size;
  };
  
++/*
++ * dentry_param used by ext4_new_inode_wantedi()
++ */
 +#define LVFS_DENTRY_PARAM_MAGIC               20070216UL
 +struct lvfs_dentry_params
 +{
-+      unsigned long   p_inum;
-+      void        *p_ptr;
-+      u32          magic;
++      unsigned long   ldp_inum;
++      unsigned long   ldp_flags;
++      u32             ldp_magic;
 +};
 +
  static inline ext4_lblk_t dx_get_block(struct dx_entry *entry);
  static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value);
  static inline unsigned dx_get_hash(struct dx_entry *entry);
-@@ -1716,6 +1725,20 @@ static int ext4_add_nondir(handle_t *han
+@@ -1716,6 +1727,19 @@ static int ext4_add_nondir(handle_t *han
        return err;
  }
  
-+static struct inode * ext4_new_inode_wantedi(handle_t *handle, struct inode *dir,
-+                                              int mode, struct dentry *dentry)
++static unsigned ext4_dentry_goal(struct super_block *sb, struct dentry *dentry)
 +{
-+      unsigned long inum = 0;
++      unsigned inum = EXT4_SB(sb)->s_inode_goal;
 +
 +      if (dentry->d_fsdata != NULL) {
 +              struct lvfs_dentry_params *param = dentry->d_fsdata;
 +
-+              if (param->magic == LVFS_DENTRY_PARAM_MAGIC)
-+                      inum = param->p_inum;
++              if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC)
++                      inum = param->ldp_inum;
 +      }
-+      return ext4_new_inode(handle, dir, mode, inum);
++      return inum;
 +}
 +
  /*
   * By the time this is called, we already have created
   * the directory cache entry for the new file, but it
-@@ -1741,7 +1764,7 @@ retry:
+@@ -1741,7 +1766,8 @@ retry:
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext4_new_inode (handle, dir, mode);
-+      inode = ext4_new_inode_wantedi(handle, dir, mode, dentry);
++      inode = ext4_new_inode_goal(handle, dir, mode,
++                                  ext4_dentry_goal(dir->i_sb, dentry));
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
                inode->i_op = &ext4_file_inode_operations;
-@@ -1775,7 +1798,7 @@ retry:
+@@ -1775,7 +1800,8 @@ retry:
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext4_new_inode(handle, dir, mode);
-+      inode = ext4_new_inode_wantedi(handle, dir, mode, dentry);
++      inode = ext4_new_inode_goal(handle, dir, mode,
++                                  ext4_dentry_goal(dir->i_sb, dentry));
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
                init_special_inode(inode, inode->i_mode, rdev);
-@@ -1811,7 +1834,7 @@ retry:
+@@ -1811,7 +1836,8 @@ retry:
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext4_new_inode(handle, dir, S_IFDIR | mode);
-+      inode = ext4_new_inode_wantedi(handle, dir, S_IFDIR | mode, dentry);
++      inode = ext4_new_inode_goal(handle, dir, S_IFDIR | mode,
++                                  ext4_dentry_goal(dir->i_sb, dentry));
        err = PTR_ERR(inode);
        if (IS_ERR(inode))
                goto out_stop;
-@@ -2211,7 +2234,7 @@ retry:
+@@ -2211,7 +2236,8 @@ retry:
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext4_new_inode(handle, dir, S_IFLNK|S_IRWXUGO);
-+      inode = ext4_new_inode_wantedi(handle, dir, S_IFLNK|S_IRWXUGO, dentry);
++      inode = ext4_new_inode_goal(handle, dir, S_IFLNK|S_IRWXUGO,
++                                  ext4_dentry_goal(dir->i_sb, dentry));
        err = PTR_ERR(inode);
        if (IS_ERR(inode))
                goto out_stop;
@@ -152,26 +131,68 @@ Index: linux-stage/fs/ext4/ext4.h
 ===================================================================
 --- linux-stage.orig/fs/ext4/ext4.h
 +++ linux-stage/fs/ext4/ext4.h
-@@ -1032,7 +1032,8 @@ extern int ext4fs_dirhash(const char *na
+@@ -1032,7 +1032,14 @@ extern int ext4fs_dirhash(const char *na
                          dx_hash_info *hinfo);
  
  /* ialloc.c */
 -extern struct inode * ext4_new_inode(handle_t *, struct inode *, int);
-+extern struct inode * ext4_new_inode(handle_t *, struct inode *, int,
-+                                   unsigned long);
++extern struct inode *ext4_new_inode_goal(handle_t *handle, struct inode *dir,
++                                       int mode, unsigned goal);
++static inline struct inode *ext4_new_inode(handle_t *handle, struct inode *dir,
++                                         int mode)
++{
++      return ext4_new_inode_goal(handle, dir, mode,
++                                 EXT4_SB(dir->i_sb)->s_inode_goal);
++}
  extern void ext4_free_inode(handle_t *, struct inode *);
  extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
  extern unsigned long ext4_count_free_inodes(struct super_block *);
-Index: linux-stage/fs/ext4/migrate.c
+Index: linux-stage/fs/ext4/super.c
 ===================================================================
---- linux-stage.orig/fs/ext4/migrate.c
-+++ linux-stage/fs/ext4/migrate.c
-@@ -484,7 +484,7 @@ int ext4_ext_migrate(struct inode *inode
+--- linux-stage.orig/fs/ext4/super.c
++++ linux-stage/fs/ext4/super.c
+@@ -560,6 +560,7 @@ static void ext4_put_super(struct super_
+       }
+       if (sbi->s_proc) {
+               remove_proc_entry("inode_readahead_blks", sbi->s_proc);
++              remove_proc_entry("inode_goal", sbi->s_proc);
+               remove_proc_entry(sb->s_id, ext4_proc_root);
        }
-       tmp_inode = ext4_new_inode(handle,
-                               inode->i_sb->s_root->d_inode,
--                              S_IFREG);
-+                              S_IFREG, 0);
-       if (IS_ERR(tmp_inode)) {
-               retval = -ENOMEM;
-               ext4_journal_stop(handle);
+@@ -2274,10 +2275,14 @@ static int ext4_fill_super(struct super_
+       if (ext4_proc_root)
+               sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);
+-      if (sbi->s_proc)
++      if (sbi->s_proc) {
+               proc_create_data("inode_readahead_blks", 0644, sbi->s_proc,
+                                &ext4_ui_proc_fops,
+                                &sbi->s_inode_readahead_blks);
++              proc_create_data("inode_goal", 0644, sbi->s_proc,
++                               &ext4_ui_proc_fops,
++                               &sbi->s_inode_goal);
++      }
+ #endif
+       bgl_lock_init(&sbi->s_blockgroup_lock);
+@@ -2553,6 +2558,7 @@ failed_mount2:
+ failed_mount:
+       if (sbi->s_proc) {
+               remove_proc_entry("inode_readahead_blks", sbi->s_proc);
++              remove_proc_entry("inode_goal", sbi->s_proc);
+               remove_proc_entry(sb->s_id, ext4_proc_root);
+       }
+ #ifdef CONFIG_QUOTA
+Index: linux-stage/fs/ext4/ext4_sb.h
+===================================================================
+--- linux-stage.orig/fs/ext4/ext4_sb.h
++++ linux-stage/fs/ext4/ext4_sb.h
+@@ -53,6 +53,7 @@ struct ext4_sb_info {
+       int s_inode_size;
+       int s_first_ino;
+       unsigned int s_inode_readahead_blks;
++      unsigned int s_inode_goal;
+       spinlock_t s_next_gen_lock;
+       u32 s_next_generation;
+       u32 s_hash_seed[4];
+
index 6d062da..5669b49 100644 (file)
@@ -17,7 +17,6 @@ ext4-mballoc-extra-checks-sles11.patch
 ext4-big-endian-check-2.6-sles11.patch
 ext4-misc-sles11.patch
 ext4-ext_generation-sles11.patch
-ext4-remove-ioctl-filp-sles11.patch
 ext4-super-warning.patch
 ext4-alloc-policy-2.6-sles11.patch
 ext4-disable-delalloc-sles11.patch