1/* 2 * Copyright 2007, Ingo Weinhold, bonefish@users.sf.net. 3 * Distributed under the terms of the MIT License. 4 */ 5 6#include <DiskSystemAddOn.h> 7 8#include <DiskDeviceDefs.h> 9#include <Errors.h> 10 11 12// #pragma mark - BDiskSystemAddOn 13 14 15// constructor 16BDiskSystemAddOn::BDiskSystemAddOn(const char* name, uint32 flags) 17 : 18 fName(name), 19 fFlags(flags) 20{ 21} 22 23 24// destructor 25BDiskSystemAddOn::~BDiskSystemAddOn() 26{ 27} 28 29 30// Name 31const char* 32BDiskSystemAddOn::Name() const 33{ 34 return fName.String(); 35} 36 37 38// Flags 39uint32 40BDiskSystemAddOn::Flags() const 41{ 42 return fFlags; 43} 44 45 46// CanInitialize 47bool 48BDiskSystemAddOn::CanInitialize(const BMutablePartition* partition) 49{ 50 return false; 51} 52 53 54// GetInitializationParameterEditor 55status_t 56BDiskSystemAddOn::GetParameterEditor(B_PARAMETER_EDITOR_TYPE type, 57 BPartitionParameterEditor** editor) 58{ 59 return B_NOT_SUPPORTED; 60} 61 62 63// ValidateInitialize 64status_t 65BDiskSystemAddOn::ValidateInitialize(const BMutablePartition* partition, 66 BString* name, const char* parameters) 67{ 68 return B_BAD_VALUE; 69} 70 71 72// Initialize 73status_t 74BDiskSystemAddOn::Initialize(BMutablePartition* partition, const char* name, 75 const char* parameters, BPartitionHandle** handle) 76{ 77 return B_NOT_SUPPORTED; 78} 79 80 81// GetTypeForContentType 82status_t 83BDiskSystemAddOn::GetTypeForContentType(const char* contentType, BString* type) 84{ 85 return B_NOT_SUPPORTED; 86} 87 88 89// IsSubSystemFor 90bool 91BDiskSystemAddOn::IsSubSystemFor(const BMutablePartition* child) 92{ 93 return false; 94} 95 96 97// #pragma mark - BPartitionHandle 98 99 100// constructor 101BPartitionHandle::BPartitionHandle(BMutablePartition* partition) 102 : 103 fPartition(partition) 104{ 105} 106 107 108// destructor 109BPartitionHandle::~BPartitionHandle() 110{ 111} 112 113 114// Partition 115BMutablePartition* 116BPartitionHandle::Partition() const 117{ 118 return fPartition; 119} 120 121 122// SupportedOperations 123uint32 124BPartitionHandle::SupportedOperations(uint32 mask) 125{ 126 return 0; 127} 128 129 130// SupportedChildOperations 131uint32 132BPartitionHandle::SupportedChildOperations(const BMutablePartition* child, 133 uint32 mask) 134{ 135 return 0; 136} 137 138 139// SupportsInitializingChild 140bool 141BPartitionHandle::SupportsInitializingChild(const BMutablePartition* child, 142 const char* diskSystem) 143{ 144 return false; 145} 146 147 148// GetNextSupportedType 149status_t 150BPartitionHandle::GetNextSupportedType(const BMutablePartition* child, 151 int32* cookie, BString* type) 152{ 153 return B_ENTRY_NOT_FOUND; 154} 155 156 157// GetPartitioningInfo 158status_t 159BPartitionHandle::GetPartitioningInfo(BPartitioningInfo* info) 160{ 161 return B_NOT_SUPPORTED; 162} 163 164 165// Defragment 166status_t 167BPartitionHandle::Defragment() 168{ 169 return B_NOT_SUPPORTED; 170} 171 172 173// Repair 174status_t 175BPartitionHandle::Repair(bool checkOnly) 176{ 177 return B_NOT_SUPPORTED; 178} 179 180 181// ValidateResize 182status_t 183BPartitionHandle::ValidateResize(off_t* size) 184{ 185 return B_BAD_VALUE; 186} 187 188 189// ValidateResizeChild 190status_t 191BPartitionHandle::ValidateResizeChild(const BMutablePartition* child, 192 off_t* size) 193{ 194 return B_BAD_VALUE; 195} 196 197 198// Resize 199status_t 200BPartitionHandle::Resize(off_t size) 201{ 202 return B_NOT_SUPPORTED; 203} 204 205 206// ResizeChild 207status_t 208BPartitionHandle::ResizeChild(BMutablePartition* child, off_t size) 209{ 210 return B_NOT_SUPPORTED; 211} 212 213 214// ValidateMove 215status_t 216BPartitionHandle::ValidateMove(off_t* offset) 217{ 218 // Usually moving a disk system is a no-op for the content disk system, 219 // so we default to true here. 220 return B_OK; 221} 222 223 224// ValidateMoveChild 225status_t 226BPartitionHandle::ValidateMoveChild(const BMutablePartition* child, 227 off_t* offset) 228{ 229 return B_BAD_VALUE; 230} 231 232 233// Move 234status_t 235BPartitionHandle::Move(off_t offset) 236{ 237 // Usually moving a disk system is a no-op for the content disk system, 238 // so we default to OK here. 239 return B_OK; 240} 241 242 243// MoveChild 244status_t 245BPartitionHandle::MoveChild(BMutablePartition* child, off_t offset) 246{ 247 return B_NOT_SUPPORTED; 248} 249 250 251// ValidateSetContentName 252status_t 253BPartitionHandle::ValidateSetContentName(BString* name) 254{ 255 return B_BAD_VALUE; 256} 257 258 259// ValidateSetName 260status_t 261BPartitionHandle::ValidateSetName(const BMutablePartition* child, 262 BString* name) 263{ 264 return B_BAD_VALUE; 265} 266 267 268// SetContentName 269status_t 270BPartitionHandle::SetContentName(const char* name) 271{ 272 return B_NOT_SUPPORTED; 273} 274 275 276// SetName 277status_t 278BPartitionHandle::SetName(BMutablePartition* child, const char* name) 279{ 280 return B_NOT_SUPPORTED; 281} 282 283 284// ValidateSetType 285status_t 286BPartitionHandle::ValidateSetType(const BMutablePartition* child, 287 const char* type) 288{ 289 return B_BAD_VALUE; 290} 291 292 293// SetType 294status_t 295BPartitionHandle::SetType(BMutablePartition* child, const char* type) 296{ 297 return B_NOT_SUPPORTED; 298} 299 300 301// GetContentParameterEditor 302status_t 303BPartitionHandle::GetContentParameterEditor(BPartitionParameterEditor** editor) 304{ 305 return B_NOT_SUPPORTED; 306} 307 308 309// GetParameterEditor 310status_t 311BPartitionHandle::GetParameterEditor(B_PARAMETER_EDITOR_TYPE type, 312 BPartitionParameterEditor** editor) 313{ 314 return B_NOT_SUPPORTED; 315} 316 317 318// ValidateSetContentParameters 319status_t 320BPartitionHandle::ValidateSetContentParameters(const char* parameters) 321{ 322 return B_BAD_VALUE; 323} 324 325 326// ValidateSetParameters 327status_t 328BPartitionHandle::ValidateSetParameters(const BMutablePartition* child, 329 const char* parameters) 330{ 331 return B_BAD_VALUE; 332} 333 334 335// SetContentParameters 336status_t 337BPartitionHandle::SetContentParameters(const char* parameters) 338{ 339 return B_NOT_SUPPORTED; 340} 341 342 343// SetParameters 344status_t 345BPartitionHandle::SetParameters(BMutablePartition* child, 346 const char* parameters) 347{ 348 return B_NOT_SUPPORTED; 349} 350 351 352// ValidateCreateChild 353status_t 354BPartitionHandle::ValidateCreateChild(off_t* offset, off_t* size, 355 const char* type, BString* name, const char* parameters) 356{ 357 return B_BAD_VALUE; 358} 359 360 361// CreateChild 362status_t 363BPartitionHandle::CreateChild(off_t offset, off_t size, const char* type, 364 const char* name, const char* parameters, BMutablePartition** child) 365{ 366 return B_NOT_SUPPORTED; 367} 368 369 370// DeleteChild 371status_t 372BPartitionHandle::DeleteChild(BMutablePartition* child) 373{ 374 return B_NOT_SUPPORTED; 375} 376