Data Structures | |
struct | mount_point_s |
Structure for holding mount point information. More... | |
Defines | |
#define | MOUNT_POINT_MAX 256 |
#define | MOUNT_POINT_STRING_SIZE 128 |
Functions | |
char * | block_compute_udi (HalDevice *d, int append_num) |
This function will compute the device uid based on other properties of the device. | |
void | visit_class_device_block_got_parent (HalDevice *parent, void *data1, void *data2) |
Callback when the parent is found or if there is no parent.. | |
void | visit_class_device_block (const char *path, struct sysfs_class_device *class_device) |
Visitor function for block device. | |
char * | strip_space (char *str) |
void | linux_class_block_check_if_ready_to_add (HalDevice *d) |
Check if all the required properties are in place so we can announce this device to the world. | |
void | etc_mtab_process_line (char *s) |
Process a line in /etc/mtab. | |
dbus_bool_t | read_etc_mtab (dbus_bool_t force) |
Reads /etc/mtab and fill out mount_points and num_mount_points variables accordingly. | |
void | sigio_handler (int sig) |
Signal handler for watching /etc. | |
void | etc_mtab_process_all_block_devices (dbus_bool_t force) |
Load /etc/mtab and process all HAL block devices and set properties according to mount status. | |
void | linux_class_block_init () |
Init function for block device handling. | |
void | force_unmount (HalDevice *d) |
Force unmount of a patition. | |
void | force_unmount_of_all_childs (HalDevice *d) |
Unmount all partitions that stems from this block device. | |
void | linux_class_block_removed (HalDevice *d) |
Called when this device is about to be removed. | |
dbus_bool_t | detect_media (HalDevice *d) |
Check for media on a block device that is not a volume. | |
gboolean | media_detect_timer_handler (gpointer data) |
Timeout handler for polling for media on block devices. | |
void | linux_class_block_detection_done () |
This function is called when all device detection on startup is done in order to perform optional batch processing on devices. | |
void | linux_class_block_shutdown () |
Shutdown function for block device handling. | |
Variables | |
mount_point_s | mount_points [MOUNT_POINT_MAX] |
Array holding (valid) mount points from /etc/mtab. | |
int | num_mount_points |
Number of elements in mount_points array. | |
int | etc_fd = -1 |
time_t | etc_mtab_mtime = 0 |
Last mtime when /etc/mtab was processed. | |
dbus_bool_t | have_setup_watcher = FALSE |
Global to see if we have setup the watcher on /etc. | |
dbus_bool_t | sigio_etc_changed = FALSE |
Will be set to true by the SIGIO handler. |
|
This function will compute the device uid based on other properties of the device. For block device it's simply block appended with the major and minor number
Definition at line 78 of file linux_class_block.c. References ds_property_get_int(), and HalDevice. Referenced by visit_class_device_block_got_parent(). |
|
Check for media on a block device that is not a volume.
Definition at line 1208 of file linux_class_block.c. References ds_device_destroy(), ds_device_find_by_key_value_string(), ds_device_merge(), ds_device_new(), ds_device_set_udi(), ds_gdl_add(), ds_property_exists(), ds_property_get_bool(), ds_property_get_string(), ds_property_set_bool(), ds_property_set_string(), force_unmount_of_all_childs(), HalDevice, HalDevice_s::in_gdl, and HalDevice_s::udi. Referenced by linux_class_block_check_if_ready_to_add(), and media_detect_timer_handler(). |
|
Load /etc/mtab and process all HAL block devices and set properties according to mount status. Also, optionally, sets up a watcher to do this whenever /etc/mtab changes
Definition at line 887 of file linux_class_block.c. References ds_device_iter_begin(), ds_device_iter_get(), ds_device_iter_has_more(), ds_device_iter_next(), ds_property_get_bool(), ds_property_get_int(), ds_property_get_string(), ds_property_set_bool(), ds_property_set_string(), emit_condition(), HalDevice, HalDeviceIterator, have_setup_watcher, mount_points, num_mount_points, property_atomic_update_begin(), property_atomic_update_end(), read_etc_mtab(), sigio_handler(), and HalDevice_s::udi. Referenced by linux_class_block_detection_done(), media_detect_timer_handler(), and visit_class_device_block_got_parent(). |
|
Process a line in /etc/mtab. The given string will be modifed by this function.
Definition at line 736 of file linux_class_block.c. References mount_point_s::major, mount_point_s::minor, mount_points, and num_mount_points. Referenced by read_etc_mtab(). |
|
Force unmount of a patition. Must have block.volume=1 and valid block.device
Definition at line 1052 of file linux_class_block.c. References ds_property_exists(), ds_property_get_bool(), ds_property_get_string(), ds_property_set_bool(), ds_property_set_string(), emit_condition(), HalDevice, property_atomic_update_begin(), and property_atomic_update_end(). Referenced by force_unmount_of_all_childs(), and linux_class_block_removed(). |
|
Unmount all partitions that stems from this block device. Must have block.is_volume==0
Definition at line 1129 of file linux_class_block.c. References ds_device_find_multiple_by_key_value_string(), ds_property_get_string(), emit_condition(), force_unmount(), HalDevice, and HalDevice_s::udi. Referenced by detect_media(), and linux_class_block_removed(). |
|
Check if all the required properties are in place so we can announce this device to the world.
Definition at line 556 of file linux_class_block.c. References detect_media(), ds_add_capability(), ds_gdl_add(), ds_property_get_bool(), ds_property_get_string(), ds_property_set_bool(), ds_property_set_int(), ds_property_set_string(), HalDevice, and HalDevice_s::udi. Referenced by handle_udev_node_created_found_device(), and visit_class_device_block_got_parent(). |
|
Called when this device is about to be removed.
Definition at line 1188 of file linux_class_block.c. References ds_property_exists(), ds_property_get_bool(), force_unmount(), force_unmount_of_all_childs(), and HalDevice. Referenced by handle_hotplug(). |
|
Timeout handler for polling for media on block devices.
Definition at line 1363 of file linux_class_block.c. References detect_media(), ds_device_iter_begin(), ds_device_iter_get(), ds_device_iter_has_more(), ds_device_iter_next(), etc_mtab_process_all_block_devices(), HalDevice, HalDeviceIterator, and sigio_etc_changed. Referenced by linux_class_block_detection_done(). |
|
Reads /etc/mtab and fill out mount_points and num_mount_points variables accordingly. This function holds the file open for further access
Definition at line 824 of file linux_class_block.c. References etc_mtab_mtime, etc_mtab_process_line(), and num_mount_points. Referenced by etc_mtab_process_all_block_devices(). |
|
Signal handler for watching /etc.
Definition at line 1028 of file linux_class_block.c. References sigio_etc_changed. Referenced by etc_mtab_process_all_block_devices(). |
|
Visitor function for block device. This function parses the attributes present and creates a new HAL device based on this information.
Definition at line 108 of file linux_class_block.c. References ds_add_capability(), ds_device_async_find_by_key_value_string(), ds_device_new(), ds_property_set_bool(), ds_property_set_int(), ds_property_set_string(), get_parent_sysfs_path(), HAL_LINUX_HOTPLUG_TIMEOUT, HalDevice, is_probing, parse_dec(), and visit_class_device_block_got_parent(). Referenced by visit_class_device(). |
|
Callback when the parent is found or if there is no parent.. This is where we get added to the GDL..
Definition at line 219 of file linux_class_block.c. References block_compute_udi(), ds_add_capability(), ds_device_destroy(), ds_device_find(), ds_property_exists(), ds_property_get_bool(), ds_property_get_string(), ds_property_set_bool(), ds_property_set_string(), etc_mtab_process_all_block_devices(), find_and_set_physical_device(), get_last_element(), HalDevice, HalDevice_s::in_gdl, is_probing, linux_class_block_check_if_ready_to_add(), parse_dec(), read_single_line(), rename_and_merge(), sysfs_mount_path, and HalDevice_s::udi. Referenced by visit_class_device_block(). |