Changeset 805

Show
Ignore:
Timestamp:
07/14/08 20:55:41 (2 months ago)
Author:
mwhitworth
Message:

Add wrapping code for recovery.

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

Legend:

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

    r800 r805  
    164164                ThrSuspendThread(currThread); 
    165165                ThrSchedule(); /* Will return here when the thread is scheduled again */ 
     166                 
    166167                TimerRemove(&commitTimer); 
    167168                 
  • Whitix/branches/fs/fs/journal/recovery.c

    r797 r805  
    2525#include <wait.h> 
    2626 
     27#define JournalWrap(journal, pos) \ 
     28        if ((pos) >= (journal)->maxLength) \ 
     29                (pos) -= ((journal)->maxLength - (journal)->head) 
     30 
    2731int JournalCountTags(struct Buffer* buffer, int size) 
    2832{ 
     
    6872                ioBlock=*logBlock; 
    6973                *logBlock=(*logBlock)+1; 
    70                 /* WRAP */ 
     74                JournalWrap(journal, *logBlock); 
    7175                 
    7276                /* Read the block of data in the journal */ 
     
    128132                 
    129133                nextLogBlock++; 
    130                 /* WRAP */ 
     134                JournalWrap(journal, nextLogBlock); 
    131135                 
    132136                head=(struct JournalHeader*)(buffer->data);