ddm_userland_interface.h revision 4419d699
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
21extern "C" {
22#endif
23
24/*! Syscalls entries */
25
26// iterating, retrieving device/partition data
27partition_id _user_get_next_disk_device_id(int32 *cookie, size_t *neededSize);
28partition_id _user_find_disk_device(const char *filename, size_t *neededSize);
29partition_id _user_find_partition(const char *filename, size_t *neededSize);
30partition_id _user_find_file_disk_device(const char *filename,
31				size_t *neededSize);
32status_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
36partition_id _user_register_file_device(const char *filename);
37status_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.
41status_t _user_get_file_disk_device_path(partition_id id, char* buffer,
42				size_t bufferSize);
43
44// disk systems
45status_t _user_get_disk_system_info(disk_system_id id,
46				user_disk_system_info *info);
47status_t _user_get_next_disk_system_info(int32 *cookie,
48				user_disk_system_info *info);
49status_t _user_find_disk_system(const char *name, user_disk_system_info *info);
50
51// disk device modification
52status_t _user_defragment_partition(partition_id partitionID,
53				int32* changeCounter);
54status_t _user_repair_partition(partition_id partitionID, int32* changeCounter,
55				bool checkOnly);
56status_t _user_resize_partition(partition_id partitionID, int32* changeCounter,
57				partition_id childID, int32* childChangeCounter, off_t size,
58				off_t contentSize);
59status_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);
63status_t _user_set_partition_name(partition_id partitionID,
64				int32* changeCounter, partition_id childID,
65				int32* childChangeCounter, const char* name);
66status_t _user_set_partition_content_name(partition_id partitionID,
67				int32* changeCounter, const char* name);
68status_t _user_set_partition_type(partition_id partitionID,
69				int32* changeCounter, partition_id childID,
70				int32* childChangeCounter, const char* type);
71status_t _user_set_partition_parameters(partition_id partitionID,
72				int32* changeCounter, partition_id childID,
73				int32* childChangeCounter, const char* parameters);
74status_t _user_set_partition_content_parameters(partition_id partitionID,
75				int32* changeCounter, const char* parameters);
76status_t _user_initialize_partition(partition_id partitionID,
77				int32* changeCounter, const char* diskSystemName,
78				const char* name, const char* parameters);
79status_t _user_uninitialize_partition(partition_id partitionID,
80				int32* changeCounter, partition_id parentID,
81				int32* parentChangeCounter);
82
83status_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);
87status_t _user_delete_child_partition(partition_id partitionID,
88				int32* changeCounter, partition_id childID,
89				int32 childChangeCounter);
90
91// change notification
92status_t _user_start_watching_disks(uint32 eventMask, port_id port,
93				int32 token);
94status_t _user_stop_watching_disks(port_id port, int32 token);
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif	// _DISK_DEVICE_MANAGER_USERLAND_INTERFACE_H
101