mirror of
https://github.com/ksherlock/profuse.git
synced 2026-04-20 14:16:37 +00:00
update Cache/
git-svn-id: https://profuse.googlecode.com/svn/branches/profuse_interim@368 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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) :
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user