From: kalpak Date: Sat, 6 Sep 2008 11:37:46 +0000 (+0000) Subject: b=16498 X-Git-Tag: v1_9_61~26 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d0a384c64727baad7c2c60433feebeb208699666;ds=sidebyside b=16498 i=adilger i=girish get RAID stripe size from the superblock --- diff --git a/ldiskfs/ChangeLog b/ldiskfs/ChangeLog index 92dbcc5..5c136f8 100644 --- a/ldiskfs/ChangeLog +++ b/ldiskfs/ChangeLog @@ -34,6 +34,13 @@ Details : FIEMAP ioctl will allow an application to efficiently fetch the extent information of a file. It can be used to map logical blocks in a file to physical blocks in the block device. +Severity : normal +Bugzilla : 16498 +Description: Get RAID stripe size from superblock +Details : RAID striping parameters are now saved in the superblock itself, + so we should use these parameters instead of having to specify + a mount option each time. + ------------------------------------------------------------------------------- 04-26-2008 Sun Microsystems, Inc. diff --git a/ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb-2.6-suse.patch b/ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb-2.6-suse.patch new file mode 100644 index 0000000..566722b --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb-2.6-suse.patch @@ -0,0 +1,67 @@ +Index: linux-2.6.5-7.312/fs/ext3/super.c +=================================================================== +--- linux-2.6.5-7.312.orig/fs/ext3/super.c ++++ linux-2.6.5-7.312/fs/ext3/super.c +@@ -1298,6 +1298,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; +@@ -1618,6 +1646,8 @@ static int ext3_fill_super (struct super + atomic_set(&sbi->s_rsv_window_head.rsv_goal_size, 0); + 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 + */ +Index: linux-2.6.5-7.312/include/linux/ext3_fs.h +=================================================================== +--- linux-2.6.5-7.312.orig/include/linux/ext3_fs.h ++++ linux-2.6.5-7.312/include/linux/ext3_fs.h +@@ -505,8 +505,12 @@ struct ext3_super_block { + __u32 s_free_blocks_hi; /* Free blocks count high 32 bits */ + __u16 s_min_extra_isize; /* All inodes have at least # bytes */ + __u16 s_want_extra_isize; /* New inodes should reserve # bytes */ +- __u32 s_flags; /* Miscellaneous flags */ +- __u32 s_reserved[167]; /* Padding to the end of the block */ ++/*160*/ __le32 s_flags; /* Miscellaneous flags */ ++ __le16 s_raid_stride; /* RAID stride */ ++ __le16 s_mmp_update_interval; /* # seconds to wait in MMP checking */ ++ __le64 s_mmp_block; /* Block for multi-mount protection */ ++/*170*/ __le32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ ++ __le32 s_reserved[163]; /* Padding to the end of the block */ + }; + + #ifdef __KERNEL__ 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 index 0000000..07f251d --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-get-raid-stripe-from-sb.patch @@ -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 + */ + diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series index 6b98dbf..6554da5 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series @@ -27,3 +27,4 @@ ext3-print-inum-in-htree-warning.patch ext3-xattr-no-update-ctime-rhel4.patch ext3-check-bad-inode.patch ext3-fiemap-2.6-rhel4.patch +ext3-get-raid-stripe-from-sb.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series index f62ce8d..534a7e8 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series @@ -24,3 +24,4 @@ ext3-print-inum-in-htree-warning.patch ext3-block-bitmap-validation-2.6-rhel5.patch ext3-xattr-no-update-ctime-2.6.22-vanilla.patch ext3-journal-chksum-2.6.18-vanilla.patch +ext3-get-raid-stripe-from-sb.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series index dd26554..96d3c32 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series @@ -29,3 +29,4 @@ ext3-block-bitmap-validation-2.6-sles10.patch ext3-xattr-no-update-ctime-2.6-sles10.patch ext3-check-bad-inode.patch ext3-journal-chksum-2.6.18-vanilla.patch +ext3-get-raid-stripe-from-sb.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series index b6d7bb0..86d27c4 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series @@ -26,3 +26,4 @@ ext3-max-dir-size-2.6.5-suse.patch ext3-print-inum-in-htree-warning.patch ext3-xattr-no-update-ctime-suse.patch ext3-check-bad-inode.patch +ext3-get-raid-stripe-from-sb-2.6-suse.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series index 65a6d4f..a95833e 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series @@ -24,3 +24,4 @@ ext3-max-dir-size.patch ext3-print-inum-in-htree-warning.patch ext3-xattr-no-update-ctime-2.6.22-vanilla.patch ext3-check-bad-inode.patch +ext3-get-raid-stripe-from-sb.patch