1 /* 2 * Copyright 2003-2009, 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 12 #include <OS.h> 13 14 #include <DiskDeviceDefs.h> 15 16 #include <ddm_userland_interface_defs.h> 17 #include <disk_device_manager.h> 18 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /*! Syscalls entries */ 25 26 // iterating, retrieving device/partition data 27 partition_id _user_get_next_disk_device_id(int32 *cookie, size_t *neededSize); 28 partition_id _user_find_disk_device(const char *filename, size_t *neededSize); 29 partition_id _user_find_partition(const char *filename, size_t *neededSize); 30 partition_id _user_find_file_disk_device(const char *filename, 31 size_t *neededSize); 32 status_t _user_get_disk_device_data(partition_id deviceID, bool deviceOnly, 33 user_disk_device_data *buffer, size_t bufferSize, 34 size_t *neededSize); 35 36 partition_id _user_register_file_device(const char *filename); 37 status_t _user_unregister_file_device(partition_id deviceID, 38 const char *filename); 39 // Only a valid deviceID or filename need to be passed. The other one 40 // is -1/NULL. If both is given only filename is ignored. 41 status_t _user_get_file_disk_device_path(partition_id id, char* buffer, 42 size_t bufferSize); 43 44 // disk systems 45 status_t _user_get_disk_system_info(disk_system_id id, 46 user_disk_system_info *info); 47 status_t _user_get_next_disk_system_info(int32 *cookie, 48 user_disk_system_info *info); 49 status_t _user_find_disk_system(const char *name, user_disk_system_info *info); 50 51 // disk device modification 52 status_t _user_defragment_partition(partition_id partitionID, 53 int32* changeCounter); 54 status_t _user_repair_partition(partition_id partitionID, int32* changeCounter, 55 bool checkOnly); 56 status_t _user_resize_partition(partition_id partitionID, int32* changeCounter, 57 partition_id childID, int32* childChangeCounter, off_t size, 58 off_t contentSize); 59 status_t _user_move_partition(partition_id partitionID, int32* changeCounter, 60 partition_id childID, int32* childChangeCounter, 61 off_t newOffset, partition_id* descendantIDs, 62 int32* descendantChangeCounters, int32 descendantCount); 63 status_t _user_set_partition_name(partition_id partitionID, 64 int32* changeCounter, partition_id childID, 65 int32* childChangeCounter, const char* name); 66 status_t _user_set_partition_content_name(partition_id partitionID, 67 int32* changeCounter, const char* name); 68 status_t _user_set_partition_type(partition_id partitionID, 69 int32* changeCounter, partition_id childID, 70 int32* childChangeCounter, const char* type); 71 status_t _user_set_partition_parameters(partition_id partitionID, 72 int32* changeCounter, partition_id childID, 73 int32* childChangeCounter, const char* parameters); 74 status_t _user_set_partition_content_parameters(partition_id partitionID, 75 int32* changeCounter, const char* parameters); 76 status_t _user_initialize_partition(partition_id partitionID, 77 int32* changeCounter, const char* diskSystemName, 78 const char* name, const char* parameters); 79 status_t _user_uninitialize_partition(partition_id partitionID, 80 int32* changeCounter); 81 82 status_t _user_create_child_partition(partition_id partitionID, 83 int32* changeCounter, off_t offset, off_t size, 84 const char* type, const char* name, const char* parameters, 85 partition_id* childID, int32* childChangeCounter); 86 status_t _user_delete_child_partition(partition_id partitionID, 87 int32* changeCounter, partition_id childID, 88 int32 childChangeCounter); 89 90 // change notification 91 status_t _user_start_watching_disks(uint32 eventMask, port_id port, 92 int32 token); 93 status_t _user_stop_watching_disks(port_id port, int32 token); 94 95 #ifdef __cplusplus 96 } 97 #endif 98 99 #endif // _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H 100