Show
Ignore:
Timestamp:
07/09/08 18:46:57 (5 months ago)
Author:
mwhitworth
Message:

Fix buffer locking behaviour to avoid races.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/fs/fs/vfs/file.c

    r746 r770  
    4848                return; 
    4949 
    50         vNode->aTime=currTime; 
    51         SetVNodeDirty(vNode); 
     50        /* TODO: Check granularity of vNode times on disk. No point dirtying a vNode if 
     51         * the time isn't updated. */ 
     52 
     53        if (vNode->aTime.seconds < currTime.seconds) 
     54        { 
     55                vNode->aTime=currTime; 
     56                SetVNodeDirty(vNode); 
     57        } 
    5258} 
    5359 
     
    7480                return; 
    7581 
    76         vNode->mTime=currTime; 
    77  
    7882        /* Has the vNode just been created? If so, record its 
    7983        creation time */ 
     
    8185                vNode->cTime=currTime; 
    8286 
    83         SetVNodeDirty(vNode); 
     87        /* See VfsFileAccessed comment. */ 
     88        if (vNode->mTime.seconds < currTime.seconds || create) 
     89        { 
     90                vNode->mTime=currTime; 
     91                SetVNodeDirty(vNode); 
     92        } 
    8493} 
    8594 
     
    146155                copyOffset+=readSize; 
    147156                file->position+=readSize; 
     157 
    148158                BlockFree(buff); 
    149159        }