diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2009-09-09 23:50:17 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-09 23:50:17 -0400 |
commit | 08c3a8133810d955d97f7146c50c43e4073f2148 (patch) | |
tree | 7caab5e454cdfc39817bd34b9a5be21743af5771 /fs/ext4/mballoc.c | |
parent | f41c0750538667b87a19c93952e5d42fcc069bd7 (diff) |
ext4: Clarify the locking details in mballoc
We don't need to take the alloc_sem lock when we are adding new
groups, since mballoc won't see the new group added until we bump
sbi->s_groups_count.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 484c9d10c7fa..d23056d375b3 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -928,8 +928,11 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) | |||
928 | blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; | 928 | blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; |
929 | this_grp = ext4_get_group_info(sb, group); | 929 | this_grp = ext4_get_group_info(sb, group); |
930 | /* | 930 | /* |
931 | * This ensures we don't add group | 931 | * This ensures that we don't reinit the buddy cache |
932 | * to this buddy cache via resize | 932 | * page which map to the group from which we are already |
933 | * allocating. If we are looking at the buddy cache we would | ||
934 | * have taken a reference using ext4_mb_load_buddy and that | ||
935 | * would have taken the alloc_sem lock. | ||
933 | */ | 936 | */ |
934 | num_grp_locked = ext4_mb_get_buddy_cache_lock(sb, group); | 937 | num_grp_locked = ext4_mb_get_buddy_cache_lock(sb, group); |
935 | if (!EXT4_MB_GRP_NEED_INIT(this_grp)) { | 938 | if (!EXT4_MB_GRP_NEED_INIT(this_grp)) { |