@ -223,6 +223,8 @@ status_t Disk::readMetadata() {
}
}
status_t Disk : : readPartitions ( ) {
status_t Disk : : readPartitions ( ) {
std : : lock_guard < std : : mutex > lock ( mLock ) ;
int8_t maxMinors = getMaxMinors ( ) ;
int8_t maxMinors = getMaxMinors ( ) ;
if ( maxMinors < 0 ) {
if ( maxMinors < 0 ) {
return - ENOTSUP ;
return - ENOTSUP ;
@ -311,6 +313,8 @@ status_t Disk::unmountAll() {
}
}
status_t Disk : : partitionPublic ( ) {
status_t Disk : : partitionPublic ( ) {
std : : lock_guard < std : : mutex > lock ( mLock ) ;
// TODO: improve this code
// TODO: improve this code
destroyAllVolumes ( ) ;
destroyAllVolumes ( ) ;
mJustPartitioned = true ;
mJustPartitioned = true ;
@ -357,6 +361,8 @@ status_t Disk::partitionPrivate() {
}
}
status_t Disk : : partitionMixed ( int8_t ratio ) {
status_t Disk : : partitionMixed ( int8_t ratio ) {
std : : lock_guard < std : : mutex > lock ( mLock ) ;
int res ;
int res ;
destroyAllVolumes ( ) ;
destroyAllVolumes ( ) ;