Changeset fb04cd90 in mainline for uspace/lib/ext4/libext4_filesystem.c
- Timestamp:
- 2012-05-28T09:56:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4585bda
- Parents:
- d0c9b4b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_filesystem.c
rd0c9b4b rfb04cd90 95 95 fs->superblock = temp_superblock; 96 96 97 uint16_t state = ext4_superblock_get_state(fs->superblock); 98 99 if (state != EXT4_SUPERBLOCK_STATE_VALID_FS) { 100 return ENOTSUP; 101 } 102 103 // Mark system as mounted 104 ext4_superblock_set_state(fs->superblock, EXT4_SUPERBLOCK_STATE_ERROR_FS); 105 rc = ext4_superblock_write_direct(fs->device, fs->superblock); 106 if (rc != EOK) { 107 return rc; 108 } 109 97 110 return EOK; 98 111 } … … 104 117 * @return error code 105 118 */ 106 int ext4_filesystem_fini(ext4_filesystem_t *fs , bool write_sb)119 int ext4_filesystem_fini(ext4_filesystem_t *fs) 107 120 { 108 121 int rc = EOK; 109 122 110 // If needed, write the superblock to the device 111 if (write_sb) { 112 rc = ext4_superblock_write_direct(fs->device, fs->superblock); 113 } 123 // Write the superblock to the device 124 ext4_superblock_set_state(fs->superblock, EXT4_SUPERBLOCK_STATE_VALID_FS); 125 rc = ext4_superblock_write_direct(fs->device, fs->superblock); 114 126 115 127 // Release memory space for superblock
Note:
See TracChangeset
for help on using the changeset viewer.