FreeCalypso > hg > ffs-editor
comparison src/cs/drivers/drv_app/ffs/board/fsck.c @ 22:f2fa3f590209
FFS journal_init() bugfix matching Magnetite and Selenite
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 22 May 2020 18:26:16 +0000 |
| parents | 92470e5d0b9e |
| children |
comparison
equal
deleted
inserted
replaced
| 21:5dd2fa1d3da1 | 22:f2fa3f590209 |
|---|---|
| 1245 // case. Otherwise, if journal file is clean (no journals pending) and all | 1245 // case. Otherwise, if journal file is clean (no journals pending) and all |
| 1246 // is fine, return EFFS_OK. | 1246 // is fine, return EFFS_OK. |
| 1247 effs_t journal_init(iref_t i) | 1247 effs_t journal_init(iref_t i) |
| 1248 { | 1248 { |
| 1249 int j; | 1249 int j; |
| 1250 struct inode_s *ip = inode_addr(i); | 1250 struct inode_s *ip; |
| 1251 struct journal_s *addr; | 1251 struct journal_s *addr; |
| 1252 | 1252 |
| 1253 if (i == 0) { | 1253 if (i == 0) { |
| 1254 // Journal file does not exist, so create it | 1254 // Journal file does not exist, so create it |
| 1255 if ((i = journal_create(0)) <= 0) { | 1255 if ((i = journal_create(0)) <= 0) { |
| 1258 } | 1258 } |
| 1259 } | 1259 } |
| 1260 | 1260 |
| 1261 fs.journal_depth = 0; | 1261 fs.journal_depth = 0; |
| 1262 fs.journal_pos = JOURNAL_POS_INITIAL; | 1262 fs.journal_pos = JOURNAL_POS_INITIAL; |
| 1263 ip = inode_addr(i); | |
| 1263 | 1264 |
| 1264 addr = (struct journal_s *) | 1265 addr = (struct journal_s *) |
| 1265 offset2addr(location2offset(ip->location) + fs.journal_pos); | 1266 offset2addr(location2offset(ip->location) + fs.journal_pos); |
| 1266 | 1267 |
| 1267 tw(tr(TR_BEGIN, TrJournal, "journal_init(%d) {\n", i)); | 1268 tw(tr(TR_BEGIN, TrJournal, "journal_init(%d) {\n", i)); |
