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