Changeset 06d85e5 in mainline for uspace/lib/ext4/libext4_superblock.c
- Timestamp:
- 2012-06-18T11:09:34Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2616a75b
- Parents:
- 9a487cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_superblock.c
r9a487cc r06d85e5 981 981 int rc; 982 982 983 / / Allocated memory for superblock structure983 /* Allocated memory for superblock structure */ 984 984 void *data = malloc(EXT4_SUPERBLOCK_SIZE); 985 985 if (data == NULL) { … … 987 987 } 988 988 989 / / Read data from block device989 /* Read data from block device */ 990 990 rc = block_read_bytes_direct(service_id, EXT4_SUPERBLOCK_OFFSET, 991 991 EXT4_SUPERBLOCK_SIZE, data); … … 996 996 } 997 997 998 / / Set output value998 /* Set output value */ 999 999 (*sb) = data; 1000 1000 … … 1014 1014 uint32_t phys_block_size; 1015 1015 1016 / / Load physical block size from block device1016 /* Load physical block size from block device */ 1017 1017 rc = block_get_bsize(service_id, &phys_block_size); 1018 1018 if (rc != EOK) { … … 1020 1020 } 1021 1021 1022 / / Compute address of the first block1022 /* Compute address of the first block */ 1023 1023 uint64_t first_block = EXT4_SUPERBLOCK_OFFSET / phys_block_size; 1024 / / Compute number of block to write1024 /* Compute number of block to write */ 1025 1025 uint32_t block_count = EXT4_SUPERBLOCK_SIZE / phys_block_size; 1026 1026 1027 / / Check alignment1027 /* Check alignment */ 1028 1028 if (EXT4_SUPERBLOCK_SIZE % phys_block_size) { 1029 1029 block_count++; 1030 1030 } 1031 1031 1032 / / Write data1032 /* Write data */ 1033 1033 return block_write_direct(service_id, first_block, block_count, sb); 1034 1034
Note:
See TracChangeset
for help on using the changeset viewer.