resize.c (404c3bc30cb1361e1b3533643326ab472d24a618) | resize.c (952fc18ef9ec707ebdc16c0786ec360295e5ff15) |
---|---|
1/* 2 * linux/fs/ext4/resize.c 3 * 4 * Support for resizing an ext4 filesystem while it is mounted. 5 * 6 * Copyright (C) 2001, 2002 Andreas Dilger <adilger@clusterfs.com> 7 * 8 * This could probably be made into a module, because it is not often in use. --- 1183 unchanged lines hidden (view full) --- 1192 struct ext4_new_flex_group_data *flex_gd) 1193{ 1194 ext4_fsblk_t blocks_count = 0; 1195 ext4_fsblk_t free_blocks = 0; 1196 ext4_fsblk_t reserved_blocks = 0; 1197 struct ext4_new_group_data *group_data = flex_gd->groups; 1198 struct ext4_sb_info *sbi = EXT4_SB(sb); 1199 struct ext4_super_block *es = sbi->s_es; | 1/* 2 * linux/fs/ext4/resize.c 3 * 4 * Support for resizing an ext4 filesystem while it is mounted. 5 * 6 * Copyright (C) 2001, 2002 Andreas Dilger <adilger@clusterfs.com> 7 * 8 * This could probably be made into a module, because it is not often in use. --- 1183 unchanged lines hidden (view full) --- 1192 struct ext4_new_flex_group_data *flex_gd) 1193{ 1194 ext4_fsblk_t blocks_count = 0; 1195 ext4_fsblk_t free_blocks = 0; 1196 ext4_fsblk_t reserved_blocks = 0; 1197 struct ext4_new_group_data *group_data = flex_gd->groups; 1198 struct ext4_sb_info *sbi = EXT4_SB(sb); 1199 struct ext4_super_block *es = sbi->s_es; |
1200 int i; | 1200 int i, ret; |
1201 1202 BUG_ON(flex_gd->count == 0 || group_data == NULL); 1203 /* 1204 * Make the new blocks and inodes valid next. We do this before 1205 * increasing the group count so that once the group is enabled, 1206 * all of its blocks and inodes are already valid. 1207 * 1208 * We always allocate group-by-group, then block-by-block or --- 58 unchanged lines hidden (view full) --- 1267 ext4_group_t flex_group; 1268 flex_group = ext4_flex_group(sbi, group_data[0].group); 1269 atomic_add(EXT4_B2C(sbi, free_blocks), 1270 &sbi->s_flex_groups[flex_group].free_clusters); 1271 atomic_add(EXT4_INODES_PER_GROUP(sb) * flex_gd->count, 1272 &sbi->s_flex_groups[flex_group].free_inodes); 1273 } 1274 | 1201 1202 BUG_ON(flex_gd->count == 0 || group_data == NULL); 1203 /* 1204 * Make the new blocks and inodes valid next. We do this before 1205 * increasing the group count so that once the group is enabled, 1206 * all of its blocks and inodes are already valid. 1207 * 1208 * We always allocate group-by-group, then block-by-block or --- 58 unchanged lines hidden (view full) --- 1267 ext4_group_t flex_group; 1268 flex_group = ext4_flex_group(sbi, group_data[0].group); 1269 atomic_add(EXT4_B2C(sbi, free_blocks), 1270 &sbi->s_flex_groups[flex_group].free_clusters); 1271 atomic_add(EXT4_INODES_PER_GROUP(sb) * flex_gd->count, 1272 &sbi->s_flex_groups[flex_group].free_inodes); 1273 } 1274 |
1275 /* 1276 * Update the fs overhead information 1277 */ 1278 ext4_calculate_overhead(sb); 1279 |
|
1275 if (test_opt(sb, DEBUG)) 1276 printk(KERN_DEBUG "EXT4-fs: added group %u:" 1277 "%llu blocks(%llu free %llu reserved)\n", flex_gd->count, 1278 blocks_count, free_blocks, reserved_blocks); 1279} 1280 1281/* Add a flex group to an fs. Ensure we handle all possible error conditions 1282 * _before_ we start modifying the filesystem, because we cannot abort the --- 460 unchanged lines hidden --- | 1280 if (test_opt(sb, DEBUG)) 1281 printk(KERN_DEBUG "EXT4-fs: added group %u:" 1282 "%llu blocks(%llu free %llu reserved)\n", flex_gd->count, 1283 blocks_count, free_blocks, reserved_blocks); 1284} 1285 1286/* Add a flex group to an fs. Ensure we handle all possible error conditions 1287 * _before_ we start modifying the filesystem, because we cannot abort the --- 460 unchanged lines hidden --- |