Changeset 81092ce in mainline
- Timestamp:
- 2012-04-04T18:03:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 662bd71
- Parents:
- d3ee35b
- Location:
- uspace/lib/ext4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_block_group.c
rd3ee35b r81092ce 200 200 } 201 201 202 // Flags operations 203 bool ext4_block_group_has_flag(ext4_block_group_t *bg, uint32_t flag) 204 { 205 if (ext4_block_group_get_flags(bg) & flag) { 206 return true; 207 } 208 return false; 209 } 210 202 211 /** 203 212 * @} -
uspace/lib/ext4/libext4_block_group.h
rd3ee35b r81092ce 73 73 extern void ext4_block_group_set_checksum(ext4_block_group_t *, uint16_t); 74 74 75 extern bool ext4_block_group_has_flag(ext4_block_group_t *, uint32_t); 75 76 #endif 76 77 -
uspace/lib/ext4/libext4_ialloc.c
rd3ee35b r81092ce 112 112 sb, free_inodes); 113 113 114 uint32_t unused_inodes = ext4_block_group_get_itable_unused( 115 bg_ref->block_group, sb); 116 unused_inodes++; 117 ext4_block_group_set_itable_unused(bg_ref->block_group, sb, unused_inodes); 118 114 if (ext4_block_group_has_flag(bg_ref->block_group, EXT4_BLOCK_GROUP_INODE_UNINIT)) { 115 uint32_t unused_inodes = ext4_block_group_get_itable_unused( 116 bg_ref->block_group, sb); 117 unused_inodes++; 118 ext4_block_group_set_itable_unused(bg_ref->block_group, sb, unused_inodes); 119 } 119 120 120 121 bg_ref->dirty = true; … … 193 194 ext4_block_group_set_free_inodes_count(bg, sb, free_inodes); 194 195 195 uint16_t unused_inodes = ext4_block_group_get_itable_unused(bg, sb); 196 unused_inodes--; 197 ext4_block_group_set_itable_unused(bg, sb, unused_inodes); 196 if (ext4_block_group_has_flag(bg, EXT4_BLOCK_GROUP_INODE_UNINIT)) { 197 uint16_t unused_inodes = ext4_block_group_get_itable_unused(bg, sb); 198 unused_inodes--; 199 ext4_block_group_set_itable_unused(bg, sb, unused_inodes); 200 } 198 201 199 202 if (is_dir) { -
uspace/lib/ext4/libext4_types.h
rd3ee35b r81092ce 205 205 /*****************************************************************************/ 206 206 207 #define EXT4_BLOCK_GROUP_INODE_UNINIT 0x0001 /* Inode table/bitmap not in use */ 208 #define EXT4_BLOCK_GROUP_BLOCK_UNINIT 0x0002 /* Block bitmap not in use */ 209 #define EXT4_BLOCK_GROUP_INODE_ZEROED 0x0004 /* On-disk itable initialized to zero */ 207 210 208 211 /*
Note:
See TracChangeset
for help on using the changeset viewer.