aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.h
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2009-01-05 21:36:19 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-01-05 21:36:19 -0500
commit920313a726e04fef0f2c0bcb04ad8229c0e700d8 (patch)
tree7e7644a2fd48586ec2f455e56525565174798e4a /fs/ext4/mballoc.h
parente21675d4b63975d09eb75c443c48ebe663d23e18 (diff)
ext4: Use EXT4_GROUP_INFO_NEED_INIT_BIT during resize
The new groups added during resize are flagged as need_init group. Make sure we properly initialize these groups. When we have block size < page size and we are adding new groups the page may still be marked uptodate even though we haven't initialized the group. While forcing the init of buddy cache we need to make sure other groups part of the same page of buddy cache is not using the cache. group_info->alloc_sem is added to ensure the same. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> cc: stable@kernel.org
Diffstat (limited to 'fs/ext4/mballoc.h')
-rw-r--r--fs/ext4/mballoc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h
index b5dff1fff1e..a931b6b4f6a 100644
--- a/fs/ext4/mballoc.h
+++ b/fs/ext4/mballoc.h
@@ -20,6 +20,7 @@
20#include <linux/version.h> 20#include <linux/version.h>
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <linux/marker.h> 22#include <linux/marker.h>
23#include <linux/mutex.h>
23#include "ext4_jbd2.h" 24#include "ext4_jbd2.h"
24#include "ext4.h" 25#include "ext4.h"
25#include "group.h" 26#include "group.h"
@@ -130,6 +131,7 @@ struct ext4_group_info {
130#ifdef DOUBLE_CHECK 131#ifdef DOUBLE_CHECK
131 void *bb_bitmap; 132 void *bb_bitmap;
132#endif 133#endif
134 struct rw_semaphore alloc_sem;
133 unsigned short bb_counters[]; 135 unsigned short bb_counters[];
134}; 136};
135 137
@@ -250,6 +252,7 @@ struct ext4_buddy {
250 struct super_block *bd_sb; 252 struct super_block *bd_sb;
251 __u16 bd_blkbits; 253 __u16 bd_blkbits;
252 ext4_group_t bd_group; 254 ext4_group_t bd_group;
255 struct rw_semaphore *alloc_semp;
253}; 256};
254#define EXT4_MB_BITMAP(e4b) ((e4b)->bd_bitmap) 257#define EXT4_MB_BITMAP(e4b) ((e4b)->bd_bitmap)
255#define EXT4_MB_BUDDY(e4b) ((e4b)->bd_buddy) 258#define EXT4_MB_BUDDY(e4b) ((e4b)->bd_buddy)