diff --git a/UBIXFS.PAS b/UBIXFS.PAS index 0ef1c94..ee06b74 100755 --- a/UBIXFS.PAS +++ b/UBIXFS.PAS @@ -501,8 +501,11 @@ end else begin + // calculate space from nextNode to the end chunkSize := inodeSize - (nextNode - @self); + // move the next node over the one we're deleting move(nextNode^, whichNode^, chunkSize); + // clear out the slack fillchar(pointer(whichNode + chunkSize)^, (nextNode - whichNode), 0); end; result := TRUE // success @@ -993,22 +996,8 @@ begin blockTime^.getFirstKey(searchRec); // least recently used block cacheNode := searchRec.value.p; // get the pointer from the value - assert(syncBlock(cacheNode)); -(* - cacheNode := searchRec.value.p; // get the pointer from the value assert(cacheNode <> NIL); - // I suppose we could write a syncBlock() function, since this - // code is also duplicated in sync(). - if (cacheNode^.dirty) then - begin - with cacheNode^ do - dev^.write(data, - address * (dataSize shr SECTOR_SHIFT), - dataSize shr SECTOR_SHIFT - ); // dev^.write - cacheNode^.dirty := FALSE; - end; // if dirty *) - + assert(syncBlock(cacheNode)); u.p := cacheNode; blockCache^.Delete(@cacheNode^.address, u); blockTime^.Delete(@cacheNode^.lastUsed, u); @@ -2028,17 +2017,7 @@ blockTime^.getFirstKey(searchRec); // least recently used block cacheNode := searchRec.value.p; // get the pointer from the value assert(cacheNode <> NIL); - // I suppose we could write a syncBlock() function, since this - // code is also duplicated in sync(). - if (cacheNode^.dirty) then - begin - with cacheNode^ do - dev^.write(data, - address * (dataSize shr SECTOR_SHIFT), - dataSize shr SECTOR_SHIFT - ); // dev^.write - cacheNode^.dirty := FALSE; - end; // if dirty + assert(syncBlock(cacheNode)); u.p := cacheNode; blockCache^.Delete(@cacheNode^.address, u); blockTime^.Delete(@cacheNode^.lastUsed, u); @@ -2255,17 +2234,7 @@ blockTime^.getFirstKey(searchRec); cacheNode := searchRec.value.p; assert(cacheNode <> NIL); - // I suppose we could write a syncBlock() function, since this - // code is also duplicated in sync(). - if (cacheNode^.dirty) then - begin - with cacheNode^ do - dev^.write(data, - address * (dataSize shr SECTOR_SHIFT), - dataSize shr SECTOR_SHIFT - ); // dev^.write - cacheNode^.dirty := FALSE; - end; // if dirty + assert(syncBlock(cacheNode)); u.p := cacheNode; blockCache^.Delete(@cacheNode^.address, u); blockTime^.Delete(@cacheNode^.lastUsed, u);