1 /* 2 * Copyright 2003-2007, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _FSSH_DISK_DEVICE_DEFS_H 6 #define _FSSH_DISK_DEVICE_DEFS_H 7 8 9 #include "fssh_defs.h" 10 11 12 typedef int32_t fssh_partition_id; 13 typedef int32_t fssh_disk_system_id; 14 typedef int32_t fssh_disk_job_id; 15 16 // partition flags 17 enum { 18 FSSH_B_PARTITION_IS_DEVICE = 0x01, 19 FSSH_B_PARTITION_FILE_SYSTEM = 0x02, 20 FSSH_B_PARTITION_PARTITIONING_SYSTEM = 0x04, 21 FSSH_B_PARTITION_READ_ONLY = 0x08, 22 FSSH_B_PARTITION_MOUNTED = 0x10, // needed? 23 FSSH_B_PARTITION_BUSY = 0x20, 24 FSSH_B_PARTITION_DESCENDANT_BUSY = 0x40, 25 }; 26 27 // partition statuses 28 enum { 29 FSSH_B_PARTITION_VALID, 30 FSSH_B_PARTITION_CORRUPT, 31 FSSH_B_PARTITION_UNRECOGNIZED, 32 FSSH_B_PARTITION_UNINITIALIZED, // Only when uninitialized manually. 33 // When not recognized while scanning it's 34 // B_PARTITION_UNRECOGNIZED. 35 }; 36 37 // partition change flags 38 enum { 39 FSSH_B_PARTITION_CHANGED_OFFSET = 0x000001, 40 FSSH_B_PARTITION_CHANGED_SIZE = 0x000002, 41 FSSH_B_PARTITION_CHANGED_CONTENT_SIZE = 0x000004, 42 FSSH_B_PARTITION_CHANGED_BLOCK_SIZE = 0x000008, 43 FSSH_B_PARTITION_CHANGED_STATUS = 0x000010, 44 FSSH_B_PARTITION_CHANGED_FLAGS = 0x000020, 45 FSSH_B_PARTITION_CHANGED_VOLUME = 0x000040, 46 FSSH_B_PARTITION_CHANGED_NAME = 0x000080, 47 FSSH_B_PARTITION_CHANGED_CONTENT_NAME = 0x000100, 48 FSSH_B_PARTITION_CHANGED_TYPE = 0x000200, 49 FSSH_B_PARTITION_CHANGED_CONTENT_TYPE = 0x000400, 50 FSSH_B_PARTITION_CHANGED_PARAMETERS = 0x000800, 51 FSSH_B_PARTITION_CHANGED_CONTENT_PARAMETERS = 0x001000, 52 FSSH_B_PARTITION_CHANGED_CHILDREN = 0x002000, 53 FSSH_B_PARTITION_CHANGED_DESCENDANTS = 0x004000, 54 FSSH_B_PARTITION_CHANGED_DEFRAGMENTATION = 0x008000, 55 FSSH_B_PARTITION_CHANGED_CHECK = 0x010000, 56 FSSH_B_PARTITION_CHANGED_REPAIR = 0x020000, 57 FSSH_B_PARTITION_CHANGED_INITIALIZATION = 0x040000, 58 }; 59 60 // disk device flags 61 enum { 62 FSSH_B_DISK_DEVICE_REMOVABLE = 0x01, 63 FSSH_B_DISK_DEVICE_HAS_MEDIA = 0x02, 64 FSSH_B_DISK_DEVICE_READ_ONLY = 0x04, 65 FSSH_B_DISK_DEVICE_WRITE_ONCE = 0x08, 66 }; 67 68 // disk system flags 69 enum { 70 FSSH_B_DISK_SYSTEM_IS_FILE_SYSTEM = 0x0001, 71 72 // flags common for both file and partitioning systems 73 FSSH_B_DISK_SYSTEM_SUPPORTS_CHECKING = 0x0002, 74 FSSH_B_DISK_SYSTEM_SUPPORTS_REPAIRING = 0x0004, 75 FSSH_B_DISK_SYSTEM_SUPPORTS_RESIZING = 0x0008, 76 FSSH_B_DISK_SYSTEM_SUPPORTS_MOVING = 0x0010, 77 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME = 0x0020, 78 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS = 0x0040, 79 80 // file system specific flags 81 FSSH_B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING = 0x0100, 82 FSSH_B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING_WHILE_MOUNTED = 0x0200, 83 FSSH_B_DISK_SYSTEM_SUPPORTS_CHECKING_WHILE_MOUNTED = 0x0400, 84 FSSH_B_DISK_SYSTEM_SUPPORTS_REPAIRING_WHILE_MOUNTED = 0x0800, 85 FSSH_B_DISK_SYSTEM_SUPPORTS_RESIZING_WHILE_MOUNTED = 0x1000, 86 FSSH_B_DISK_SYSTEM_SUPPORTS_MOVING_WHILE_MOUNTED = 0x2000, 87 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME_WHILE_MOUNTED = 0x4000, 88 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS_WHILE_MOUNTED = 0x8000, 89 90 // partitioning system specific flags 91 FSSH_B_DISK_SYSTEM_SUPPORTS_RESIZING_CHILD = 0x0100, 92 FSSH_B_DISK_SYSTEM_SUPPORTS_MOVING_CHILD = 0x0200, 93 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_NAME = 0x0400, 94 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_TYPE = 0x0800, 95 FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_PARAMETERS = 0x1000, 96 FSSH_B_DISK_SYSTEM_SUPPORTS_CREATING_CHILD = 0x2000, 97 FSSH_B_DISK_SYSTEM_SUPPORTS_DELETING_CHILD = 0x4000, 98 FSSH_B_DISK_SYSTEM_SUPPORTS_INITIALIZING = 0x8000, 99 }; 100 101 // disk device job types 102 enum { 103 FSSH_B_DISK_DEVICE_JOB_BAD_TYPE, 104 FSSH_B_DISK_DEVICE_JOB_DEFRAGMENT, 105 FSSH_B_DISK_DEVICE_JOB_REPAIR, 106 FSSH_B_DISK_DEVICE_JOB_RESIZE, 107 FSSH_B_DISK_DEVICE_JOB_MOVE, 108 FSSH_B_DISK_DEVICE_JOB_SET_NAME, 109 FSSH_B_DISK_DEVICE_JOB_SET_CONTENT_NAME, 110 FSSH_B_DISK_DEVICE_JOB_SET_TYPE, 111 FSSH_B_DISK_DEVICE_JOB_SET_PARMETERS, 112 FSSH_B_DISK_DEVICE_JOB_SET_CONTENT_PARMETERS, 113 FSSH_B_DISK_DEVICE_JOB_INITIALIZE, 114 FSSH_B_DISK_DEVICE_JOB_UNINITIALIZE, 115 FSSH_B_DISK_DEVICE_JOB_CREATE, 116 FSSH_B_DISK_DEVICE_JOB_DELETE, 117 FSSH_B_DISK_DEVICE_JOB_SCAN, 118 }; 119 120 // disk device job statuses 121 enum { 122 FSSH_B_DISK_DEVICE_JOB_UNINITIALIZED, 123 FSSH_B_DISK_DEVICE_JOB_SCHEDULED, 124 FSSH_B_DISK_DEVICE_JOB_IN_PROGRESS, 125 FSSH_B_DISK_DEVICE_JOB_SUCCEEDED, 126 FSSH_B_DISK_DEVICE_JOB_FAILED, 127 FSSH_B_DISK_DEVICE_JOB_CANCELED, 128 }; 129 130 // disk device job progress info 131 typedef struct fssh_disk_device_job_progress_info { 132 uint32_t status; 133 uint32_t interrupt_properties; 134 int32_t task_count; 135 int32_t completed_tasks; 136 float current_task_progress; 137 char current_task_description[256]; 138 } fssh_disk_device_job_progress_info; 139 140 // disk device job interrupt properties 141 enum { 142 FSSH_B_DISK_DEVICE_JOB_CAN_CANCEL = 0x01, 143 FSSH_B_DISK_DEVICE_JOB_STOP_ON_CANCEL = 0x02, 144 FSSH_B_DISK_DEVICE_JOB_REVERSE_ON_CANCEL = 0x04, 145 FSSH_B_DISK_DEVICE_JOB_CAN_PAUSE = 0x08, 146 }; 147 148 // string length constants, all of which include the NULL terminator 149 #define FSSH_B_DISK_DEVICE_TYPE_LENGTH FSSH_B_FILE_NAME_LENGTH 150 #define FSSH_B_DISK_DEVICE_NAME_LENGTH FSSH_B_FILE_NAME_LENGTH 151 #define FSSH_B_DISK_SYSTEM_NAME_LENGTH FSSH_B_PATH_NAME_LENGTH 152 153 // max size of parameter string buffers, including NULL terminator 154 #define FSSH_B_DISK_DEVICE_MAX_PARAMETER_SIZE (32 * 1024) 155 156 #endif // _FSSH_DISK_DEVICE_DEFS_H 157