btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / package / packagefs.h
blob9b766dcd2a7bcb60641a6fa331f7caa5eaf5b444
1 /*
2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
7 */
8 #ifndef _PACKAGE__PRIVATE__PACKAGE_FS_H_
9 #define _PACKAGE__PRIVATE__PACKAGE_FS_H_
12 #include <Drivers.h>
15 enum PackageFSMountType {
16 PACKAGE_FS_MOUNT_TYPE_SYSTEM,
17 PACKAGE_FS_MOUNT_TYPE_HOME,
18 PACKAGE_FS_MOUNT_TYPE_CUSTOM,
20 PACKAGE_FS_MOUNT_TYPE_ENUM_COUNT
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
31 // PACKAGE_FS_OPERATION_GET_VOLUME_INFO
33 struct PackageFSDirectoryInfo {
34 // node_ref of the directory
35 dev_t deviceID;
36 ino_t nodeID;
39 struct PackageFSVolumeInfo {
40 PackageFSMountType mountType;
42 // device and node id of the respective package FS root scope (e.g. "/boot"
43 // for the three standard volumes)
44 dev_t rootDeviceID;
45 ino_t rootDirectoryID;
47 // packageCount is set to the actual packages directory count, even if it is
48 // greater than the array, so the caller can determine whether the array was
49 // large enough.
50 // The directories are ordered from the most recent state (the actual
51 // "packages" directory) to the oldest one, the one that is actually active.
52 uint32 packagesDirectoryCount;
53 PackageFSDirectoryInfo packagesDirectoryInfos[1];
57 // PACKAGE_FS_OPERATION_GET_PACKAGE_INFOS
59 struct PackageFSPackageInfo {
60 // node_ref and entry_ref of the package file
61 dev_t packageDeviceID;
62 dev_t directoryDeviceID;
63 ino_t packageNodeID;
64 ino_t directoryNodeID;
65 const char* name;
68 struct PackageFSGetPackageInfosRequest {
69 // Filled in by the FS. bufferSize is set to the required buffer size, even
70 // even if the provided buffer is smaller.
71 uint32 bufferSize;
72 uint32 packageCount;
73 PackageFSPackageInfo infos[1];
77 // PACKAGE_FS_OPERATION_CHANGE_ACTIVATION
79 enum PackageFSActivationChangeType {
80 PACKAGE_FS_ACTIVATE_PACKAGE,
81 PACKAGE_FS_DEACTIVATE_PACKAGE,
82 PACKAGE_FS_REACTIVATE_PACKAGE
85 struct PackageFSActivationChangeItem {
86 PackageFSActivationChangeType type;
88 // node_ref of the package file
89 dev_t packageDeviceID;
90 ino_t packageNodeID;
92 // entry_ref of the package file
93 uint32 nameLength;
94 dev_t parentDeviceID;
95 ino_t parentDirectoryID;
96 char* name;
97 // must point to a location within the
98 // request
101 struct PackageFSActivationChangeRequest {
102 uint32 itemCount;
103 PackageFSActivationChangeItem items[0];
107 #endif // _PACKAGE__PRIVATE__PACKAGE_FS_H_