2 * Copyright 2003-2009, Haiku Inc.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold, bonefish@users.sf.net
8 #ifndef _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H
9 #define _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H
14 #include <DiskDeviceDefs.h>
16 #include <ddm_userland_interface_defs.h>
17 #include <disk_device_manager.h>
24 /*! Syscalls entries */
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
,
32 status_t
_user_get_disk_device_data(partition_id deviceID
, bool deviceOnly
,
33 user_disk_device_data
*buffer
, size_t bufferSize
,
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
,
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
);
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
,
56 status_t
_user_resize_partition(partition_id partitionID
, int32
* changeCounter
,
57 partition_id childID
, int32
* childChangeCounter
, off_t size
,
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
, partition_id parentID
,
81 int32
* parentChangeCounter
);
83 status_t
_user_create_child_partition(partition_id partitionID
,
84 int32
* changeCounter
, off_t offset
, off_t size
,
85 const char* type
, const char* name
, const char* parameters
,
86 partition_id
* childID
, int32
* childChangeCounter
);
87 status_t
_user_delete_child_partition(partition_id partitionID
,
88 int32
* changeCounter
, partition_id childID
,
89 int32 childChangeCounter
);
91 // change notification
92 status_t
_user_start_watching_disks(uint32 eventMask
, port_id port
,
94 status_t
_user_stop_watching_disks(port_id port
, int32 token
);
100 #endif // _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H