xref: /haiku/headers/private/package/packagefs.h (revision 2b76973fa2401f7a5edf68e6470f3d3210cbcff3)
1 /*
2  * Copyright 2013, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold <ingo_weinhold@gmx.de>
7  */
8 #ifndef _PACKAGE__PRIVATE__PACKAGE_FS_H_
9 #define _PACKAGE__PRIVATE__PACKAGE_FS_H_
10 
11 
12 #include <Drivers.h>
13 
14 
15 enum PackageFSMountType {
16 	PACKAGE_FS_MOUNT_TYPE_SYSTEM,
17 	PACKAGE_FS_MOUNT_TYPE_HOME,
18 	PACKAGE_FS_MOUNT_TYPE_CUSTOM,
19 
20 	PACKAGE_FS_MOUNT_TYPE_ENUM_COUNT
21 };
22 
23 
24 enum {
25 	PACKAGE_FS_OPERATION_GET_VOLUME_INFO		= B_DEVICE_OP_CODES_END + 1,
26 	PACKAGE_FS_OPERATION_GET_PACKAGE_INFOS,
27 	PACKAGE_FS_OPERATION_CHANGE_ACTIVATION
28 };
29 
30 
31 // PACKAGE_FS_OPERATION_GET_VOLUME_INFO
32 
33 struct PackageFSVolumeInfo {
34 	PackageFSMountType	mountType;
35 
36 	// device and node id of the respective package FS root scope (e.g. "/boot"
37 	// for the three standard volumes)
38 	dev_t				rootDeviceID;
39 	ino_t				rootDirectoryID;
40 
41 	// device and node id of the volume's packages directory
42 	dev_t				packagesDeviceID;
43 	ino_t				packagesDirectoryID;
44 };
45 
46 
47 // PACKAGE_FS_OPERATION_GET_PACKAGE_INFOS
48 
49 struct PackageFSPackageInfo {
50 	// node_ref of the package file
51 	dev_t							packageDeviceID;
52 	ino_t							packageNodeID;
53 };
54 
55 struct PackageFSGetPackageInfosRequest {
56 	// Filled in by the FS. packageCount is set to the actual package count,
57 	// even if it is greater than the array, so the caller can determine whether
58 	// the array was large enough.
59 	uint32							packageCount;
60 	PackageFSPackageInfo			infos[1];
61 };
62 
63 
64 // PACKAGE_FS_OPERATION_CHANGE_ACTIVATION
65 
66 enum PackageFSActivationChangeType {
67 	PACKAGE_FS_ACTIVATE_PACKAGE,
68 	PACKAGE_FS_DEACTIVATE_PACKAGE,
69 	PACKAGE_FS_REACTIVATE_PACKAGE
70 };
71 
72 struct PackageFSActivationChangeItem {
73 	PackageFSActivationChangeType	type;
74 
75 	// node_ref of the package file
76 	dev_t							packageDeviceID;
77 	ino_t							packageNodeID;
78 
79 	// entry_ref of the package file
80 	uint32							nameLength;
81 	dev_t							parentDeviceID;
82 	ino_t							parentDirectoryID;
83 	char*							name;
84 										// must point to a location within the
85 										// request
86 };
87 
88 struct PackageFSActivationChangeRequest {
89 	uint32							itemCount;
90 	PackageFSActivationChangeItem	items[0];
91 };
92 
93 
94 #endif	// _PACKAGE__PRIVATE__PACKAGE_FS_H_
95