1 /* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by
4 /* Here we declare structures and flags that store reiser4 status on disk.
5 The status that helps us to find out if the filesystem is valid or if it
6 contains some critical, or not so critical errors */
8 #if !defined( __REISER4_STATUS_FLAGS_H__ )
9 #define __REISER4_STATUS_FLAGS_H__
12 /* These are major status flags */
13 #define REISER4_STATUS_OK 0
14 #define REISER4_STATUS_CORRUPTED 0x1
15 #define REISER4_STATUS_DAMAGED 0x2
16 #define REISER4_STATUS_DESTROYED 0x4
17 #define REISER4_STATUS_IOERROR 0x8
19 /* Return values for reiser4_status_query() */
20 #define REISER4_STATUS_MOUNT_OK 0
21 #define REISER4_STATUS_MOUNT_WARN 1
22 #define REISER4_STATUS_MOUNT_RO 2
23 #define REISER4_STATUS_MOUNT_UNKNOWN -1
25 #define REISER4_TEXTERROR_LEN 256
27 #define REISER4_STATUS_MAGIC "ReiSeR4StATusBl"
28 /* We probably need to keep its size under sector size which is 512 bytes */
29 struct reiser4_status
{
31 d64 status
; /* Current FS state */
32 d64 extended_status
; /* Any additional info that might have sense in addition to "status". E.g.
33 last sector where io error happened if status is "io error encountered" */
34 d64 stacktrace
[10]; /* Last ten functional calls made (addresses) */
35 char texterror
[REISER4_TEXTERROR_LEN
]; /* Any error message if appropriate, otherwise filled with zeroes */
38 int reiser4_status_init(reiser4_block_nr block
);
39 int reiser4_status_query(u64
* status
, u64
* extended
);
40 int reiser4_status_write(u64 status
, u64 extended_status
, char *message
);
41 int reiser4_status_finish(void);