Changeset 798

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

Fix file buffer on multiple transactions, add more locking.

Files:
1 modified

Legend:

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

    r789 r798  
    7777        if (numBlocks > journal->maxTransactionBuffers) 
    7878        { 
    79                 KePrint(KERN_INFO "JournalStartHandle: handle wants too many credits (%d, " 
     79                KePrint(KERN_INFO "JournalHandleStart: handle wants too many credits (%d, " 
    8080                "%d)\n", numBlocks, journal->maxTransactionBuffers); 
    8181                return -ENOSPC; 
     
    140140                return handle; 
    141141        } 
     142         
     143        JournalLock(journal); 
    142144 
    143145        handle=JournalHandleAllocate(numBlocks); 
     
    145147        ret=JournalHandleStart(journal, handle); 
    146148 
     149        JournalUnlock(journal); 
     150 
    147151        if (ret) 
    148152        { 
     
    202206 
    203207        if (!head) 
    204         { 
    205                 KePrint("JournalFileBuffer: head = NULL\n"); 
    206208                return; 
    207         } 
    208209 
    209210        /* Already filed? */ 
    210211        if (head->transaction && head->list == type) 
    211212                return; 
     213                 
     214        PreemptDisable(); 
    212215 
    213216        /*  
     
    216219         */ 
    217220 
    218         if (head->transaction == trans && head->list > 0 && head->list != type) 
     221        if (head->transaction) 
    219222                JournalUnfileBuffer(head); 
    220223        else 
     
    254257        ListAddTail(&head->next, list); 
    255258        head->list=type; 
     259         
     260        PreemptEnable(); 
    256261} 
    257262 
     
    281286                { 
    282287                        JournalUnlock(journal); 
    283 //                      KePrint("shadow wait, %#X, %u\n", head, JournHeadToBuffer(head)->blockNum); 
     288                        KePrint("shadow wait, %#X, %u\n", head, JournHeadToBuffer(head)->blockNum); 
    284289                        WAIT_ON(head->wait, head->list != JOURN_SHADOW); 
    285290                        JournalLock(journal);