Browse Source

ext4_journal: simplify the code logic of superblock replaying.

pull/11/head
ngkaho1234 9 years ago
parent
commit
9668eacad9
  1. 10
      lwext4/ext4_journal.c

10
lwext4/ext4_journal.c

@ -374,14 +374,10 @@ static void jbd_replay_block_tags(struct jbd_fs *jbd_fs,
uint16_t mount_count, state;
mount_count = ext4_get16(&fs->sb, mount_count);
state = ext4_get16(&fs->sb, state);
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;
memcpy(&fs->sb,
journal_block.data + EXT4_SUPERBLOCK_OFFSET,
EXT4_SUPERBLOCK_SIZE);
/* Mark system as mounted */
ext4_set16(&fs->sb, state, state);

Loading…
Cancel
Save