1 /* 2 * Copyright 2003-2008, Haiku Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold, bonefish@users.sf.net 7 */ 8 #ifndef _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H 9 #define _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H 10 11 #include <OS.h> 12 13 #include <DiskDeviceDefs.h> 14 15 #include <ddm_userland_interface_defs.h> 16 #include <disk_device_manager.h> 17 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 /*! Syscalls entries */ 24 25 // iterating, retrieving device/partition data 26 partition_id _user_get_next_disk_device_id(int32 *cookie, size_t *neededSize); 27 partition_id _user_find_disk_device(const char *filename, size_t *neededSize); 28 partition_id _user_find_partition(const char *filename, size_t *neededSize); 29 status_t _user_get_disk_device_data(partition_id deviceID, bool deviceOnly, 30 user_disk_device_data *buffer, size_t bufferSize, 31 size_t *neededSize); 32 33 partition_id _user_register_file_device(const char *filename); 34 status_t _user_unregister_file_device(partition_id deviceID, 35 const char *filename); 36 // Only a valid deviceID or filename need to be passed. The other one 37 // is -1/NULL. If both is given only filename is ignored. 38 39 // disk systems 40 status_t _user_get_disk_system_info(disk_system_id id, 41 user_disk_system_info *info); 42 status_t _user_get_next_disk_system_info(int32 *cookie, 43 user_disk_system_info *info); 44 status_t _user_find_disk_system(const char *name, user_disk_system_info *info); 45 46 // disk device modification 47 status_t _user_defragment_partition(partition_id partitionID, 48 int32* changeCounter); 49 status_t _user_repair_partition(partition_id partitionID, int32* changeCounter, 50 bool checkOnly); 51 status_t _user_resize_partition(partition_id partitionID, int32* changeCounter, 52 partition_id childID, int32* childChangeCounter, off_t size, 53 off_t contentSize); 54 status_t _user_move_partition(partition_id partitionID, int32* changeCounter, 55 partition_id childID, int32* childChangeCounter, 56 off_t newOffset, partition_id* descendantIDs, 57 int32* descendantChangeCounters, int32 descendantCount); 58 status_t _user_set_partition_name(partition_id partitionID, 59 int32* changeCounter, partition_id childID, 60 int32* childChangeCounter, const char* name); 61 status_t _user_set_partition_content_name(partition_id partitionID, 62 int32* changeCounter, const char* name); 63 status_t _user_set_partition_type(partition_id partitionID, 64 int32* changeCounter, partition_id childID, 65 int32* childChangeCounter, const char* type); 66 status_t _user_set_partition_parameters(partition_id partitionID, 67 int32* changeCounter, partition_id childID, 68 int32* childChangeCounter, const char* parameters, 69 size_t parametersSize); 70 status_t _user_set_partition_content_parameters(partition_id partitionID, 71 int32* changeCounter, const char* parameters, 72 size_t parametersSize); 73 status_t _user_initialize_partition(partition_id partitionID, 74 int32* changeCounter, const char* diskSystemName, 75 const char* name, const char* parameters, 76 size_t parametersSize); 77 status_t _user_uninitialize_partition(partition_id partitionID, 78 int32* changeCounter); 79 80 status_t _user_create_child_partition(partition_id partitionID, 81 int32* changeCounter, off_t offset, off_t size, 82 const char* type, const char* name, const char* parameters, 83 size_t parametersSize, partition_id* childID, 84 int32* childChangeCounter); 85 status_t _user_delete_child_partition(partition_id partitionID, 86 int32* changeCounter, partition_id childID, 87 int32 childChangeCounter); 88 89 #ifdef __cplusplus 90 } 91 #endif 92 93 #endif // _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H 94