Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-mballoc2-2.6.9-rhel4.patch
index 2a4e19b..77b7a36 100644 (file)
@@ -40,12 +40,13 @@ Index: linux-2.6.9-full/include/linux/ext3_fs.h
  /*
   * Maximal mount counts between two filesystem checks
   */
-@@ -726,7 +743,7 @@ extern int ext3_bg_has_super(struct supe
+@@ -726,7 +743,8 @@ extern int ext3_bg_has_super(struct supe
  extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
  extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
  extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
 -                            unsigned long);
 +                            unsigned long, int);
++extern int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
  extern void ext3_free_blocks_sb (handle_t *, struct super_block *,
                                 unsigned long, unsigned long, int *);
  extern unsigned long ext3_count_free_blocks (struct super_block *);
@@ -379,7 +380,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 ===================================================================
 --- linux-2.6.9-full.orig/fs/ext3/mballoc.c    2006-10-23 18:07:54.821533176 +0400
 +++ linux-2.6.9-full/fs/ext3/mballoc.c 2006-10-24 13:00:56.000000000 +0400
-@@ -0,0 +1,2729 @@
+@@ -0,0 +1,2726 @@
 +/*
 + * Copyright (c) 2003-2005, Cluster File Systems, Inc, info@clusterfs.com
 + * Written by Alex Tomas <alex@clusterfs.com>
@@ -575,11 +576,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +
 +static struct proc_dir_entry *proc_root_ext3;
 +
-+int ext3_create (struct inode *, struct dentry *, int, struct nameidata *);
 +struct buffer_head * read_block_bitmap(struct super_block *, unsigned int);
-+int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
-+int ext3_mb_reserve_blocks(struct super_block *, int);
-+void ext3_mb_release_blocks(struct super_block *, int);
 +void ext3_mb_poll_new_transaction(struct super_block *, handle_t *);
 +void ext3_mb_free_committed_blocks(struct super_block *);
 +
@@ -1356,8 +1353,8 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +      struct ext3_free_extent *gex = &ac->ac_g_ex;
 +
 +      J_ASSERT(ex->fe_len > 0);
-+      J_ASSERT(ex->fe_len < (1 << ac->ac_sb->s_blocksize_bits) * 8);
-+      J_ASSERT(ex->fe_start < (1 << ac->ac_sb->s_blocksize_bits) * 8);
++      J_ASSERT(ex->fe_len < EXT3_BLOCKS_PER_GROUP(ac->ac_sb));
++      J_ASSERT(ex->fe_start < EXT3_BLOCKS_PER_GROUP(ac->ac_sb));
 +
 +      ac->ac_found++;
 +
@@ -1551,8 +1548,8 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +      i = e3b->bd_info->bb_first_free;
 +
 +      while (free && ac->ac_status == AC_STATUS_CONTINUE) {
-+              i = mb_find_next_zero_bit(bitmap, sb->s_blocksize * 8, i);
-+              if (i >= sb->s_blocksize * 8) {
++              i = mb_find_next_zero_bit(bitmap, EXT3_BLOCKS_PER_GROUP(sb), i);
++              if (i >= EXT3_BLOCKS_PER_GROUP(sb)) {
 +                      J_ASSERT(free == 0);
 +                      break;
 +              }
@@ -1590,7 +1587,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +      i = (i - le32_to_cpu(sbi->s_es->s_first_data_block)) %
 +              EXT3_BLOCKS_PER_GROUP(sb);
 +
-+      while (i < sb->s_blocksize * 8) {
++      while (i < EXT3_BLOCKS_PER_GROUP(sb)) {
 +              if (!mb_test_bit(i, bitmap)) {
 +                      max = mb_find_extent(e3b, 0, i, sbi->s_stripe, &ex);
 +                      if (max >= sbi->s_stripe) {
@@ -2089,7 +2086,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +              return -EIO;
 +      size = sizeof(struct ext3_mb_history) * sbi->s_mb_history_max;
 +      s->history = kmalloc(size, GFP_KERNEL);
-+      if (s == NULL) {
++      if (s->history == NULL) {
 +              kfree(s);
 +              return -EIO;
 +      }
@@ -2264,7 +2261,8 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +      spin_lock_init(&sbi->s_mb_history_lock);
 +      i = sbi->s_mb_history_max * sizeof(struct ext3_mb_history);
 +      sbi->s_mb_history = kmalloc(i, GFP_KERNEL);
-+      memset(sbi->s_mb_history, 0, i);
++       if (likely(sbi->s_mb_history != NULL))
++               memset(sbi->s_mb_history, 0, i);
 +      /* if we can't allocate history, then we simple won't use it */
 +}
 +
@@ -2275,7 +2273,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
 +      struct ext3_sb_info *sbi = EXT3_SB(sb);
 +      struct ext3_mb_history h;
 +
-+      if (likely(sbi->s_mb_history == NULL))
++      if (unlikely(sbi->s_mb_history == NULL))
 +              return;
 +
 +      h.pid = current->pid;