Changeset 1d69c69 in mainline
- Timestamp:
- 2012-01-30T09:23:12Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 512a7df
- Parents:
- 7c506ced
- Location:
- uspace/lib/ext4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory.c
r7c506ced r1d69c69 98 98 ext4_superblock_t *sb, ext4_directory_entry_ll_t *de) 99 99 { 100 if (ext4_superblock_get_rev_level(sb) == 0 &&101 ext4_superblock_get_minor_rev_level(sb) <5) {100 if (ext4_superblock_get_rev_level(sb) > 0 || 101 ext4_superblock_get_minor_rev_level(sb) >= 5) { 102 102 103 103 return de->inode_type; … … 111 111 ext4_superblock_t *sb, ext4_directory_entry_ll_t *de, uint8_t type) 112 112 { 113 if (ext4_superblock_get_rev_level(sb) == 0 &&114 ext4_superblock_get_minor_rev_level(sb) <5) {113 if (ext4_superblock_get_rev_level(sb) > 0 || 114 ext4_superblock_get_minor_rev_level(sb) >= 5) { 115 115 116 116 de->inode_type = type; … … 260 260 } 261 261 262 static void ext4_directory_write_entry(ext4_superblock_t *sb, 263 ext4_directory_entry_ll_t *entry, uint16_t entry_len, 264 ext4_inode_ref_t *child, const char *name, size_t name_len) 265 { 266 ext4_directory_entry_ll_set_inode(entry, child->index); 267 ext4_directory_entry_ll_set_entry_length(entry, entry_len); 268 ext4_directory_entry_ll_set_name_length(sb, entry, name_len); 269 270 if (ext4_inode_is_type(sb, child->inode, EXT4_INODE_MODE_DIRECTORY)) { 271 ext4_directory_entry_ll_set_inode_type( 272 sb, entry, EXT4_DIRECTORY_FILETYPE_DIR); 273 } else { 274 ext4_directory_entry_ll_set_inode_type( 275 sb, entry, EXT4_DIRECTORY_FILETYPE_REG_FILE); 276 } 277 memcpy(entry->name, name, name_len); 278 } 279 262 280 int ext4_directory_add_entry(ext4_filesystem_t *fs, ext4_inode_ref_t * inode_ref, 263 281 const char *entry_name, ext4_inode_ref_t *child) … … 282 300 if ((entry_inode == 0) && (rec_len >= required_len)) { 283 301 284 // Don't touch entry length 285 ext4_directory_ entry_ll_set_inode(it.current, child->index);286 ext4_directory_entry_ll_set_name_length(fs->superblock, it.current, name_len);302 303 ext4_directory_write_entry(fs->superblock, it.current, rec_len, 304 child, entry_name, name_len); 287 305 it.current_block->dirty = true; 288 306 return ext4_directory_iterator_fini(&it); … … 307 325 // dirtyness will be set now 308 326 309 ext4_directory_entry_ll_set_inode(new_entry, child->index); 310 ext4_directory_entry_ll_set_entry_length(new_entry, free_space); 311 ext4_directory_entry_ll_set_name_length( 312 fs->superblock, new_entry, name_len); 313 314 if (ext4_inode_is_type(fs->superblock, child->inode, EXT4_INODE_MODE_DIRECTORY)) { 315 ext4_directory_entry_ll_set_inode_type( 316 fs->superblock, new_entry, EXT4_DIRECTORY_FILETYPE_DIR); 317 } else { 318 ext4_directory_entry_ll_set_inode_type( 319 fs->superblock, new_entry, EXT4_DIRECTORY_FILETYPE_REG_FILE); 320 } 321 322 memcpy(new_entry->name, entry_name, name_len); 327 ext4_directory_write_entry(fs->superblock, new_entry, 328 free_space, child, entry_name, name_len); 323 329 it.current_block->dirty = true; 324 330 return ext4_directory_iterator_fini(&it); … … 378 384 ext4_directory_entry_ll_t *block_entry = new_block->data; 379 385 380 ext4_directory_entry_ll_set_entry_length(block_entry, block_size); 381 ext4_directory_entry_ll_set_inode(block_entry, child->index); 382 ext4_directory_entry_ll_set_name_length(fs->superblock, block_entry, name_len); 383 memcpy(block_entry->name, entry_name, name_len); 386 ext4_directory_write_entry(fs->superblock, block_entry, block_size, 387 child, entry_name, name_len); 384 388 385 389 new_block->dirty = true; -
uspace/lib/ext4/libext4_ialloc.c
r7c506ced r1d69c69 139 139 while (bgid < bg_count) { 140 140 141 EXT4FS_DBG("testing bg \%u", bgid);142 143 141 ext4_block_group_ref_t *bg_ref; 144 142 rc = ext4_filesystem_get_block_group_ref(fs, bgid, &bg_ref); … … 169 167 rc = ext4_bitmap_find_free_bit_and_set( 170 168 bitmap_block->data, 0, &index_in_group, inodes_in_group); 171 // if (rc == ENOSPC) { 172 // block_put(bitmap_block); 173 // ext4_filesystem_put_block_group_ref(bg_ref); 174 // continue; 175 // } 169 170 // TODO check 171 if (rc == ENOSPC) { 172 block_put(bitmap_block); 173 ext4_filesystem_put_block_group_ref(bg_ref); 174 continue; 175 } 176 176 177 177 bitmap_block->dirty = true;
Note:
See TracChangeset
for help on using the changeset viewer.