Changeset 795 for Whitix/branches/fs/include/fs/journal.h
- Timestamp:
- 07/13/08 20:52:42 (4 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/fs/include/fs/journal.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/fs/include/fs/journal.h
r776 r795 38 38 #define JOURN_METADATA 2 39 39 #define JOURN_LOGCTL 3 40 #define JOURN_SHADOW 4 41 #define JOURN_IO 5 42 #define JOURN_FORGET 6 40 43 41 44 struct JournalHead 42 45 { 43 46 struct Buffer* buffer; 44 struct JournalTrans* transaction ;47 struct JournalTrans* transaction, *nextTransaction; 45 48 int list; 46 49 struct ListHead next; 50 WaitQueue wait; 47 51 }; 48 52 49 53 #define JTRANS_RUNNING 1 54 #define JTRANS_COMMIT 2 50 55 51 56 struct JournalTrans … … 53 58 struct Journal* journal; 54 59 int state, transId, outstandingBlocks; 55 DWORD expires ;60 DWORD expires, logStart; 56 61 int updates, handleCount; 57 62 … … 60 65 struct ListHead metaDataList; 61 66 struct ListHead logControlList; 67 struct ListHead shadowList; 68 struct ListHead ioList; 69 struct ListHead forgetList; 70 71 struct ListHead next; 62 72 }; 63 73 … … 70 80 71 81 #define JOURN_COMMIT_INTERVAL 2 /* seconds */ 82 83 #define JOURN_UNMOUNT 1 72 84 73 85 struct Journal … … 76 88 int version; 77 89 DWORD maxLength, sectorSize, maxTransactionBuffers; 90 BYTE uuid[16]; 78 91 79 92 /* Sequence numbers. */ 80 DWORD transSequence, commitSequence, commitRequest;93 DWORD transSequence, commitSequence, tailSequence, commitRequest; 81 94 82 95 /* Block management. */ 83 DWORD head, free; 96 DWORD head, tail, free; 97 98 /* Checkpoints. */ 99 struct ListHead checkpointTrans; 84 100 85 101 struct JournalTrans* currTransaction, *committingTrans; 86 102 struct Thread* commitThread; 87 WaitQueue commitWait, commitWaitDone; 88 int commitInterval; 103 WaitQueue commitWait, commitWaitDone, waitUpdates; 104 int commitInterval, flags; 105 }; 106 107 #define JOURN_PASS_SCAN 0 108 #define JOURN_PASS_REVOKE 1 109 #define JOURN_PASS_REPLAY 2 110 111 struct JournalRecovery 112 { 113 DWORD firstTransaction, endTransaction; 89 114 }; 90 115 … … 98 123 }PACKED; 99 124 125 #define JOURN_FLAG_SAME_UUID 2 126 #define JOURN_FLAG_LAST_TAG 8 127 128 struct JournalBlockTag 129 { 130 DWORD blockNum; 131 DWORD flags; 132 }; 133 100 134 /* Block types. */ 101 135 #define JFS_DESC_BLOCK 1 136 #define JFS_COMMIT_BLOCK 2 102 137 #define JFS_SUPERBLOCK_V1 3 103 138 #define JFS_SUPERBLOCK_V2 4 … … 126 161 struct JournalHead* JournalAddHeader(struct Buffer* buffer); 127 162 struct JournalHead* JournalGetDescriptorBuffer(struct Journal* journal); 163 void JournalUpdateSuperBlock(struct Journal* journal); 164 int JournalBlockMap(struct Journal* journal, DWORD blockNo, DWORD* ret); 128 165 129 166 /* transaction.c */ … … 131 168 int JournalDirtyMetadata(struct JournalHandle* handle, struct Buffer* buffer); 132 169 int JournalForceCommit(struct Journal* journal); 170 void JournalFileBuffer(struct JournalHead* head, struct JournalTrans* trans, int type); 171 void JournalUnfileBuffer(struct JournalHead* head); 133 172 134 173 /* commit.c */ … … 140 179 int JournalRecover(struct Journal* journal, struct JournalSuperBlock* jSb); 141 180 181 /* checkpoint.c */ 182 int JournalCheckpoint(struct Journal* journal); 183 142 184 /* Defines */ 143 185
