MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2CheckJournal

Function Ext2CheckJournal

Ext4Fsd/ext3/recover.c:53–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53INT
54Ext2CheckJournal(
55 PEXT2_VCB Vcb,
56 PULONG jNo
57)
58{
59 struct ext3_super_block* esb = NULL;
60
61 /* check ext3 super block */
62 esb = (struct ext3_super_block *)Vcb->SuperBlock;
63 if (IsFlagOn(esb->s_feature_incompat,
64 EXT3_FEATURE_INCOMPAT_RECOVER)) {
65 SetLongFlag(Vcb->Flags, VCB_JOURNAL_RECOVER);
66 }
67
68 /* must stop here if volume is read-only */
69 if (IsVcbReadOnly(Vcb)) {
70 goto errorout;
71 }
72
73 /* journal is external ? */
74 if (esb->s_journal_inum == 0) {
75 goto errorout;
76 }
77
78 /* oops: volume is corrupted */
79 if (esb->s_journal_dev) {
80 goto errorout;
81 }
82
83 /* return the journal inode number */
84 *jNo = esb->s_journal_inum;
85
86 return TRUE;
87
88errorout:
89
90 return FALSE;
91}
92
93INT
94Ext2RecoverJournal(

Callers 1

Ext2RecoverJournalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected