Changeset 761 for Whitix/branches
- Timestamp:
- 07/09/08 15:27:44 (5 months ago)
- Location:
- Whitix/branches/fs/include
- Files:
-
- 5 modified
-
fs/bcache.h (modified) (1 diff)
-
fs/journal.h (modified) (8 diffs)
-
i386/pit.h (modified) (1 diff)
-
sched.h (modified) (1 diff)
-
task.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/fs/include/fs/bcache.h
r750 r761 25 25 #define VFS_BCACHE_H 26 26 27 #include <sdevice.h> 28 #include <wait.h> 29 27 30 /* Buffer flags. Bit index into buffer->flags. */ 28 31 #define BUFFER_DIRTY 0x0 29 32 #define BUFFER_LOCKED 0x1 33 #define BUFFER_JOURNAL 0x2 30 34 31 35 /* Defines for dealing with flags. */ 32 36 #define BufferLocked(buffer) ((buffer)->flags & (1 << BUFFER_LOCKED)) 33 37 #define BufferDirty(buffer) ((buffer)->flags & (1 << BUFFER_DIRTY)) 38 #define BufferJournal(buffer) ((buffer)->flags & (1 << BUFFER_JOURNAL)) 34 39 35 40 /* Reference counting. Blocks are only freed if there are no references -
Whitix/branches/fs/include/fs/journal.h
r755 r761 27 27 #include <preempt.h> 28 28 #include <task.h> 29 #include <sched.h> 29 30 #include <timer.h> 30 31 #include <typedefs.h> 32 #include <wait.h> 31 33 32 34 /* In-memory structures. */ 33 35 34 #define JTRANS_RUNNING 1 36 /* Types of list the head can be added to. */ 37 #define JOURN_RESERVED 1 38 #define JOURN_METADATA 2 35 39 36 40 struct JournalHead 37 41 { 38 42 struct Buffer* buffer; 43 struct JournalTrans* transaction; 44 int list; 45 struct ListHead next; 39 46 }; 47 48 #define JTRANS_RUNNING 1 40 49 41 50 struct JournalTrans … … 43 52 struct Journal* journal; 44 53 int state, transId, outstandingBlocks; 45 struct Timer* expireTimer;54 DWORD expires; 46 55 int updates, handleCount; 56 57 /* Lists */ 58 struct ListHead reservedList; 59 struct ListHead metaDataList; 47 60 }; 48 61 … … 50 63 struct JournalHandle 51 64 { 52 int refs, numBlocks ;65 int refs, numBlocks, sync; 53 66 struct JournalTrans* transaction; 54 67 }; 68 69 #define JOURN_COMMIT_INTERVAL 2 /* seconds */ 55 70 56 71 struct Journal … … 59 74 int version; 60 75 DWORD maxLength, sectorSize, maxTransactionBuffers; 61 DWORD transSequence; 62 struct JournalTrans* currTransaction; 76 77 /* Sequence numbers. */ 78 DWORD transSequence, commitSequence, commitRequest; 79 80 /* Block management. */ 81 DWORD head, free; 82 83 struct JournalTrans* currTransaction, *committingTrans; 84 struct Thread* commitThread; 85 WaitQueue commitWait, commitWaitDone; 86 int commitInterval; 63 87 }; 64 88 … … 70 94 DWORD blockType; 71 95 DWORD sequence; 72 } ;96 }PACKED; 73 97 98 /* Block types. */ 99 #define JFS_DESC_BLOCK 1 74 100 #define JFS_SUPERBLOCK_V1 3 75 101 #define JFS_SUPERBLOCK_V2 4 … … 84 110 DWORD first; 85 111 86 /* TODO: Complete. */ 112 DWORD sequence; 113 DWORD start; 114 115 DWORD errNo; 87 116 }; 88 117 … … 92 121 struct Journal* JournalCreate(struct VNode* vNode); 93 122 struct JournalHandle* JournalStart(struct Journal* journal, int numBlocks); 123 int JournalStop(struct JournalHandle* handle); 94 124 struct JournalHead* JournalAddHeader(struct Buffer* buffer); 125 struct JournalHead* JournalGetDescriptorBuffer(struct Journal* journal); 95 126 96 127 /* transaction.c */ 97 128 int JournalGetWriteAccess(struct JournalHandle* handle, struct Buffer* buffer); 129 int JournalDirtyMetadata(struct JournalHandle* handle, struct Buffer* buffer); 130 int JournalForceCommit(struct Journal* journal); 131 132 /* commit.c */ 133 int JournalStartCommit(struct Journal* journal, struct JournalTrans* trans); 134 int JournalWaitCommit(struct Journal* journal, int id); 135 int JournalCommitTransaction(struct Journal* journal); 136 137 /* recovery.c */ 138 int JournalRecover(struct Journal* journal, struct JournalSuperBlock* jSb); 98 139 99 140 /* Defines */ … … 111 152 PreemptEnable() 112 153 154 #define JournHeadToBuffer(head) \ 155 (head)->buffer 156 157 #define BufferToJournHead(buffer) \ 158 (buffer)->privData 159 113 160 #endif -
Whitix/branches/fs/include/i386/pit.h
r608 r761 33 33 34 34 #define HZ 100 35 #define CLOCK_TICK_RATE 119318 2/* The PIT's underlying HZ */35 #define CLOCK_TICK_RATE 1193180 /* The PIT's underlying HZ */ 36 36 #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) 37 37 -
Whitix/branches/fs/include/sched.h
r608 r761 41 41 /* stackP is not applicable to kernel threads. */ 42 42 #define ThrCreateKernelThread(address) (ThrCreateThread(NULL,(DWORD)(address),false,0, NULL)) 43 #define ThrCreateKernelThreadArg(address, arg) (ThrCreateThread(NULL, (DWORD)(address), false, 0, (arg))) 43 44 44 45 struct Thread* ThrCreateThread(struct Process* parent,DWORD entry,int user,DWORD stackP, void* argument); -
Whitix/branches/fs/include/task.h
r750 r761 20 20 #define TASK_H 21 21 22 #include <fs/journal.h>23 22 #include <llist.h> 24 23 #include <typedefs.h> … … 28 27 29 28 struct Process; 29 struct JournalHandle; 30 30 31 31 #define THR_USED_MATH 1