Changeset 775 for Whitix/branches

Show
Ignore:
Timestamp:
07/10/08 00:14:48 (5 months ago)
Author:
mwhitworth
Message:

Add to JournalCommitTransaction, add stub for JournalWriteMetadataBuffer.

Location:
Whitix/branches/fs/fs/journal
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/fs/fs/journal/commit.c

    r763 r775  
    5252} 
    5353 
    54 int JournalCommitMetadata(struct Journal* journal) 
     54struct JournalHead* JournalCommitMetadata(struct Journal* journal, struct JournalTrans* commitTrans) 
    5555{ 
    56 #if 0 
    57         ListForEachEntry(head, &commitTrans->metaDataList, next) 
     56        struct JournalHead* curr, *newHead; 
     57        struct JournalHead* descriptor=NULL; /* On-disk structure. */ 
     58        struct JournalHeader* dHeader; 
     59        struct Buffer* buffers[64]; 
     60        int bufIndex=0; 
     61        int firstTag=0; 
     62        struct JournalBlockTag* tag; 
     63        char* tagPointer=NULL; 
     64        int spaceLeft=-1; 
     65        DWORD blockNo; 
     66 
     67        ListForEachEntry(curr, &commitTrans->metaDataList, next) 
    5868        { 
    5969                if (!descriptor) 
     
    6979                        dHeader->blockType=CpuToBe32(JFS_DESC_BLOCK); 
    7080                        dHeader->sequence=CpuToBe32(commitTrans->transId); 
     81 
     82                        tagPointer=&buffer->data[sizeof(struct JournalHeader)];  
     83                        spaceLeft=journal->sectorSize-sizeof(struct JournalHeader); 
     84                        firstTag=1; 
     85 
     86                        buffers[bufIndex++]=buffer; 
     87 
     88                        JournalFileBuffer(descriptor, commitTrans, JOURN_LOGCTL); 
    7189                } 
     90 
     91                JournalNextLogBlock(journal, &blockNo); 
     92 
     93                JournalWriteMetadataBuffer(commitTrans, curr, &newHead, blockNo); 
     94                 
    7295        } 
    73 #endif 
     96 
     97        return descriptor; 
    7498} 
    7599 
     
    79103{ 
    80104        struct JournalTrans* commitTrans; 
    81         struct JournalHead* head; 
    82         struct JournalHead* descriptor=NULL; /* On-disk structure. */ 
    83         struct JournalHeader* dHeader; 
    84105 
    85106        JournalLock(journal); 
     
    105126 
    106127        /* Write out metadata to the journal. */ 
    107         JournalCommitMetadata(journal); 
     128        JournalCommitMetadata(journal, commitTrans); 
    108129 
    109130        JournalUnlock(journal); 
  • Whitix/branches/fs/fs/journal/journals.c

    r759 r775  
    120120} 
    121121 
     122int JournalWriteMetadataBuffer(struct JournalTrans* commmitTrans, struct JournalHead* old,  
     123        struct JournalHead* new, DWORD blockNo) 
     124{ 
     125        KePrint("JournalWriteMetadataBuffer\n"); 
     126 
     127        return 0; 
     128} 
     129 
    122130int JournalNextLogBlock(struct Journal* journal, DWORD* ret) 
    123131{ 
  • Whitix/branches/fs/fs/journal/transaction.c

    r759 r775  
    5757        INIT_LIST_HEAD(&ret->reservedList); 
    5858        INIT_LIST_HEAD(&ret->metaDataList); 
     59        INIT_LIST_HEAD(&ret->logControlList); 
    5960 
    6061        /* TODO: Set up timer. */ 
     
    212213                        break; 
    213214 
     215                case JOURN_LOGCTL: 
     216                        list=&trans->logControlList; 
     217                        break; 
     218 
    214219                default: 
    215220                        KePrint("FileBuffer: handle %d!\n", type);