| 51 | } |
| 52 | |
| 53 | INT |
| 54 | Ext2CheckJournal( |
| 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 | |
| 88 | errorout: |
| 89 | |
| 90 | return FALSE; |
| 91 | } |
| 92 | |
| 93 | INT |
| 94 | Ext2RecoverJournal( |
no outgoing calls
no test coverage detected