Some fixes of/changes to the API. Shortened names where possible.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4030 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2003-07-20 17:17:00 +00:00
parent 2a596c013a
commit 3ee6c178d5
3 changed files with 187 additions and 209 deletions

View File

@ -25,16 +25,15 @@ typedef void (*partition_free_partition_content_cookie)(
// querying
// (the device is read locked)
typedef bool (*partition_supports_reparing_partition)(
partition_data *partition, bool checkOnly, bool *whileMounted);
typedef bool (*partition_supports_resizing_partition)(
partition_data *partition, bool *whileMounted);
typedef bool (*partition_supports_resizing_child_partition)(
partition_data *partition, partition_data *child);
typedef bool (*partition_supports_moving_partition)(partition_data *partition,
bool *whileMounted);
typedef bool (*partition_supports_moving_child_partition)(
partition_data *partition, partition_data *child);
typedef bool (*partition_supports_repairing)(partition_data *partition,
bool checkOnly);
typedef bool (*partition_supports_resizing)(partition_data *partition);
typedef bool (*partition_supports_resizing_child)(partition_data *partition,
partition_data *child);
typedef bool (*partition_supports_moving)(partition_data *partition,
bool *isNoOp);
typedef bool (*partition_supports_moving_child)(partition_data *partition,
partition_data *child);
typedef bool (*partition_supports_setting_name)(partition_data *partition);
typedef bool (*partition_supports_setting_content_name)(
partition_data *partition);
@ -43,80 +42,78 @@ typedef bool (*partition_supports_setting_parameters)(
partition_data *partition);
typedef bool (*partition_supports_setting_content_parameters)(
partition_data *partition);
typedef bool (*partition_supports_initializing_partition)(
partition_data *partition);
typedef bool (*partition_supports_initializing_child_partition)(
typedef bool (*partition_supports_initializing)(partition_data *partition);
typedef bool (*partition_supports_initializing_child)(
partition_data *partition, const char *system);
typedef bool (*partition_supports_creating_child_partition)(
partition_data *partition);
typedef bool (*partition_supports_deleting_child_partition)(
partition_data *partition, partition_data *child);
typedef bool (*partition_supports_creating_child)(partition_data *partition);
typedef bool (*partition_supports_deleting_child)(partition_data *partition,
partition_data *child);
typedef bool (*partition_is_sub_system_for)(partition_data *partition);
typedef bool (*partition_validate_resize_partition)(partition_data *partition,
typedef bool (*partition_validate_resize)(partition_data *partition,
off_t *size);
typedef bool (*partition_validate_move_partition)(partition_data *partition,
typedef bool (*partition_validate_move)(partition_data *partition,
off_t *start);
typedef bool (*partition_validate_resize_child_partition)(
partition_data *partition, partition_data *child, off_t *size);
typedef bool (*partition_validate_move_child_partition)(
partition_data *partition, partition_data *child, off_t *start);
typedef bool (*partition_validate_resize_child)(partition_data *partition,
partition_data *child, off_t *size);
typedef bool (*partition_validate_move_child)(partition_data *partition,
partition_data *child, off_t *start);
typedef bool (*partition_validate_set_name)(partition_data *partition,
char *name);
typedef bool (*partition_validate_set_content_name)(partition_data *partition,
char *name);
typedef bool (*partition_validate_set_type)(partition_data *partition,
const char *type);
typedef bool (*partition_validate_set_partition_parameters)(
typedef bool (*partition_validate_set_parameters)(partition_data *partition,
const char *parameters);
typedef bool (*partition_validate_set_content_parameters)(
partition_data *partition, const char *parameters);
typedef bool (*partition_validate_set_partition_content_parameters)(
partition_data *partition, const char *parameters);
typedef bool (*partition_validate_initialize_partition)(
partition_data *partition, char *name, const char *parameters);
typedef bool (*partition_validate_create_child_partition)(
partition_data *partition, partition_data *child, off_t *start,
off_t *size, const char *type, const char *parameters);
typedef bool (*partition_get_partitionable_spaces)(partition_data *partition,
partitionable_space_data *spaces, int32 count, int32 *actualCount);
typedef bool (*partition_validate_initialize)(partition_data *partition,
char *name, const char *parameters);
typedef bool (*partition_validate_create_child)(partition_data *partition,
off_t *start, off_t *size, const char *type,
const char *parameters);
typedef status_t (*partition_get_partitionable_spaces)(
partition_data *partition, partitionable_space_data *buffer, int32 count,
int32 *actualCount);
// When not implemented, a standard algorithm is used.
typedef status_t (*partition_get_next_supported_type)(
partition_data *partition, int32 *cookie, char *type);
typedef status_t (*partition_get_type_for_content_type)(
partition_data *partition, const char *contentType, char *type);
const char *contentType, char *type);
// writing
// (device is NOT locked)
typedef status_t (*partition_repair_partition)(int fd,
partition_id partition, bool checkOnly, disk_job_id job);
typedef status_t (*partition_resize_partition)(int fd,
partition_id partition, off_t size, disk_job_id job);
typedef status_t (*partition_resize_child_partition)(int fd,
partition_id partition, off_t size, disk_job_id job);
typedef status_t (*partition_move_partition)(int fd,
partition_id partition, off_t offset, disk_job_id job);
typedef status_t (*partition_move_child_partition)(int fd,
partition_id partition, partition_id child, off_t offset, disk_job_id job);
typedef status_t (*partition_repair)(int fd, partition_id partition,
bool checkOnly, disk_job_id job);
typedef status_t (*partition_resize)(int fd, partition_id partition,
off_t size, disk_job_id job);
typedef status_t (*partition_resize_child)(int fd, partition_id partition,
off_t size, disk_job_id job);
typedef status_t (*partition_move)(int fd, partition_id partition,
off_t offset, disk_job_id job);
typedef status_t (*partition_move_child)(int fd, partition_id partition,
partition_id child, off_t offset, disk_job_id job);
typedef status_t (*partition_set_name)(int fd, partition_id partition,
const char *name, disk_job_id job);
typedef status_t (*partition_set_content_name)(int fd, partition_id partition,
const char *name, disk_job_id job);
typedef status_t (*partition_set_type)(int fd, partition_id partition,
const char *type, disk_job_id job);
typedef status_t (*partition_set_parameters_partition)(int fd,
typedef status_t (*partition_set_parameters)(int fd, partition_id partition,
const char *parameters, disk_job_id job);
typedef status_t (*partition_set_content_parameters)(int fd,
partition_id partition, const char *parameters, disk_job_id job);
typedef status_t (*partition_set_partition_content_parameters)(int fd,
partition_id partition, const char *parameters, disk_job_id job);
typedef status_t (*partition_initialize_partition)(int fd,
partition_id partition, const char *name, const char *parameters,
disk_job_id job);
typedef status_t (*partition_create_child_partition)(int fd,
partition_id partition, off_t offset, off_t size, const char *type,
const char *parameters, disk_job_id job, partition_id *childID);
typedef status_t (*partition_initialize)(int fd, partition_id partition,
const char *name, const char *parameters, disk_job_id job);
typedef status_t (*partition_create_child)(int fd, partition_id partition,
off_t offset, off_t size, const char *type, const char *parameters,
disk_job_id job, partition_id *childID);
// childID is used for the return value, but is also an optional input
// parameter -- -1 to be ignored
typedef status_t (*partition_delete_child_partition)(int fd,
partition_id partition, partition_id child, disk_job_id job);
typedef status_t (*partition_delete_child)(int fd, partition_id partition,
partition_id child, disk_job_id job);
typedef struct partition_module_info {
module_info module;
@ -131,63 +128,53 @@ typedef struct partition_module_info {
partition_free_partition_content_cookie free_partition_content_cookie;
// querying
partition_supports_reparing_partition supports_reparing_partition;
partition_supports_resizing_partition supports_resizing_partition;
partition_supports_resizing_child_partition
supports_resizing_child_partition;
partition_supports_moving_partition supports_moving_partition;
partition_supports_moving_child_partition
supports_moving_child_partition;
partition_supports_repairing supports_repairing;
partition_supports_resizing supports_resizing;
partition_supports_resizing_child supports_resizing_child;
partition_supports_moving supports_moving;
partition_supports_moving_child supports_moving_child;
partition_supports_setting_name supports_setting_name;
partition_supports_setting_content_name supports_setting_content_name;
partition_supports_setting_type supports_setting_type;
partition_supports_setting_parameters supports_setting_parameters;
partition_supports_setting_content_parameters
supports_setting_content_parameters;
partition_supports_initializing_partition
supports_initializing_partition;
partition_supports_initializing_child_partition
supports_initializing_child_partition;
partition_supports_creating_child_partition
supports_creating_child_partition;
partition_supports_deleting_child_partition
supports_deleting_child_partition;
partition_supports_initializing supports_initializing;
partition_supports_initializing_child supports_initializing_child;
partition_supports_creating_child supports_creating_child;
partition_supports_deleting_child supports_deleting_child;
partition_is_sub_system_for is_sub_system_for;
partition_validate_resize_partition validate_resize_partition;
partition_validate_resize_child_partition
validate_resize_child_partition;
partition_validate_move_partition validate_move_partition;
partition_validate_move_child_partition validate_move_child_partition;
partition_validate_resize validate_resize;
partition_validate_resize_child validate_resize_child;
partition_validate_move validate_move;
partition_validate_move_child validate_move_child;
partition_validate_set_name validate_set_name;
partition_validate_set_content_name validate_set_content_name;
partition_validate_set_type validate_set_type;
partition_validate_set_partition_parameters
validate_set_partition_parameters;
partition_validate_set_partition_content_parameters
validate_set_partition_content_parameters;
partition_validate_initialize_partition validate_initialize_partition;
partition_validate_create_child_partition
validate_create_child_partition;
partition_validate_set_parameters validate_set_parameters;
partition_validate_set_content_parameters
validate_set_content_parameters;
partition_validate_initialize validate_initialize;
partition_validate_create_child validate_create_child;
partition_get_partitionable_spaces get_partitionable_spaces;
partition_get_next_supported_type get_next_supported_type;
partition_get_type_for_content_type get_type_for_content_type;
// writing
partition_repair_partition repair_partition;
partition_resize_partition resize_partition;
partition_resize_child_partition resize_child_partition;
partition_move_partition move_partition;
partition_move_child_partition move_child_partition;
partition_repair repair;
partition_resize resize;
partition_resize_child resize_child;
partition_move move;
partition_move_child move_child;
partition_set_name set_name;
partition_set_content_name set_content_name;
partition_set_type set_type;
partition_set_parameters_partition set_parameters_partition;
partition_set_partition_content_parameters
set_partition_content_parameters;
partition_initialize_partition initialize_partition;
partition_create_child_partition create_child_partition;
partition_delete_child_partition delete_child_partition;
partition_set_parameters set_parameters;
partition_set_content_parameters set_content_parameters;
partition_initialize initialize;
partition_create_child create_child;
partition_delete_child delete_child;
} partition_module_info;
@ -205,48 +192,44 @@ typedef void (*fs_free_partition_content_cookie)(partition_data *partition);
// querying
// (the device is read locked)
typedef bool (*fs_supports_defragmenting_partition)(partition_data *partition,
typedef bool (*fs_supports_defragmenting)(partition_data *partition,
bool *whileMounted);
typedef bool (*fs_supports_reparing_partition)(partition_data *partition,
typedef bool (*fs_supports_repairing)(partition_data *partition,
bool checkOnly, bool *whileMounted);
typedef bool (*fs_supports_resizing_partition)(partition_data *partition,
typedef bool (*fs_supports_resizing)(partition_data *partition,
bool *whileMounted);
typedef bool (*fs_supports_moving_partition)(partition_data *partition,
bool *isNoOp);
typedef bool (*fs_supports_moving)(partition_data *partition, bool *isNoOp);
typedef bool (*fs_supports_setting_content_name)(partition_data *partition,
bool *whileMounted);
typedef bool (*fs_supports_setting_content_parameters)(
partition_data *partition, bool *whileMounted);
typedef bool (*fs_supports_initializing_partition)(partition_data *partition);
typedef bool (*fs_is_sub_system_for)(partition_data *partition);
typedef bool (*fs_supports_initializing)(partition_data *partition);
typedef bool (*fs_validate_resize_partition)(partition_data *partition,
off_t *size);
typedef bool (*fs_validate_move_partition)(partition_data *partition,
off_t *start);
typedef bool (*fs_validate_resize)(partition_data *partition, off_t *size);
typedef bool (*fs_validate_move)(partition_data *partition, off_t *start);
typedef bool (*fs_validate_set_content_name)(partition_data *partition,
char *name);
typedef bool (*fs_validate_set_partition_content_parameters)(
partition_data *partition, const char *parameters);
typedef bool (*fs_validate_initialize_partition)(partition_data *partition,
char *name, const char *parameters);
typedef bool (*fs_validate_set_content_parameters)(partition_data *partition,
const char *parameters);
typedef bool (*fs_validate_initialize)(partition_data *partition, char *name,
const char *parameters);
// writing
// (the device is NOT locked)
typedef status_t (*fs_defragment_partition)(int fd, partition_id partition,
typedef status_t (*fs_defragment)(int fd, partition_id partition,
disk_job_id job);
typedef status_t (*fs_repair)(int fd, partition_id partition, bool checkOnly,
disk_job_id job);
typedef status_t (*fs_resize)(int fd, partition_id partition, off_t size,
disk_job_id job);
typedef status_t (*fs_move)(int fd, partition_id partition, off_t offset,
disk_job_id job);
typedef status_t (*fs_repair_partition)(int fd, partition_id partition,
bool checkOnly, disk_job_id job);
typedef status_t (*fs_resize_partition)(int fd, partition_id partition,
off_t size, disk_job_id job);
typedef status_t (*fs_move_partition)(int fd, partition_id partition,
off_t offset, disk_job_id job);
typedef status_t (*fs_set_content_name)(int fd, partition_id partition,
const char *name, disk_job_id job);
typedef status_t (*fs_set_partition_content_parameters)(int fd,
partition_id partition, const char *parameters, disk_job_id job);
typedef status_t (*fs_initialize_partition)(const char *partition,
const char *name, const char *parameters, disk_job_id job);
typedef status_t (*fs_set_content_parameters)(int fd, partition_id partition,
const char *parameters, disk_job_id job);
typedef status_t (*fs_initialize)(const char *partition, const char *name,
const char *parameters, disk_job_id job);
// This is pretty close to how the hook in R5 looked. Save the job ID, of
// course and that the parameters were given as (void*, size_t) pair.
@ -262,34 +245,30 @@ typedef struct fs_module_info {
fs_free_partition_content_cookie free_partition_content_cookie;
// querying
fs_supports_defragmenting_partition
supports_defragmenting_partition;
fs_supports_reparing_partition supports_reparing_partition;
fs_supports_resizing_partition supports_resizing_partition;
fs_supports_moving_partition supports_moving_partition;
fs_supports_defragmenting supports_defragmenting;
fs_supports_repairing supports_repairing;
fs_supports_resizing supports_resizing;
fs_supports_moving supports_moving;
fs_supports_setting_content_name supports_setting_content_name;
fs_supports_setting_content_parameters
supports_setting_content_parameters;
fs_supports_initializing_partition
supports_initializing_partition;
fs_is_sub_system_for is_sub_system_for;
fs_supports_initializing supports_initializing;
fs_validate_resize_partition validate_resize_partition;
fs_validate_move_partition validate_move_partition;
fs_validate_resize validate_resize;
fs_validate_move validate_move;
fs_validate_set_content_name validate_set_content_name;
fs_validate_set_partition_content_parameters
validate_set_partition_content_parameters;
fs_validate_initialize_partition validate_initialize_partition;
fs_validate_set_content_parameters
validate_set_content_parameters;
fs_validate_initialize validate_initialize;
// writing
fs_defragment_partition defragment_partition;
fs_repair_partition repair_partition;
fs_resize_partition resize_partition;
fs_move_partition move_partition;
fs_defragment defragment;
fs_repair repair;
fs_resize resize;
fs_move move;
fs_set_content_name set_content_name;
fs_set_partition_content_parameters
set_partition_content_parameters;
fs_initialize_partition initialize_partition;
fs_set_content_parameters set_content_parameters;
fs_initialize initialize;
} fs_module_info;
#endif // _K_DISK_DEVICE_MODULES_H

View File

@ -272,29 +272,28 @@ static fs_module_info bfs_module = {
bfs_free_partition_content_cookie, // free_partition_content_cookie
// querying
NULL, // supports_defragmenting_partition
NULL, // supports_reparing_partition
NULL, // supports_resizing_partition
NULL, // supports_moving_partition
NULL, // supports_defragmenting
NULL, // supports_repairing
NULL, // supports_resizing
NULL, // supports_moving
NULL, // supports_setting_content_name
NULL, // supports_setting_content_parameters
NULL, // supports_initializing_partition
NULL, // is_sub_system_for
NULL, // supports_initializing
NULL, // validate_resize_partition
NULL, // validate_move_partition
NULL, // validate_resize
NULL, // validate_move
NULL, // validate_set_content_name
NULL, // validate_set_partition_content_parameters
NULL, // validate_initialize_partition
NULL, // validate_set_content_parameters
NULL, // validate_initialize
// writing
NULL, // defragment_partition
NULL, // repair_partition
NULL, // resize_partition
NULL, // move_partition
NULL, // defragment
NULL, // repair
NULL, // resize
NULL, // move
NULL, // set_content_name
NULL, // set_partition_content_parameters
NULL, // initialize_partition
NULL, // set_content_parameters
NULL, // initialize
};

View File

@ -308,51 +308,51 @@ static partition_module_info intel_partition_map_module = {
pm_free_partition_content_cookie, // free_partition_content_cookie
// querying
NULL, // supports_reparing_partition
NULL, // supports_resizing_partition
NULL, // supports_resizing_child_partition
NULL, // supports_moving_partition
NULL, // supports_moving_child_partition
NULL, // supports_repairing
NULL, // supports_resizing
NULL, // supports_resizing_child
NULL, // supports_moving
NULL, // supports_moving_child
NULL, // supports_setting_name
NULL, // supports_setting_content_name
NULL, // supports_setting_type
NULL, // supports_setting_parameters
NULL, // supports_setting_content_parameters
NULL, // supports_initializing_partition
NULL, // supports_initializing_child_partition
NULL, // supports_creating_child_partition
NULL, // supports_deleting_child_partition
NULL, // supports_initializing
NULL, // supports_initializing_child
NULL, // supports_creating_child
NULL, // supports_deleting_child
NULL, // is_sub_system_for
NULL, // validate_resize_partition
NULL, // validate_resize_child_partition
NULL, // validate_move_partition
NULL, // validate_move_child_partition
NULL, // validate_resize
NULL, // validate_resize_child
NULL, // validate_move
NULL, // validate_move_child
NULL, // validate_set_name
NULL, // validate_set_content_name
NULL, // validate_set_type
NULL, // validate_set_partition_parameters
NULL, // validate_set_partition_content_parameters
NULL, // validate_initialize_partition
NULL, // validate_create_child_partition
NULL, // validate_set_parameters
NULL, // validate_set_content_parameters
NULL, // validate_initialize
NULL, // validate_create_child
NULL, // get_partitionable_spaces
NULL, // get_next_supported_type
NULL, // get_type_for_content_type
// writing
NULL, // repair_partition
NULL, // resize_partition
NULL, // resize_child_partition
NULL, // move_partition
NULL, // move_child_partition
NULL, // repair
NULL, // resize
NULL, // resize_child
NULL, // move
NULL, // move_child
NULL, // set_name
NULL, // set_content_name
NULL, // set_type
NULL, // set_parameters_partition
NULL, // set_partition_content_parameters
NULL, // initialize_partition
NULL, // create_child_partition
NULL, // delete_child_partition
NULL, // set_parameters
NULL, // set_content_parameters
NULL, // initialize
NULL, // create_child
NULL, // delete_child
};
@ -388,51 +388,51 @@ static partition_module_info intel_extended_partition_module = {
ep_free_partition_content_cookie, // free_partition_content_cookie
// querying
NULL, // supports_reparing_partition
NULL, // supports_resizing_partition
NULL, // supports_resizing_child_partition
NULL, // supports_moving_partition
NULL, // supports_moving_child_partition
NULL, // supports_repairing
NULL, // supports_resizing
NULL, // supports_resizing_child
NULL, // supports_moving
NULL, // supports_moving_child
NULL, // supports_setting_name
NULL, // supports_setting_content_name
NULL, // supports_setting_type
NULL, // supports_setting_parameters
NULL, // supports_setting_content_parameters
NULL, // supports_initializing_partition
NULL, // supports_initializing_child_partition
NULL, // supports_creating_child_partition
NULL, // supports_deleting_child_partition
NULL, // supports_initializing
NULL, // supports_initializing_child
NULL, // supports_creating_child
NULL, // supports_deleting_child
NULL, // is_sub_system_for
NULL, // validate_resize_partition
NULL, // validate_resize_child_partition
NULL, // validate_move_partition
NULL, // validate_move_child_partition
NULL, // validate_resize
NULL, // validate_resize_child
NULL, // validate_move
NULL, // validate_move_child
NULL, // validate_set_name
NULL, // validate_set_content_name
NULL, // validate_set_type
NULL, // validate_set_partition_parameters
NULL, // validate_set_partition_content_parameters
NULL, // validate_initialize_partition
NULL, // validate_create_child_partition
NULL, // validate_set_parameters
NULL, // validate_set_content_parameters
NULL, // validate_initialize
NULL, // validate_create_child
NULL, // get_partitionable_spaces
NULL, // get_next_supported_type
NULL, // get_type_for_content_type
// writing
NULL, // repair_partition
NULL, // resize_partition
NULL, // resize_child_partition
NULL, // move_partition
NULL, // move_child_partition
NULL, // repair
NULL, // resize
NULL, // resize_child
NULL, // move
NULL, // move_child
NULL, // set_name
NULL, // set_content_name
NULL, // set_type
NULL, // set_parameters_partition
NULL, // set_partition_content_parameters
NULL, // initialize_partition
NULL, // create_child_partition
NULL, // delete_child_partition
NULL, // set_parameters
NULL, // set_content_parameters
NULL, // initialize
NULL, // create_child
NULL, // delete_child
};