resize.c (577f99c1d08cf9cbdafd4e858dd13ff04d855090) | resize.c (e8546d0615542684ca02ba03edebec1a503beb6b) |
---|---|
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. --- 488 unchanged lines hidden (view full) --- 497 o_group_desc = EXT4_SB(sb)->s_group_desc; 498 memcpy(n_group_desc, o_group_desc, 499 EXT4_SB(sb)->s_gdb_count * sizeof(struct buffer_head *)); 500 n_group_desc[gdb_num] = *primary; 501 EXT4_SB(sb)->s_group_desc = n_group_desc; 502 EXT4_SB(sb)->s_gdb_count++; 503 kfree(o_group_desc); 504 | 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. --- 488 unchanged lines hidden (view full) --- 497 o_group_desc = EXT4_SB(sb)->s_group_desc; 498 memcpy(n_group_desc, o_group_desc, 499 EXT4_SB(sb)->s_gdb_count * sizeof(struct buffer_head *)); 500 n_group_desc[gdb_num] = *primary; 501 EXT4_SB(sb)->s_group_desc = n_group_desc; 502 EXT4_SB(sb)->s_gdb_count++; 503 kfree(o_group_desc); 504 |
505 es->s_reserved_gdt_blocks = 506 cpu_to_le16(le16_to_cpu(es->s_reserved_gdt_blocks) - 1); | 505 le16_add_cpu(&es->s_reserved_gdt_blocks, -1); |
507 ext4_journal_dirty_metadata(handle, EXT4_SB(sb)->s_sbh); 508 509 return 0; 510 511exit_inode: 512 //ext4_journal_release_buffer(handle, iloc.bh); 513 brelse(iloc.bh); 514exit_dindj: --- 357 unchanged lines hidden (view full) --- 872 * 873 * We always allocate group-by-group, then block-by-block or 874 * inode-by-inode within a group, so enabling these 875 * blocks/inodes before the group is live won't actually let us 876 * allocate the new space yet. 877 */ 878 ext4_blocks_count_set(es, ext4_blocks_count(es) + 879 input->blocks_count); | 506 ext4_journal_dirty_metadata(handle, EXT4_SB(sb)->s_sbh); 507 508 return 0; 509 510exit_inode: 511 //ext4_journal_release_buffer(handle, iloc.bh); 512 brelse(iloc.bh); 513exit_dindj: --- 357 unchanged lines hidden (view full) --- 871 * 872 * We always allocate group-by-group, then block-by-block or 873 * inode-by-inode within a group, so enabling these 874 * blocks/inodes before the group is live won't actually let us 875 * allocate the new space yet. 876 */ 877 ext4_blocks_count_set(es, ext4_blocks_count(es) + 878 input->blocks_count); |
880 es->s_inodes_count = cpu_to_le32(le32_to_cpu(es->s_inodes_count) + 881 EXT4_INODES_PER_GROUP(sb)); | 879 le32_add_cpu(&es->s_inodes_count, EXT4_INODES_PER_GROUP(sb)); |
882 883 /* 884 * We need to protect s_groups_count against other CPUs seeing 885 * inconsistent state in the superblock. 886 * 887 * The precise rules we use are: 888 * 889 * * Writers of s_groups_count *must* hold lock_super --- 182 unchanged lines hidden --- | 880 881 /* 882 * We need to protect s_groups_count against other CPUs seeing 883 * inconsistent state in the superblock. 884 * 885 * The precise rules we use are: 886 * 887 * * Writers of s_groups_count *must* hold lock_super --- 182 unchanged lines hidden --- |