Whamcloud - gitweb
b=22769 improve error message for dx_probe
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-max-dir-size.patch
index ec7e06d..3d901eb 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.18-92.1.6/fs/ext3/ialloc.c
+Index: linux-stage/fs/ext3/ialloc.c
 ===================================================================
---- linux-2.6.18-92.1.6.orig/fs/ext3/ialloc.c
-+++ linux-2.6.18-92.1.6/fs/ext3/ialloc.c
-@@ -521,12 +521,15 @@ struct inode *ext3_new_inode(handle_t *h
+--- linux-stage.orig/fs/ext3/ialloc.c
++++ linux-stage/fs/ext3/ialloc.c
+@@ -521,12 +521,15 @@ struct inode *ext3_new_inode(handle_t
                return ERR_PTR(-EPERM);
  
        sb = dir->i_sb;
@@ -19,10 +19,10 @@ Index: linux-2.6.18-92.1.6/fs/ext3/ialloc.c
        es = sbi->s_es;
        if (goal) {
                group = (goal - 1) / EXT3_INODES_PER_GROUP(sb);
-Index: linux-2.6.18-92.1.6/fs/ext3/super.c
+Index: linux-stage/fs/ext3/super.c
 ===================================================================
---- linux-2.6.18-92.1.6.orig/fs/ext3/super.c
-+++ linux-2.6.18-92.1.6/fs/ext3/super.c
+--- linux-stage.orig/fs/ext3/super.c
++++ linux-stage/fs/ext3/super.c
 @@ -45,6 +45,12 @@
  #include "namei.h"
  #include "group.h"
@@ -36,15 +36,49 @@ Index: linux-2.6.18-92.1.6/fs/ext3/super.c
  static int ext3_load_journal(struct super_block *, struct ext3_super_block *,
                             unsigned long journal_devnum);
  static int ext3_create_journal(struct super_block *, struct ext3_super_block *,
-@@ -440,6 +446,7 @@ static void ext3_put_super (struct super
+@@ -444,6 +450,7 @@ static void ext3_put_super (struct su
+       }
        if (sbi->s_mmp_tsk)
                kthread_stop(sbi->s_mmp_tsk);
 +      remove_proc_entry(EXT3_MAX_DIR_SIZE_NAME, sbi->s_dev_proc);
-       remove_proc_entry(sb->s_id, proc_root_ext3);
-       sbi->s_dev_proc = NULL;
-       sb->s_fs_info = NULL;
-@@ -1853,6 +1860,45 @@ failed:
+       if (sbi->s_dev_proc) {
+               remove_proc_entry(sbi->s_dev_proc->name, proc_root_ext3);
+               sbi->s_dev_proc = NULL;
+@@ -703,7 +710,7 @@ enum {
+       Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
+       Opt_grpquota,
+       Opt_extents, Opt_noextents, Opt_extdebug,
+-      Opt_mballoc, Opt_nomballoc, Opt_stripe,
++      Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize
+ };
+ static match_table_t tokens = {
+@@ -762,8 +769,9 @@ static match_table_t tokens = {
+       {Opt_mballoc, "mballoc"},
+       {Opt_nomballoc, "nomballoc"},
+       {Opt_stripe, "stripe=%u"},
+-      {Opt_err, NULL},
+       {Opt_resize, "resize"},
++      {Opt_maxdirsize, "maxdirsize=%u"},
++      {Opt_err, NULL}
+ };
+ static ext3_fsblk_t get_sb_block(void **data)
+@@ -1128,6 +1136,13 @@ clear_qf_name:
+                               return 0;
+                       sbi->s_stripe = option;
+                       break;
++              case Opt_maxdirsize:
++                      if (match_int(&args[0], &option))
++                              return 0;
++                      if (option <= 0)
++                              return 0;
++                      sbi->s_max_dir_size = option;
++                      break;
+               default:
+                       printk (KERN_ERR
+                               "EXT3-fs: Unrecognized mount option \"%s\" "
+@@ -1875,6 +1890,45 @@ failed:
        return 1;
  }
  
@@ -90,7 +124,7 @@ Index: linux-2.6.18-92.1.6/fs/ext3/super.c
  
  static int ext3_fill_super (struct super_block *sb, void *data, int silent)
  {
-@@ -1873,6 +1919,7 @@ static int ext3_fill_super (struct super
+@@ -1896,6 +1950,7 @@ static int ext3_fill_super (struct su
        int i;
        int needs_recovery;
        __le32 features;
@@ -98,7 +132,7 @@ Index: linux-2.6.18-92.1.6/fs/ext3/super.c
  
        sbi = kmalloc(sizeof(*sbi), GFP_KERNEL);
        if (!sbi)
-@@ -1892,6 +1939,23 @@ static int ext3_fill_super (struct super
+@@ -1924,6 +1979,23 @@ static int ext3_fill_super (struct su
  
        unlock_kernel();
  
@@ -106,7 +140,7 @@ Index: linux-2.6.18-92.1.6/fs/ext3/super.c
 +      proc = create_proc_entry(EXT3_MAX_DIR_SIZE_NAME,
 +                               S_IFREG | S_IRUGO | S_IWUSR, sbi->s_dev_proc);
 +      if (proc == NULL) {
-+              printk(KERN_ERR "EXT3-fs: unable to create %s\n", 
++              printk(KERN_ERR "EXT3-fs: unable to create %s\n",
 +                     EXT3_MAX_DIR_SIZE_NAME);
 +              remove_proc_entry(EXT3_MAX_DIR_SIZE_NAME, sbi->s_dev_proc);
 +              remove_proc_entry(sb->s_id, proc_root_ext3);
@@ -122,18 +156,18 @@ Index: linux-2.6.18-92.1.6/fs/ext3/super.c
        blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE);
        if (!blocksize) {
                printk(KERN_ERR "EXT3-fs: unable to set blocksize\n");
-@@ -2327,6 +2391,7 @@ failed_mount:
+@@ -2361,6 +2433,7 @@ failed_mount:
        ext3_blkdev_remove(sbi);
        brelse(bh);
  out_fail:
 +      remove_proc_entry(EXT3_MAX_DIR_SIZE_NAME, sbi->s_dev_proc);
-       remove_proc_entry(sb->s_id, proc_root_ext3);
-       sbi->s_dev_proc = NULL;
-       sb->s_fs_info = NULL;
-Index: linux-2.6.18-92.1.6/include/linux/ext3_fs_sb.h
+       if (sbi->s_dev_proc) {
+               remove_proc_entry(sbi->s_dev_proc->name, proc_root_ext3);
+               sbi->s_dev_proc = NULL;
+Index: linux-stage/include/linux/ext3_fs_sb.h
 ===================================================================
---- linux-2.6.18-92.1.6.orig/include/linux/ext3_fs_sb.h
-+++ linux-2.6.18-92.1.6/include/linux/ext3_fs_sb.h
+--- linux-stage.orig/include/linux/ext3_fs_sb.h
++++ linux-stage/include/linux/ext3_fs_sb.h
 @@ -132,6 +132,8 @@ struct ext3_sb_info {
        unsigned long s_mb_last_group;
        unsigned long s_mb_last_start;