1 /* 2 * Copyright 2008, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * François Revol <revol@free.fr> 7 */ 8 9 10 #include "CachedBlock.h" 11 #include "Stream.h" 12 #include "Directory.h" 13 #include "File.h" 14 15 #include <util/kernel_cpp.h> 16 17 #include <stdlib.h> 18 #include <string.h> 19 #include <unistd.h> 20 21 22 using namespace FATFS; 23 24 25 CachedBlock::CachedBlock(Volume &volume) 26 : 27 fVolume(volume), 28 fBlockNumber(-1LL), 29 fBlock(NULL) 30 { 31 } 32 33 34 CachedBlock::CachedBlock(Volume &volume, off_t block) 35 : 36 fVolume(volume), 37 fBlockNumber(-1LL), 38 fBlock(NULL) 39 { 40 SetTo(block); 41 } 42 43 44 CachedBlock::~CachedBlock() 45 { 46 free(fBlock); 47 } 48 49 50