|
Data Structures |
struct | _AlpVolumeSvcsFSinfo |
| File System info block, AlpVolumesvcsFSinfo returns a GArray of these. More...
|
struct | _prv_slot |
struct | _prv_fsinfo |
Defines |
#define | ALP_STATUS_VOLUMESVCS_OK ALP_STATUS_OK |
| operation completed sucessfully
|
#define | ALP_STATUS_VOLUMESVCS_INVALID_PARAMETER ( ALP_CLASS_VOLUMESVCS | 0x01) |
| bad input
|
#define | ALP_STATUS_VOLUMESVCS_NOT_FOUND ( ALP_CLASS_VOLUMESVCS | 0x02) |
| target device or volume could not be found
|
#define | ALP_STATUS_VOLUMESVCS_DEVICE_BUSY ( ALP_CLASS_VOLUMESVCS | 0x03) |
| target device or bindmount could not be unmounted as it is in active use
|
#define | ALP_NOTIFY_EVENT_VOLUME_ADDED "/alp/volumesvcs/volume_added" |
| a card has been inserted and the volumes on it mounted
|
#define | ALP_NOTIFY_EVENT_VOLUME_REMOVED "/alp/volumesvcs/volume_removed" |
| a card with mounted volumes has been removed
|
#define | ALP_NOTIFY_EVENT_DEVICE_ADDED "/alp/volumesvcs/device_added" |
| a card has been inserted that is either blank or the file system on it ws not recognized
|
#define | ALP_NOTIFY_EVENT_DEVICE_REMOVED "/alp/volumesvcs/device_removed" |
| a card was removed that did not contain mounted file systems
|
#define | ALP_SYSTEM_SLOTS_PREFIX "/system/slots/" |
| the head of the tree for slot names
|
#define | ALP_SYSTEM_SLOTS_NAME "/name" |
| the name to be used for this slot
|
#define | ALP_SYSTEM_SLOTS_DEV_PATH "/dev_path" |
| the /dev/name to match against (may be incomplete /dev/mmcblk matches /dev/mmcblk0...)
|
#define | ALP_VOLUMESVCS_HIDEVOL_PATH ALP_EXT_SYSPATH_HIDDEN_VOL |
| if this exists the volume is not exposed to users
|
#define | ALP_VOLUMESVCS_FLAGS_BINDMOUNT 0x1 |
| entry represents a bind mount not necessarily a real device
|
#define | ALP_VOLUMESVCS_FLAGS_PARTITION 0x2 |
| entry represents a partition with or witout fs as opposed to an entire disk (disk are only shown if there are no partitions on them).
|
#define | ALP_VOLUMESVCS_FLAGS_HIDDEN 0x4 |
| entry represents an entry to be hidden from users
|
#define | TRACELEVEL 0 |
#define | MAX_TRACELEVEL 3 |
#define | ALP_VSTL(level, str,) |
#define | MEMCHECK(p) ALP_FAIL_FATAL_IF( p == NULL, "out of memory") |
#define | AisBsParent(a, b) ( a->sys_dev_path && b->sys_dev_path && !strncmp(a->sys_dev_path, b->sys_dev_path, strlen(a->sys_dev_path)) ) |
#define | MOUNTROOT "/media" |
#define | MOUNT_OPTIONS MS_NOATIME+MS_NODEV+MS_NOSUID+MS_SYNCHRONOUS |
#define | UMOUNT_OPTIONS MNT_FORCE |
#define | NOTIFY_TIMEOUT 0 |
#define | ACCESS_UDI_ROOT "/access/ALP/volumesvcs/" |
#define | FAT_IOCTL_SET_VOLUME_LABEL 0x40047215 |
#define | MSDOS_NAME 11 |
#define | EVENT_TIMEOUT 2000 |
Typedefs |
typedef char * | AlpNotifyEventVolumeAdded |
| notification detail for a volume added event
|
typedef char * | AlpNotifyEventVolumeRemoved |
| notification detail for a volume removed event
|
typedef char * | AlpNotifyEventDeviceAdded |
| notification detail for a device added event
|
typedef char * | AlpNotifyEventdeviceRemoved |
| notification detail for a device removed event
|
typedef _AlpVolumeSvcsFSinfo | AlpVolumeSvcsFSinfo |
| File System info block, AlpVolumesvcsFSinfo returns a GArray of these.
|
typedef _prv_slot | prv_slot_t |
typedef _prv_fsinfo | prv_fsinfo_t |
Functions |
alp_status_t | alp_volumesvcs_fsinfo_array (GArray **fsinfo_array) |
| Get information on all pluggable devices and any mounted file systems on them.
|
alp_status_t | alp_volumesvcs_fsinfo_for_udi (AlpVolumeSvcsFSinfo **fsinfo, const gchar *udi) |
| Allocates and returns an AlpVolumeSvcsFSinfo* matching the _udi parameter passed in.
|
alp_status_t | alp_volumesvcs_fsinfo_array_free (GArray *fsinfo_array) |
| Free the array of AlpVolumeSvcsFSinfo struct's.
|
alp_status_t | alp_volumesvcs_fsinfo_free (AlpVolumeSvcsFSinfo *fsinfo) |
| Frees AlpVolumeSvcsFSinfo* allocated by alp_volumesvcs_fsinfo_for_udi().
|
alp_status_t | alp_volumesvcs_mount (const gchar *device_udi) |
| Mount a volume.
|
alp_status_t | alp_volumesvcs_umount (const gchar *device_udi) |
| UNmount a volume.
|
alp_status_t | alp_volumesvcs_fstypes (GPtrArray **fstypes) |
| return a list of filesystem types that may be used as input to alp_volumesvcs_makefs Other formats MAY be supported for mounting a pre-formated volume, but only these may be used to format a volume ON the ALP device.
|
alp_status_t | alp_volumesvcs_makefs (const gchar *device_udi, const gchar *name, const gchar *fstype) |
| Initialzie a volume, Create a 1 part partition table and make a msdos file system in it.
|
alp_status_t | alp_volumesvcs_bind (const gchar *name, const gchar *path) |
| Mount a directory as if it were a file system (bind mounts) This entry will be assgined a udi which may be looked up in fsinfo and explicitly umounted but the entry can not be removed until the volumesvcsd server is restarted.
|
alp_status_t | alp_volumesvcs_rename_volume (const char *udi, const gchar *name) |
| Reanme a volume. The volume name (part of the vfat format) is changed. The volume can be mounted or unmounted when the call is made. If mounted it will be UNmounted as part of the call. The renamed volume is always mounted on return from this call (barrying errors that prevent such).
|
alp_status_t | alp_volumesvcs_bind (const gchar *name, const char *path) |
| Mount a dir as if it was a device.
|
alp_status_t | alp_volumesvcs_rename_volume (const gchar *udi, const char *name) |
| rename a volume
|
bool | prv_mount (prv_fsinfo_t *entry) |
| mount a device entry turning it into a volume entry
|
bool | prv_umount (prv_fsinfo_t *entry) |
| umount a volume turning it back into a device, which usually was just ejected
|
bool | prv_bind_mount (gchar *name, gchar *path) |
bool | prv_rename (prv_fsinfo_t *entry, const gchar *name) |
bool | prv_makefs (prv_fsinfo_t *entry, const gchar *name, const gchar *fstype) |
void | prv_dump (int level) |
| dump out a trace of our current view of the mounted volumes & devices
|
void | prv_device_add (prv_fsinfo_t *new_entry) |
| addition of a device
|
void | prv_device_remove (prv_fsinfo_t *entry) |
| callback for the removal of a device
|
prv_fsinfo_t * | prv_entry_match (const gchar *udi, bool allocate) |
| see if we have an existing entry that matches the passed udi
|
void | prv_init_rpc () |
bool | prv_rename (prv_fsinfo_t *entry, gchar *name) |
| rename a volume
|
void | prv_empty_entry (prv_fsinfo_t *entry) |
| , free the contents of an entry
|
void | prv_entry_remove (prv_fsinfo_t *entry) |
| remove an entry from the internal table,
|
gboolean | prv_timeout_cb (gpointer flag) |
int | main (int argc, char **argv) |
Variables |
int | gtracelevel |
GArray * | gfsinfo |
GArray * | gslots |
GPtrArray * | gfstypes |
int | gtracelevel = TRACELEVEL |
GArray * | gfsinfo |
GPtrArray * | gfstypes |
GArray * | gslots |