aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index d0f15ef56de1..02ec44bf38e6 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1228,6 +1228,18 @@ struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
1228 return grp_info[indexv][indexh]; 1228 return grp_info[indexv][indexh];
1229} 1229}
1230 1230
1231/*
1232 * Reading s_groups_count requires using smp_rmb() afterwards. See
1233 * the locking protocol documented in the comments of ext4_group_add()
1234 * in resize.c
1235 */
1236static inline ext4_group_t ext4_get_groups_count(struct super_block *sb)
1237{
1238 ext4_group_t ngroups = EXT4_SB(sb)->s_groups_count;
1239
1240 smp_rmb();
1241 return ngroups;
1242}
1231 1243
1232static inline ext4_group_t ext4_flex_group(struct ext4_sb_info *sbi, 1244static inline ext4_group_t ext4_flex_group(struct ext4_sb_info *sbi,
1233 ext4_group_t block_group) 1245 ext4_group_t block_group)