From adb9970c9ea379db1ed8ec58d13567768e760242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 18 Nov 2002 01:19:55 +0000 Subject: [PATCH] This file defines the private BFS ioctls to control the "chkbfs" mechanism and other stuff. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1990 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_systems/bfs/bfs_control.h | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/add-ons/kernel/file_systems/bfs/bfs_control.h diff --git a/src/add-ons/kernel/file_systems/bfs/bfs_control.h b/src/add-ons/kernel/file_systems/bfs/bfs_control.h new file mode 100644 index 0000000000..b4a9da8574 --- /dev/null +++ b/src/add-ons/kernel/file_systems/bfs/bfs_control.h @@ -0,0 +1,72 @@ +#ifndef BFS_CONTROL_H +#define BFS_CONTROL_H +/* bfs_control - additional functionality exported via ioctl() +** +** Initial version by Axel Dörfler, axeld@pinc-software.de +** This file may be used under the terms of the OpenBeOS License. +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "fsproto.h" + +#ifdef __cplusplus +} +#endif + + +/* ioctl to check the version of BFS used - parameter is a uint32 * + * where the number is stored + */ +#define BFS_IOCTL_VERSION 14200 + +/* ioctls to use the "chkbfs" feature from the outside + * all calls use a struct check_result as single parameter + */ +#define BFS_IOCTL_START_CHECKING 14201 +#define BFS_IOCTL_STOP_CHECKING 14202 +#define BFS_IOCTL_CHECK_NEXT_NODE 14203 + +/* all fields except "flags", and "name" must be set to zero before + * BFS_IOCTL_START_CHECKING is called + */ +struct check_control { + uint32 flags; + char name[B_FILE_NAME_LENGTH]; + vnode_id inode; + uint32 mode; + uint32 errors; + struct { + uint64 missing; + uint64 already_set; + uint64 freed; + } stats; + status_t status; + void *cookie; +}; + +/* values for the flags field */ +#define BFS_FIX_BITMAP_ERRORS 1 +#define BFS_REMOVE_WRONG_TYPES 2 + /* files that shouldn't be part of its parent will be removed + * (i.e. a directory contains an attribute, ...) + * Works only if B_FIX_BITMAP_ERRORS is set, too + */ +#define BFS_REMOVE_INVALID 4 + /* removes nodes that couldn't be opened at all from its parent + * directory. + * Also requires the B_FIX_BITMAP_ERRORS to be set. + */ + +/* values for the errors field */ +#define BFS_MISSING_BLOCKS 1 +#define BFS_BLOCKS_ALREADY_SET 2 +#define BFS_INVALID_BLOCK_RUN 4 +#define BFS_COULD_NOT_OPEN 8 +#define BFS_WRONG_TYPE 16 +#define BFS_NAMES_DONT_MATCH 32 + +#endif /* BFS_CONTROL_H */