2 * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de.
3 * This file may be used under the terms of the MIT License.
8 //! interface for the block cache
17 CachedBlock(Volume
* volume
);
18 CachedBlock(Volume
* volume
, off_t block
);
24 const uint8
* SetTo(off_t block
);
26 const uint8
* Block() const { return fBlock
; }
27 off_t
BlockNumber() const { return fBlockNumber
; }
30 CachedBlock(const CachedBlock
&);
31 CachedBlock
&operator=(const CachedBlock
&);
45 CachedBlock::CachedBlock(Volume
* volume
)
55 CachedBlock::CachedBlock(Volume
* volume
, off_t block
)
66 CachedBlock::~CachedBlock()
83 block_cache_put(fVolume
->BlockCache(), fBlockNumber
);
90 CachedBlock::SetTo(off_t block
)
94 return fBlock
= (uint8
*)block_cache_get(fVolume
->BlockCache(), block
);
97 #endif // CACHED_BLOCK_H