Changeset 8bd5dad in mainline for uspace/lib/ext2/libext2_filesystem.c
- Timestamp:
- 2011-02-13T21:20:21Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c00e729
- Parents:
- 566c401
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext2/libext2_filesystem.c
r566c401 r8bd5dad 44 44 * initializes libblock cache with appropriate logical block size. 45 45 * 46 * @param fs 47 * @param devmap_handle 46 * @param fs Pointer to ext2_filesystem_t to initialize 47 * @param devmap_handle Device handle of the block device 48 48 */ 49 49 int ext2_filesystem_init(ext2_filesystem_t *fs, devmap_handle_t devmap_handle) … … 51 51 int rc; 52 52 ext2_superblock_t *temp_superblock; 53 size_t block_size; 53 54 54 55 fs->device = devmap_handle; … … 65 66 } 66 67 67 free(temp_superblock); 68 block_size = ext2_superblock_get_block_size(temp_superblock); 69 70 if (block_size > EXT2_MAX_BLOCK_SIZE) { 71 block_fini(fs->device); 72 return ENOTSUP; 73 } 74 75 rc = block_cache_init(devmap_handle, block_size, 0, CACHE_MODE_WT); 76 if (rc != EOK) { 77 block_fini(fs->device); 78 return rc; 79 } 80 81 fs->superblock = temp_superblock; 68 82 69 83 return EOK; … … 77 91 void ext2_filesystem_fini(ext2_filesystem_t *fs) 78 92 { 93 free(fs->superblock); 79 94 block_fini(fs->device); 80 95 }
Note:
See TracChangeset
for help on using the changeset viewer.