xref: /haiku/src/kits/storage/disk_device/jobs/UninitializeJob.cpp (revision 7d6915b4d08ffe728cd38af02843d5e98ddfe0db)
1 /*
2  * Copyright 2007, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include "UninitializeJob.h"
7 
8 #include <syscalls.h>
9 
10 #include "PartitionReference.h"
11 
12 
13 // constructor
14 UninitializeJob::UninitializeJob(PartitionReference* partition)
15 	: DiskDeviceJob(partition)
16 {
17 }
18 
19 
20 // destructor
21 UninitializeJob::~UninitializeJob()
22 {
23 }
24 
25 
26 // Do
27 status_t
28 UninitializeJob::Do()
29 {
30 	int32 changeCounter = fPartition->ChangeCounter();
31 	status_t error = _kern_uninitialize_partition(fPartition->PartitionID(),
32 		&changeCounter);
33 
34 	if (error != B_OK)
35 		return error;
36 
37 	fPartition->SetChangeCounter(changeCounter);
38 
39 	return B_OK;
40 }
41 
42