Changeset 9c0c0e1 in mainline for uspace/lib/ext4/libext4_filesystem.c
- Timestamp:
- 2011-10-04T12:18:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a23297c
- Parents:
- 01ab41b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_filesystem.c
r01ab41b r9c0c0e1 52 52 fs->device = service_id; 53 53 54 // TODO block size !!!54 // TODO what does constant 2048 mean? 55 55 rc = block_init(EXCHANGE_SERIALIZE, fs->device, 2048); 56 56 if (rc != EOK) { … … 58 58 } 59 59 60 /* Read superblock from device */ 60 61 rc = ext4_superblock_read_direct(fs->device, &temp_superblock); 61 62 if (rc != EOK) { … … 64 65 } 65 66 67 /* Read block size from superblock and check */ 66 68 block_size = ext4_superblock_get_block_size(temp_superblock); 67 68 69 if (block_size > EXT4_MAX_BLOCK_SIZE) { 69 70 block_fini(fs->device); … … 71 72 } 72 73 74 /* Initialize block caching */ 73 75 rc = block_cache_init(service_id, block_size, 0, CACHE_MODE_WT); 74 76 if (rc != EOK) { … … 77 79 } 78 80 81 /* Return loaded superblock */ 79 82 fs->superblock = temp_superblock; 80 83 81 82 // TODO83 84 return EOK; 84 85 } … … 102 103 * TODO doxy 103 104 */ 104 int ext4_filesystem_check_f lags(ext4_filesystem_t *fs, bool *o_read_only)105 int ext4_filesystem_check_features(ext4_filesystem_t *fs, bool *o_read_only) 105 106 { 106 // TODO 107 /* Feature flags are present in rev 1 and later */ 108 if (ext4_superblock_get_rev_level(fs->superblock) == 0) { 109 *o_read_only = false; 110 return EOK; 111 } 112 113 uint32_t incompatible_features; 114 incompatible_features = ext4_superblock_get_features_incompatible(fs->superblock); 115 incompatible_features &= ~EXT4_FEATURE_INCOMPAT_SUPP; 116 if (incompatible_features > 0) { 117 *o_read_only = true; 118 return ENOTSUP; 119 } 120 121 uint32_t compatible_read_only; 122 compatible_read_only = ext4_superblock_get_features_read_only(fs->superblock); 123 compatible_read_only &= ~EXT4_FEATURE_RO_COMPAT_SUPP; 124 if (compatible_read_only > 0) { 125 *o_read_only = true; 126 } 127 107 128 return EOK; 108 129 }
Note:
See TracChangeset
for help on using the changeset viewer.