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