2003-06-10 03:04:54 +04:00
|
|
|
// ddm_userland_interface.h
|
|
|
|
|
|
|
|
#ifndef _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H
|
|
|
|
#define _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H
|
|
|
|
|
2003-07-07 02:56:39 +04:00
|
|
|
#include <OS.h>
|
|
|
|
|
2004-10-29 05:33:59 +04:00
|
|
|
#include <storage/DiskDeviceDefs.h>
|
|
|
|
|
2005-05-23 21:15:56 +04:00
|
|
|
#include <disk_device_manager.h>
|
2004-10-29 05:33:59 +04:00
|
|
|
|
2003-07-07 02:56:39 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2003-06-10 03:04:54 +04:00
|
|
|
|
|
|
|
// userland partition representation
|
2004-10-29 05:33:59 +04:00
|
|
|
typedef struct user_partition_data user_partition_data;
|
2003-06-10 03:04:54 +04:00
|
|
|
struct user_partition_data {
|
|
|
|
partition_id id;
|
2003-07-15 05:10:32 +04:00
|
|
|
partition_id shadow_id;
|
2003-06-10 03:04:54 +04:00
|
|
|
off_t offset;
|
|
|
|
off_t size;
|
2003-07-30 04:24:22 +04:00
|
|
|
off_t content_size;
|
2003-06-10 03:04:54 +04:00
|
|
|
uint32 block_size;
|
|
|
|
uint32 status;
|
|
|
|
uint32 flags;
|
|
|
|
dev_t volume;
|
2003-07-07 02:56:39 +04:00
|
|
|
int32 index;
|
2003-06-10 03:04:54 +04:00
|
|
|
int32 change_counter; // needed?
|
2003-06-23 03:10:01 +04:00
|
|
|
disk_system_id disk_system;
|
2003-06-10 03:04:54 +04:00
|
|
|
char *name;
|
|
|
|
char *content_name;
|
|
|
|
char *type;
|
|
|
|
char *content_type;
|
|
|
|
char *parameters;
|
|
|
|
char *content_parameters;
|
|
|
|
void *user_data;
|
|
|
|
int32 child_count;
|
|
|
|
user_partition_data *children[1];
|
|
|
|
};
|
|
|
|
|
|
|
|
// userland disk device representation
|
2004-10-29 05:33:59 +04:00
|
|
|
typedef struct user_disk_device_data {
|
2003-06-10 03:04:54 +04:00
|
|
|
uint32 device_flags;
|
|
|
|
char *path;
|
|
|
|
user_partition_data device_partition_data;
|
2004-10-29 05:33:59 +04:00
|
|
|
} user_disk_device_data;
|
2003-06-10 03:04:54 +04:00
|
|
|
|
2003-07-09 03:45:53 +04:00
|
|
|
// userland partitionable space representation
|
2004-10-29 05:33:59 +04:00
|
|
|
typedef struct user_disk_system_info {
|
2003-07-09 03:45:53 +04:00
|
|
|
disk_system_id id;
|
|
|
|
char name[B_FILE_NAME_LENGTH]; // better B_PATH_NAME_LENGTH?
|
|
|
|
char pretty_name[B_OS_NAME_LENGTH];
|
2003-07-18 22:41:21 +04:00
|
|
|
uint32 flags;
|
2004-10-29 05:33:59 +04:00
|
|
|
} user_disk_system_info;
|
2003-07-09 03:45:53 +04:00
|
|
|
|
2003-06-10 03:04:54 +04:00
|
|
|
// userland disk device job representation
|
2004-10-29 05:33:59 +04:00
|
|
|
typedef struct user_disk_device_job_info {
|
2003-06-10 03:04:54 +04:00
|
|
|
disk_job_id id;
|
|
|
|
uint32 type;
|
|
|
|
partition_id partition;
|
2003-07-30 04:24:22 +04:00
|
|
|
char description[256];
|
2004-10-29 05:33:59 +04:00
|
|
|
} user_disk_device_job_info;
|
|
|
|
|
|
|
|
|
|
|
|
/*! Syscalls entries */
|
2003-06-10 03:04:54 +04:00
|
|
|
|
|
|
|
// iterating, retrieving device/partition data
|
2004-10-29 05:33:59 +04:00
|
|
|
partition_id _user_get_next_disk_device_id(int32 *cookie, size_t *neededSize);
|
|
|
|
partition_id _user_find_disk_device(const char *filename, size_t *neededSize);
|
|
|
|
partition_id _user_find_partition(const char *filename, size_t *neededSize);
|
|
|
|
status_t _user_get_disk_device_data(partition_id deviceID, bool deviceOnly,
|
2003-07-15 05:10:32 +04:00
|
|
|
bool shadow, user_disk_device_data *buffer,
|
2003-07-07 02:56:39 +04:00
|
|
|
size_t bufferSize, size_t *neededSize);
|
2003-06-10 03:04:54 +04:00
|
|
|
|
2004-10-29 05:33:59 +04:00
|
|
|
partition_id _user_register_file_device(const char *filename);
|
|
|
|
status_t _user_unregister_file_device(partition_id deviceID,
|
2003-07-15 05:10:32 +04:00
|
|
|
const char *filename);
|
|
|
|
// Only a valid deviceID or filename need to be passed. The other one
|
|
|
|
// is -1/NULL. If both is given only filename is ignored.
|
|
|
|
|
2003-07-09 03:45:53 +04:00
|
|
|
// disk systems
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_disk_system_info(disk_system_id id,
|
2003-07-09 03:45:53 +04:00
|
|
|
user_disk_system_info *info);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_next_disk_system_info(int32 *cookie,
|
2003-07-09 03:45:53 +04:00
|
|
|
user_disk_system_info *info);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_find_disk_system(const char *name, user_disk_system_info *info);
|
2003-07-09 03:45:53 +04:00
|
|
|
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_defragmenting_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-16 01:42:59 +04:00
|
|
|
bool *whileMounted);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_repairing_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter, bool checkOnly,
|
|
|
|
bool *whileMounted);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_resizing_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-20 00:37:00 +04:00
|
|
|
bool *canResizeContents,
|
2003-07-16 01:42:59 +04:00
|
|
|
bool *whileMounted);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_moving_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-21 18:17:03 +04:00
|
|
|
partition_id *unmovable,
|
|
|
|
partition_id *needUnmounting,
|
|
|
|
size_t bufferSize);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_setting_partition_name(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_setting_partition_content_name(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-16 01:42:59 +04:00
|
|
|
bool *whileMounted);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_setting_partition_type(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_setting_partition_parameters(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_setting_partition_content_parameters(
|
2003-07-22 04:11:03 +04:00
|
|
|
partition_id partitionID, int32 changeCounter, bool *whileMounted);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_initializing_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-20 00:37:00 +04:00
|
|
|
const char *diskSystemName);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_creating_child_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_supports_deleting_child_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
bool _user_is_sub_disk_system_for(disk_system_id diskSystemID,
|
2003-07-22 04:11:03 +04:00
|
|
|
partition_id partitionID,
|
|
|
|
int32 changeCounter);
|
2003-07-17 01:01:14 +04:00
|
|
|
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_resize_partition(partition_id partitionID,
|
2003-09-22 01:26:12 +04:00
|
|
|
int32 changeCounter, off_t *size);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_move_partition(partition_id partitionID,
|
2003-09-22 01:26:12 +04:00
|
|
|
int32 changeCounter, off_t *newOffset);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_set_partition_name(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter, char *name);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_set_partition_content_name(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-17 01:01:14 +04:00
|
|
|
char *name);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_set_partition_type(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-17 01:01:14 +04:00
|
|
|
const char *type);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_initialize_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-20 00:37:00 +04:00
|
|
|
const char *diskSystemName,
|
2003-07-17 04:04:22 +04:00
|
|
|
char *name,
|
2003-10-25 12:36:17 +04:00
|
|
|
const char *parameters,
|
|
|
|
size_t parametersSize);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_validate_create_child_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-17 01:01:14 +04:00
|
|
|
off_t *offset, off_t *size,
|
|
|
|
const char *type,
|
2003-10-25 12:36:17 +04:00
|
|
|
const char *parameters,
|
|
|
|
size_t parametersSize);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_partitionable_spaces(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-20 21:18:48 +04:00
|
|
|
partitionable_space_data *buffer,
|
|
|
|
int32 count, int32 *actualCount);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_next_supported_partition_type(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-17 01:01:14 +04:00
|
|
|
int32 *cookie, char *type);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_partition_type_for_content_type(disk_system_id diskSystemID,
|
2003-07-17 01:01:14 +04:00
|
|
|
const char *contentType,
|
|
|
|
char *type);
|
2003-07-15 05:10:32 +04:00
|
|
|
|
|
|
|
// disk device modification
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_prepare_disk_device_modifications(partition_id deviceID);
|
|
|
|
status_t _user_commit_disk_device_modifications(partition_id deviceID,
|
2003-07-15 05:10:32 +04:00
|
|
|
port_id port, int32 token,
|
|
|
|
bool completeProgress);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_cancel_disk_device_modifications(partition_id deviceID);
|
|
|
|
bool _user_is_disk_device_modified(partition_id deviceID);
|
2003-07-15 05:10:32 +04:00
|
|
|
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_defragment_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_repair_partition(partition_id partitionID, int32 changeCounter,
|
2003-07-22 04:11:03 +04:00
|
|
|
bool checkOnly);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_resize_partition(partition_id partitionID, int32 changeCounter,
|
2003-09-22 01:26:12 +04:00
|
|
|
off_t size);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_move_partition(partition_id partitionID, int32 changeCounter,
|
2003-09-22 01:26:12 +04:00
|
|
|
off_t newOffset);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_set_partition_name(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter, const char *name);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_set_partition_content_name(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-21 02:39:37 +04:00
|
|
|
const char *name);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_set_partition_type(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter, const char *type);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_set_partition_parameters(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-10-25 12:36:17 +04:00
|
|
|
const char *parameters,
|
|
|
|
size_t parametersSize);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_set_partition_content_parameters(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-10-25 12:36:17 +04:00
|
|
|
const char *parameters,
|
|
|
|
size_t parametersSize);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_initialize_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter,
|
2003-07-25 02:58:06 +04:00
|
|
|
const char *diskSystemName,
|
2003-10-25 12:36:17 +04:00
|
|
|
const char *name, const char *parameters,
|
|
|
|
size_t parametersSize);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_uninitialize_partition(partition_id partitionID,
|
2003-09-21 23:13:54 +04:00
|
|
|
int32 changeCounter);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_create_child_partition(partition_id partitionID,
|
2003-07-22 04:11:03 +04:00
|
|
|
int32 changeCounter, off_t offset,
|
|
|
|
off_t size, const char *type,
|
|
|
|
const char *parameters,
|
2003-10-25 12:36:17 +04:00
|
|
|
size_t parametersSize,
|
2003-07-25 02:58:06 +04:00
|
|
|
partition_id *childID);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_delete_partition(partition_id partitionID, int32 changeCounter);
|
2003-06-10 03:04:54 +04:00
|
|
|
|
|
|
|
// jobs
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_next_disk_device_job_info(int32 *cookie,
|
2003-07-30 21:48:08 +04:00
|
|
|
user_disk_device_job_info *info);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_disk_device_job_info(disk_job_id id,
|
2003-07-30 21:48:08 +04:00
|
|
|
user_disk_device_job_info *info);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_get_disk_device_job_progress_info(disk_job_id id,
|
2003-07-30 21:48:08 +04:00
|
|
|
disk_device_job_progress_info *info);
|
2004-10-29 05:33:59 +04:00
|
|
|
status_t _user_pause_disk_device_job(disk_job_id id);
|
|
|
|
status_t _user_cancel_disk_device_job(disk_job_id id, bool reverse);
|
2003-07-07 02:56:39 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-06-10 03:04:54 +04:00
|
|
|
#endif // _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H
|