diff options
Diffstat (limited to 'vold/volmgr.h')
-rw-r--r-- | vold/volmgr.h | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/vold/volmgr.h b/vold/volmgr.h index a7f5701..2c7ec50 100644 --- a/vold/volmgr.h +++ b/vold/volmgr.h @@ -23,6 +23,7 @@ #include "vold.h" #include "blkdev.h" #include "media.h" +#include "devmapper.h" #define PROP_EXTERNAL_STORAGE_STATE "EXTERNAL_STORAGE_STATE" @@ -70,15 +71,18 @@ typedef enum volume_state { volstate_ejecting, #define VOLD_EVT_EJECTING "volume_ejecting:" #define VOLD_ES_PVAL_EJECTING "ejecting" + + volstate_formatting, } volume_state_t; struct volume; struct volmgr_fstable_entry { char *name; - int (*identify_fn) (blkdev_t *dev); - int (*check_fn) (blkdev_t *dev); - int (*mount_fn) (blkdev_t *dev, struct volume *vol); + int (*identify_fn) (blkdev_t *dev); + int (*check_fn) (blkdev_t *dev); + int (*mount_fn) (blkdev_t *dev, struct volume *vol, boolean safe_mode); + boolean case_sensitive_paths; }; struct volmgr_start_args { @@ -86,21 +90,35 @@ struct volmgr_start_args { blkdev_t *dev; }; +struct volmgr_reaper_args { + void (*cb) (struct volume *, void *); + void *cb_arg; +}; + +#define VOLMGR_MAX_MEDIAPATHS_PER_VOLUME 8 + typedef struct volume { - char *media_path; - media_type_t media_type; - char *mount_point; - char *ums_path; + char *media_paths[VOLMGR_MAX_MEDIAPATHS_PER_VOLUME]; + + media_type_t media_type; + char *mount_point; + char *ums_path; + struct devmapping *dm; pthread_mutex_t lock; volume_state_t state; blkdev_t *dev; pid_t worker_pid; pthread_t worker_thread; - struct volmgr_start_args worker_args; + union { + struct volmgr_start_args start_args; + struct volmgr_reaper_args reaper_args; + } worker_args; boolean worker_running; pthread_mutex_t worker_sem; + struct volmgr_fstable_entry *fs; + struct volume *next; } volume_t; @@ -110,6 +128,8 @@ int volmgr_send_states(void); int volmgr_enable_ums(boolean enable); int volmgr_stop_volume_by_mountpoint(char *mount_point); int volmgr_start_volume_by_mountpoint(char *mount_point); - +int volmgr_safe_mode(boolean enable); +int volmgr_format_volume(char *mount_point); +int volmgr_set_volume_key(char *mount_point, unsigned char *key); void KillProcessesWithOpenFiles(const char* mountPoint, boolean sigkill, int *excluded, int num_excluded); #endif |