2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
8 #ifndef _PACKAGE__PRIVATE__PACKAGE_FS_H_
9 #define _PACKAGE__PRIVATE__PACKAGE_FS_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
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
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)
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
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
;
64 ino_t directoryNodeID
;
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.
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
;
92 // entry_ref of the package file
95 ino_t parentDirectoryID
;
97 // must point to a location within the
101 struct PackageFSActivationChangeRequest
{
103 PackageFSActivationChangeItem items
[0];
107 #endif // _PACKAGE__PRIVATE__PACKAGE_FS_H_