diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-03-04 19:09:10 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-03-04 19:09:10 -0500 |
commit | 9f24e4208f7ee2748f157368b63287dc903fcf60 (patch) | |
tree | 255989fe69ebfb2b031dc7cf6dbe975df67c711a /fs/ext4/resize.c | |
parent | b713a5ec55bf73c833f9883cdd761b20ee61a1ab (diff) |
ext4: Use atomic_t's in struct flex_groups
Reduce pressure on the sb_bgl_lock family of locks by using atomic_t's
to track the number of free blocks and inodes in each flex_group.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r-- | fs/ext4/resize.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index c06886abd658..546c7dd869e1 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -938,10 +938,10 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input) | |||
938 | if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) { | 938 | if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) { |
939 | ext4_group_t flex_group; | 939 | ext4_group_t flex_group; |
940 | flex_group = ext4_flex_group(sbi, input->group); | 940 | flex_group = ext4_flex_group(sbi, input->group); |
941 | sbi->s_flex_groups[flex_group].free_blocks += | 941 | atomic_add(input->free_blocks_count, |
942 | input->free_blocks_count; | 942 | &sbi->s_flex_groups[flex_group].free_blocks); |
943 | sbi->s_flex_groups[flex_group].free_inodes += | 943 | atomic_add(EXT4_INODES_PER_GROUP(sb), |
944 | EXT4_INODES_PER_GROUP(sb); | 944 | &sbi->s_flex_groups[flex_group].free_inodes); |
945 | } | 945 | } |
946 | 946 | ||
947 | ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh); | 947 | ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh); |