* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Ingo Weinhold, [email protected].
|
* Copyright 2007, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2008, Axel Dörfler, [email protected].
|
* Copyright 2008-2010, Axel Dörfler, [email protected].
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -57,20 +57,17 @@ static const uint32 kDiskSystemFlags =
|
|||||||
// #pragma mark - BFSAddOn
|
// #pragma mark - BFSAddOn
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
|
||||||
BFSAddOn::BFSAddOn()
|
BFSAddOn::BFSAddOn()
|
||||||
: BDiskSystemAddOn(kPartitionTypeBFS, kDiskSystemFlags)
|
: BDiskSystemAddOn(kPartitionTypeBFS, kDiskSystemFlags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// destructor
|
|
||||||
BFSAddOn::~BFSAddOn()
|
BFSAddOn::~BFSAddOn()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CreatePartitionHandle
|
|
||||||
status_t
|
status_t
|
||||||
BFSAddOn::CreatePartitionHandle(BMutablePartition* partition,
|
BFSAddOn::CreatePartitionHandle(BMutablePartition* partition,
|
||||||
BPartitionHandle** _handle)
|
BPartitionHandle** _handle)
|
||||||
@@ -90,7 +87,6 @@ BFSAddOn::CreatePartitionHandle(BMutablePartition* partition,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CanInitialize
|
|
||||||
bool
|
bool
|
||||||
BFSAddOn::CanInitialize(const BMutablePartition* partition)
|
BFSAddOn::CanInitialize(const BMutablePartition* partition)
|
||||||
{
|
{
|
||||||
@@ -99,7 +95,6 @@ BFSAddOn::CanInitialize(const BMutablePartition* partition)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetInitializationParameterEditor
|
|
||||||
status_t
|
status_t
|
||||||
BFSAddOn::GetInitializationParameterEditor(const BMutablePartition* partition,
|
BFSAddOn::GetInitializationParameterEditor(const BMutablePartition* partition,
|
||||||
BPartitionParameterEditor** editor)
|
BPartitionParameterEditor** editor)
|
||||||
@@ -115,7 +110,6 @@ BFSAddOn::GetInitializationParameterEditor(const BMutablePartition* partition,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ValidateInitialize
|
|
||||||
status_t
|
status_t
|
||||||
BFSAddOn::ValidateInitialize(const BMutablePartition* partition, BString* name,
|
BFSAddOn::ValidateInitialize(const BMutablePartition* partition, BString* name,
|
||||||
const char* parameterString)
|
const char* parameterString)
|
||||||
@@ -142,7 +136,6 @@ BFSAddOn::ValidateInitialize(const BMutablePartition* partition, BString* name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initialize
|
|
||||||
status_t
|
status_t
|
||||||
BFSAddOn::Initialize(BMutablePartition* partition, const char* name,
|
BFSAddOn::Initialize(BMutablePartition* partition, const char* name,
|
||||||
const char* parameterString, BPartitionHandle** _handle)
|
const char* parameterString, BPartitionHandle** _handle)
|
||||||
@@ -219,10 +212,8 @@ BFSPartitionHandle::Repair(bool checkOnly)
|
|||||||
path.SetTo(&directory, ".");
|
path.SetTo(&directory, ".");
|
||||||
|
|
||||||
int fd = open(path.Path(), O_RDONLY);
|
int fd = open(path.Path(), O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0)
|
||||||
printf("chkbfs: error opening '.'\n");
|
|
||||||
return errno;
|
return errno;
|
||||||
}
|
|
||||||
|
|
||||||
struct check_control result;
|
struct check_control result;
|
||||||
memset(&result, 0, sizeof(result));
|
memset(&result, 0, sizeof(result));
|
||||||
@@ -235,10 +226,8 @@ BFSPartitionHandle::Repair(bool checkOnly)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// start checking
|
// start checking
|
||||||
if (ioctl(fd, BFS_IOCTL_START_CHECKING, &result, sizeof(result)) < 0) {
|
if (ioctl(fd, BFS_IOCTL_START_CHECKING, &result, sizeof(result)) < 0)
|
||||||
printf("chkbfs: error starting!\n");
|
|
||||||
return errno;
|
return errno;
|
||||||
}
|
|
||||||
|
|
||||||
off_t attributeDirectories = 0, attributes = 0;
|
off_t attributeDirectories = 0, attributes = 0;
|
||||||
off_t files = 0, directories = 0, indices = 0;
|
off_t files = 0, directories = 0, indices = 0;
|
||||||
@@ -278,8 +267,7 @@ BFSPartitionHandle::Repair(bool checkOnly)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// stop checking
|
// stop checking
|
||||||
if (ioctl(fd, BFS_IOCTL_STOP_CHECKING, &result, sizeof(result)) < 0)
|
ioctl(fd, BFS_IOCTL_STOP_CHECKING, &result, sizeof(result));
|
||||||
printf("chkbfs: error stopping!\n");
|
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
@@ -300,7 +288,6 @@ BFSPartitionHandle::Repair(bool checkOnly)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
// get_disk_system_add_ons
|
|
||||||
status_t
|
status_t
|
||||||
get_disk_system_add_ons(BList* addOns)
|
get_disk_system_add_ons(BList* addOns)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user