ref: e70a208249503ae237b035bfc6e9116c2c6fa762
parent: 6079bff96f2beb1343fe3664b4781b8a258bee6b
author: ngkaho1234 <[email protected]>
date: Sat Nov 28 15:38:33 EST 2015
ext4_journal: simple handling on superblock.
--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -374,9 +374,14 @@
uint16_t mount_count, state;
mount_count = ext4_get16(&fs->sb, mount_count);
state = ext4_get16(&fs->sb, state);
- memcpy(&fs->sb,
- journal_block.data,
- EXT4_SUPERBLOCK_SIZE);
+ r = ext4_blocks_set_direct(fs->bdev, journal_block.data,
+ 0, 1);
+ if (r != EOK)
+ return;
+
+ r = ext4_sb_read(fs->bdev, &fs->sb);
+ if (r != EOK)
+ return;
/* Mark system as mounted */
ext4_set16(&fs->sb, state, state);