Lines Matching refs:jsb
45 journal_superblock_t *jsb) in e2fsck_journal_verify_csum_type() argument
50 return jsb->s_checksum_type == JBD2_CRC32C_CHKSUM; in e2fsck_journal_verify_csum_type()
53 static __u32 e2fsck_journal_sb_csum(journal_superblock_t *jsb) in e2fsck_journal_sb_csum() argument
57 old_crc = jsb->s_checksum; in e2fsck_journal_sb_csum()
58 jsb->s_checksum = 0; in e2fsck_journal_sb_csum()
59 crc = ext2fs_crc32c_le(~0, (unsigned char *)jsb, in e2fsck_journal_sb_csum()
61 jsb->s_checksum = old_crc; in e2fsck_journal_sb_csum()
67 journal_superblock_t *jsb) in e2fsck_journal_sb_csum_verify() argument
74 provided = ext2fs_be32_to_cpu(jsb->s_checksum); in e2fsck_journal_sb_csum_verify()
75 calculated = e2fsck_journal_sb_csum(jsb); in e2fsck_journal_sb_csum_verify()
81 journal_superblock_t *jsb) in e2fsck_journal_sb_csum_set() argument
88 crc = e2fsck_journal_sb_csum(jsb); in e2fsck_journal_sb_csum_set()
89 jsb->s_checksum = ext2fs_cpu_to_be32(crc); in e2fsck_journal_sb_csum_set()
585 journal_superblock_t *jsb; in e2fsck_journal_load() local
598 jsb = journal->j_superblock; in e2fsck_journal_load()
600 if (jsb->s_header.h_magic != htonl(JFS_MAGIC_NUMBER)) in e2fsck_journal_load()
603 switch (ntohl(jsb->s_header.h_blocktype)) { in e2fsck_journal_load()
606 if (jsb->s_feature_compat || in e2fsck_journal_load()
607 jsb->s_feature_incompat || in e2fsck_journal_load()
608 jsb->s_feature_ro_compat || in e2fsck_journal_load()
609 jsb->s_nr_users) in e2fsck_journal_load()
615 if (ntohl(jsb->s_nr_users) > 1 && in e2fsck_journal_load()
618 if (ntohl(jsb->s_nr_users) > 1) { in e2fsck_journal_load()
654 if (!e2fsck_journal_verify_csum_type(journal, jsb) || in e2fsck_journal_load()
655 !e2fsck_journal_sb_csum_verify(journal, jsb)) in e2fsck_journal_load()
659 journal->j_csum_seed = jbd2_chksum(journal, ~0, jsb->s_uuid, in e2fsck_journal_load()
660 sizeof(jsb->s_uuid)); in e2fsck_journal_load()
665 if (jsb->s_blocksize != htonl(journal->j_blocksize)) { in e2fsck_journal_load()
672 if (ntohl(jsb->s_maxlen) < journal->j_maxlen) in e2fsck_journal_load()
673 journal->j_maxlen = ntohl(jsb->s_maxlen); in e2fsck_journal_load()
674 else if (ntohl(jsb->s_maxlen) > journal->j_maxlen) { in e2fsck_journal_load()
681 journal->j_tail_sequence = ntohl(jsb->s_sequence); in e2fsck_journal_load()
683 journal->j_tail = ntohl(jsb->s_start); in e2fsck_journal_load()
684 journal->j_first = ntohl(jsb->s_first); in e2fsck_journal_load()
685 journal->j_last = ntohl(jsb->s_maxlen); in e2fsck_journal_load()
690 static void e2fsck_journal_reset_super(e2fsck_t ctx, journal_superblock_t *jsb, in e2fsck_journal_reset_super() argument
705 if (jsb->s_header.h_magic != htonl(JFS_MAGIC_NUMBER) || in e2fsck_journal_reset_super()
706 jsb->s_header.h_blocktype != htonl(JFS_SUPERBLOCK_V1)) { in e2fsck_journal_reset_super()
707 jsb->s_header.h_magic = htonl(JFS_MAGIC_NUMBER); in e2fsck_journal_reset_super()
708 jsb->s_header.h_blocktype = htonl(JFS_SUPERBLOCK_V2); in e2fsck_journal_reset_super()
713 p = ((char *) jsb) + sizeof(journal_header_t); in e2fsck_journal_reset_super()
716 jsb->s_blocksize = htonl(ctx->fs->blocksize); in e2fsck_journal_reset_super()
717 jsb->s_maxlen = htonl(journal->j_maxlen); in e2fsck_journal_reset_super()
718 jsb->s_first = htonl(1); in e2fsck_journal_reset_super()
728 jsb->s_sequence = htonl(new_seq); in e2fsck_journal_reset_super()
729 e2fsck_journal_sb_csum_set(journal, jsb); in e2fsck_journal_reset_super()
760 journal_superblock_t *jsb; in e2fsck_journal_release() local
765 jsb = journal->j_superblock; in e2fsck_journal_release()
766 jsb->s_sequence = htonl(journal->j_tail_sequence); in e2fsck_journal_release()
768 jsb->s_start = 0; /* this marks the journal as empty */ in e2fsck_journal_release()
769 e2fsck_journal_sb_csum_set(journal, jsb); in e2fsck_journal_release()