Register for error notifications from a filesystem
#include <sys/dcmd_blk.h> #define DCMD_FSYS_ERRNOTIFY __DIOT(_DCMD_FSYS, 32, struct blk_errnotify)
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening the device. |
dcmd | DCMD_FSYS_ERRNOTIFY |
dev_data_ptr | A pointer to a struct blk_errnotify (see below) |
n_bytes | sizeof(struct blk_errnotify) |
dev_info_ptr | NULL |
This command registers a process for error notifications from a block filesystem. The command must come from the local process running with superuser privileges, and be directed at one of the driver's block devices.
If you successfully register for error notifications, the io-blk.so module does the following:
If a filesystem error occurs, io-blk.so sends your process a pulse with the code and priority that you provided (pulse_code and pulse_prio, respectively). The pulse's value describes the error; it consists of the following 32 bits:
Bits | Mask | Description |
---|---|---|
31 | 0x80000000 (BLK_ERRNOTIFY_STALE) | One or more errors occured before the client registered to receive error notifications |
30–9 | 0x7FFFFE00 | Currently undefined |
8–0 | 0x000001FF | An error code from <error.h> |
You can use this macro to extract the error code:
#define BLK_ERRNOTIFY_GETERROR(v) ((v) & 0x000001ff)
A pointer to a blk_errnotify structure:
typedef struct blk_errnotify { uint32_t signature; int chid; int pulse_prio; uint32_t ack_data; uint8_t pulse_code; uint8_t spare[15]; /* reserved; set to zero */ } blk_errnotify_t;
The members include:
None.