Ignore:
Timestamp:
2012-05-28T09:56:44Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4585bda
Parents:
d0c9b4b
Message:

checks by mount operation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_filesystem.c

    rd0c9b4b rfb04cd90  
    9595        fs->superblock = temp_superblock;
    9696
     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
    97110        return EOK;
    98111}
     
    104117 * @return                      error code
    105118 */
    106 int ext4_filesystem_fini(ext4_filesystem_t *fs, bool write_sb)
     119int ext4_filesystem_fini(ext4_filesystem_t *fs)
    107120{
    108121        int rc = EOK;
    109122
    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);
    114126
    115127        // Release memory space for superblock
Note: See TracChangeset for help on using the changeset viewer.