2007-02-26 16:26:02 +00:00
|
|
|
// BeOSKernelFileSystem.cpp
|
|
|
|
|
|
2007-02-28 04:54:13 +00:00
|
|
|
#include "BeOSKernelFileSystem.h"
|
|
|
|
|
|
2007-02-26 16:26:02 +00:00
|
|
|
#include <new>
|
|
|
|
|
|
|
|
|
|
#include "BeOSKernelVolume.h"
|
|
|
|
|
|
|
|
|
|
// constructor
|
2007-02-28 04:54:13 +00:00
|
|
|
BeOSKernelFileSystem::BeOSKernelFileSystem(beos_vnode_ops* fsOps)
|
2007-02-26 16:26:02 +00:00
|
|
|
: FileSystem(),
|
|
|
|
|
fFSOps(fsOps)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// destructor
|
|
|
|
|
BeOSKernelFileSystem::~BeOSKernelFileSystem()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CreateVolume
|
|
|
|
|
status_t
|
2007-02-27 23:27:27 +00:00
|
|
|
BeOSKernelFileSystem::CreateVolume(Volume** volume, mount_id id)
|
2007-02-26 16:26:02 +00:00
|
|
|
{
|
|
|
|
|
// check initialization and parameters
|
2007-02-27 23:27:27 +00:00
|
|
|
if (!fFSOps || !volume)
|
2007-02-26 16:26:02 +00:00
|
|
|
return B_BAD_VALUE;
|
2007-02-27 23:27:27 +00:00
|
|
|
|
2007-02-26 16:26:02 +00:00
|
|
|
// create the volume
|
|
|
|
|
*volume = new(nothrow) BeOSKernelVolume(this, id, fFSOps);
|
|
|
|
|
if (!*volume)
|
|
|
|
|
return B_NO_MEMORY;
|
|
|
|
|
return B_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteVolume
|
|
|
|
|
status_t
|
|
|
|
|
BeOSKernelFileSystem::DeleteVolume(Volume* volume)
|
|
|
|
|
{
|
|
|
|
|
if (!volume || !dynamic_cast<BeOSKernelVolume*>(volume))
|
|
|
|
|
return B_BAD_VALUE;
|
|
|
|
|
delete volume;
|
|
|
|
|
return B_OK;
|
|
|
|
|
}
|
|
|
|
|
|