From 619c170539295fe30c2c49c2541d43f3fb954500 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 27 Jul 2007 17:05:45 +0000 Subject: [PATCH] Some documentation. Courtesy of Jan Matejek. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21722 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/DiskDevice.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/kits/storage/DiskDevice.cpp b/src/kits/storage/DiskDevice.cpp index 3e9329eab1..76638e0831 100644 --- a/src/kits/storage/DiskDevice.cpp +++ b/src/kits/storage/DiskDevice.cpp @@ -41,6 +41,7 @@ BDiskDevice::BDiskDevice() */ BDiskDevice::~BDiskDevice() { + CancelModifications(); } // HasMedia @@ -179,6 +180,14 @@ BDiskDevice::IsModified() const } // PrepareModifications +/*! \brief Initializes the partition hierarchy for modifications. + * + * Subsequent modifications are performed on so-called \a shadow structure + * and not written to device until \ref CommitModifications is called. + * + * \note This call locks the device. You need to call \ref CommitModifications + * or \ref CancelModifications to unlock it. + */ status_t BDiskDevice::PrepareModifications() { @@ -202,6 +211,12 @@ BDiskDevice::PrepareModifications() } // CommitModifications +/*! \brief Commits modifications to device. + * + * Creates a set of jobs that perform all the changes done after + * \ref PrepareModifications. The changes are then written to device. + * Unlocks the device for further use. + */ status_t BDiskDevice::CommitModifications(bool synchronously, BMessenger progressMessenger, @@ -223,6 +238,10 @@ BDiskDevice::CommitModifications(bool synchronously, } // CancelModifications +/*! \brief Cancels all modifications performed on the device. + * + * Nothing is written on the device and it is unlocked for further use. + */ status_t BDiskDevice::CancelModifications() {