Whamcloud - gitweb
b=16498
authorkalpak <kalpak>
Sat, 6 Sep 2008 11:38:09 +0000 (11:38 +0000)
committerkalpak <kalpak>
Sat, 6 Sep 2008 11:38:09 +0000 (11:38 +0000)
i=adilger
i=girish

get RAID stripe size from the superblock

ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb.patch [new file with mode: 0644]

diff --git a/ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb.patch b/ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb.patch
new file mode 100644 (file)
index 0000000..07f251d
--- /dev/null
@@ -0,0 +1,49 @@
+Index: linux-2.6.18-53.1.14/fs/ext3/super.c
+===================================================================
+--- linux-2.6.18-53.1.14.orig/fs/ext3/super.c
++++ linux-2.6.18-53.1.14/fs/ext3/super.c
+@@ -1900,6 +1900,34 @@ static int ext3_max_dir_size_write(struc
+       return count;
+ }
++/*
++ * ext3_get_stripe_size: Get the stripe size.
++ * @sbi: In memory super block info
++ *
++ * If we have specified it via mount option, then
++ * use the mount option value. If the value specified at mount time is
++ * greater than the blocks per group use the super block value.
++ * If the super block value is greater than blocks per group return 0.
++ * Allocator needs it be less than blocks per group.
++ */
++static unsigned long ext3_get_stripe_size(struct ext3_sb_info *sbi)
++{
++      unsigned long stride = le16_to_cpu(sbi->s_es->s_raid_stride);
++      unsigned long stripe_width =
++                      le32_to_cpu(sbi->s_es->s_raid_stripe_width);
++
++      if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group)
++              return sbi->s_stripe;
++
++      if (stripe_width <= sbi->s_blocks_per_group)
++              return stripe_width;
++
++      if (stride <= sbi->s_blocks_per_group)
++              return stride;
++
++      return 0;
++}
++
+ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
+ {
+       struct buffer_head * bh;
+@@ -2221,6 +2249,8 @@ static int ext3_fill_super (struct super
+       sbi->s_rsv_window_head.rsv_goal_size = 0;
+       ext3_rsv_window_add(sb, &sbi->s_rsv_window_head);
++        sbi->s_stripe = ext3_get_stripe_size(sbi);
++
+       /*
+        * set up enough so that it can read an inode
+        */
+