@ -39,7 +39,7 @@
# include <dirent.h>
# include <dirent.h>
# include <fs_mgr.h>
# include <fs_mgr.h>
static int process_config ( VolumeManager * vm , bool * has_adoptable );
static int process_config ( VolumeManager * vm , bool * has_adoptable , bool * has_quota );
static void coldboot ( const char * path ) ;
static void coldboot ( const char * path ) ;
static void parse_args ( int argc , char * * argv ) ;
static void parse_args ( int argc , char * * argv ) ;
@ -107,8 +107,9 @@ int main(int argc, char** argv) {
}
}
bool has_adoptable ;
bool has_adoptable ;
bool has_quota ;
if ( process_config ( vm , & has_adoptable )) {
if ( process_config ( vm , & has_adoptable , & has_quota )) {
PLOG ( ERROR ) < < " Error reading configuration... continuing anyways " ;
PLOG ( ERROR ) < < " Error reading configuration... continuing anyways " ;
}
}
@ -133,6 +134,7 @@ int main(int argc, char** argv) {
// This call should go after listeners are started to avoid
// This call should go after listeners are started to avoid
// a deadlock between vold and init (see b/34278978 for details)
// a deadlock between vold and init (see b/34278978 for details)
property_set ( " vold.has_adoptable " , has_adoptable ? " 1 " : " 0 " ) ;
property_set ( " vold.has_adoptable " , has_adoptable ? " 1 " : " 0 " ) ;
property_set ( " vold.has_quota " , has_quota ? " 1 " : " 0 " ) ;
// Do coldboot here so it won't block booting,
// Do coldboot here so it won't block booting,
// also the cold boot is needed in case we have flash drive
// also the cold boot is needed in case we have flash drive
@ -214,7 +216,7 @@ static void coldboot(const char *path) {
}
}
}
}
static int process_config ( VolumeManager * vm , bool * has_adoptable ) {
static int process_config ( VolumeManager * vm , bool * has_adoptable , bool * has_quota ) {
fstab = fs_mgr_read_fstab_default ( ) ;
fstab = fs_mgr_read_fstab_default ( ) ;
if ( ! fstab ) {
if ( ! fstab ) {
PLOG ( ERROR ) < < " Failed to open default fstab " ;
PLOG ( ERROR ) < < " Failed to open default fstab " ;
@ -223,7 +225,12 @@ static int process_config(VolumeManager *vm, bool* has_adoptable) {
/* Loop through entries looking for ones that vold manages */
/* Loop through entries looking for ones that vold manages */
* has_adoptable = false ;
* has_adoptable = false ;
* has_quota = false ;
for ( int i = 0 ; i < fstab - > num_entries ; i + + ) {
for ( int i = 0 ; i < fstab - > num_entries ; i + + ) {
if ( fs_mgr_is_quota ( & fstab - > recs [ i ] ) ) {
* has_quota = true ;
}
if ( fs_mgr_is_voldmanaged ( & fstab - > recs [ i ] ) ) {
if ( fs_mgr_is_voldmanaged ( & fstab - > recs [ i ] ) ) {
if ( fs_mgr_is_nonremovable ( & fstab - > recs [ i ] ) ) {
if ( fs_mgr_is_nonremovable ( & fstab - > recs [ i ] ) ) {
LOG ( WARNING ) < < " nonremovable no longer supported; ignoring volume " ;
LOG ( WARNING ) < < " nonremovable no longer supported; ignoring volume " ;