1 #ifndef BFS_CONTROL_H 2 #define BFS_CONTROL_H 3 /* bfs_control - additional functionality exported via ioctl() 4 ** 5 ** Initial version by Axel Dörfler, axeld@pinc-software.de 6 ** This file may be used under the terms of the OpenBeOS License. 7 */ 8 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #include "fsproto.h" 15 16 #ifdef __cplusplus 17 } 18 #endif 19 20 21 /* ioctl to check the version of BFS used - parameter is a uint32 * 22 * where the number is stored 23 */ 24 #define BFS_IOCTL_VERSION 14200 25 26 /* ioctls to use the "chkbfs" feature from the outside 27 * all calls use a struct check_result as single parameter 28 */ 29 #define BFS_IOCTL_START_CHECKING 14201 30 #define BFS_IOCTL_STOP_CHECKING 14202 31 #define BFS_IOCTL_CHECK_NEXT_NODE 14203 32 33 /* all fields except "flags", and "name" must be set to zero before 34 * BFS_IOCTL_START_CHECKING is called 35 */ 36 struct check_control { 37 uint32 flags; 38 char name[B_FILE_NAME_LENGTH]; 39 vnode_id inode; 40 uint32 mode; 41 uint32 errors; 42 struct { 43 uint64 missing; 44 uint64 already_set; 45 uint64 freed; 46 } stats; 47 status_t status; 48 void *cookie; 49 }; 50 51 /* values for the flags field */ 52 #define BFS_FIX_BITMAP_ERRORS 1 53 #define BFS_REMOVE_WRONG_TYPES 2 54 /* files that shouldn't be part of its parent will be removed 55 * (i.e. a directory contains an attribute, ...) 56 * Works only if B_FIX_BITMAP_ERRORS is set, too 57 */ 58 #define BFS_REMOVE_INVALID 4 59 /* removes nodes that couldn't be opened at all from its parent 60 * directory. 61 * Also requires the B_FIX_BITMAP_ERRORS to be set. 62 */ 63 64 /* values for the errors field */ 65 #define BFS_MISSING_BLOCKS 1 66 #define BFS_BLOCKS_ALREADY_SET 2 67 #define BFS_INVALID_BLOCK_RUN 4 68 #define BFS_COULD_NOT_OPEN 8 69 #define BFS_WRONG_TYPE 16 70 #define BFS_NAMES_DONT_MATCH 32 71 72 #endif /* BFS_CONTROL_H */ 73