diff options
author | Dan Ehrenberg <dehrenberg@google.com> | 2011-07-17 21:18:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-07-17 21:18:51 -0400 |
commit | 3eb08658431abd65c0fe6855d1860859c2d416f7 (patch) | |
tree | 5f7d21be65bcec29ac50918cadedd08a62cdf318 /fs | |
parent | d7a1fee135771e6e5185642bdc17df19bbdbcc48 (diff) |
ext4: ignore a stripe width of 1
If the stripe width was set to 1, then this patch will ignore
that stripe width and ext4 will act as if the stripe width
were 0 with respect to optimizing allocations.
Signed-off-by: Dan Ehrenberg <dehrenberg@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/super.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7910e61809e7..143d763729b4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2384,17 +2384,25 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi) | |||
2384 | unsigned long stride = le16_to_cpu(sbi->s_es->s_raid_stride); | 2384 | unsigned long stride = le16_to_cpu(sbi->s_es->s_raid_stride); |
2385 | unsigned long stripe_width = | 2385 | unsigned long stripe_width = |
2386 | le32_to_cpu(sbi->s_es->s_raid_stripe_width); | 2386 | le32_to_cpu(sbi->s_es->s_raid_stripe_width); |
2387 | int ret; | ||
2387 | 2388 | ||
2388 | if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group) | 2389 | if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group) |
2389 | return sbi->s_stripe; | 2390 | ret = sbi->s_stripe; |
2390 | 2391 | else if (stripe_width <= sbi->s_blocks_per_group) | |
2391 | if (stripe_width <= sbi->s_blocks_per_group) | 2392 | ret = stripe_width; |
2392 | return stripe_width; | 2393 | else if (stride <= sbi->s_blocks_per_group) |
2394 | ret = stride; | ||
2395 | else | ||
2396 | ret = 0; | ||
2393 | 2397 | ||
2394 | if (stride <= sbi->s_blocks_per_group) | 2398 | /* |
2395 | return stride; | 2399 | * If the stripe width is 1, this makes no sense and |
2400 | * we set it to 0 to turn off stripe handling code. | ||
2401 | */ | ||
2402 | if (ret <= 1) | ||
2403 | ret = 0; | ||
2396 | 2404 | ||
2397 | return 0; | 2405 | return ret; |
2398 | } | 2406 | } |
2399 | 2407 | ||
2400 | /* sysfs supprt */ | 2408 | /* sysfs supprt */ |