update Cache/

git-svn-id: https://profuse.googlecode.com/svn/branches/profuse_interim@368 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
ksherlock
2011-02-28 05:00:21 +00:00
parent 68a7851f33
commit c7c4f13bf7
3 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -51,7 +51,8 @@ void BlockCache::read(unsigned block, void *bp)
BlockCachePointer BlockCache::Create(BlockDevicePointer device)
{
if (!device.get()) return BlockCachePointer();
// this just calls the device virtual function to create a cache.
if (!device) return BlockCachePointer();
return device->createBlockCache();
}
+4 -1
View File
@@ -60,7 +60,10 @@ using ProFUSE::POSIXException;
BlockCachePointer ConcreteBlockCache::Create(BlockDevicePointer device, unsigned size)
{
return BlockCachePointer(new ConcreteBlockCache(device, size));
//return BlockCachePointer(new ConcreteBlockCache(device, size));
// constructor must be accessible to std::make_shared...
return MAKE_SHARED(ConcreteBlockCache, device, size);
}
ConcreteBlockCache::ConcreteBlockCache(BlockDevicePointer device, unsigned size) :
+2 -1
View File
@@ -21,7 +21,8 @@ using ProFUSE::POSIXException;
BlockCachePointer MappedBlockCache::Create(BlockDevicePointer device, void *data)
{
return BlockCachePointer(new MappedBlockCache(device, data));
//return BlockCachePointer(new MappedBlockCache(device, data));
return MAKE_SHARED(MappedBlockCache, device, data);
}