generated from psu-cmpsc311-fall24-classroom/Assignment-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jbod.h
42 lines (36 loc) · 835 Bytes
/
jbod.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef JBOD_H_
#define JBOD_H_
#include <stdint.h>
// Fill the below values with right values
#define JBOD_NUM_DISKS 16
#define JBOD_DISK_SIZE 65536
#define JBOD_BLOCK_SIZE 256
#define JBOD_NUM_BLOCKS_PER_DISK 256
typedef enum {
JBOD_MOUNT,
JBOD_UNMOUNT,
JBOD_SEEK_TO_DISK,
JBOD_SEEK_TO_BLOCK,
JBOD_READ_BLOCK,
JBOD_WRITE_BLOCK,
JBOD_SIGN_BLOCK,
JBOD_NUM_CMDS,
} jbod_cmd_t;
typedef enum {
JBOD_NO_ERROR,
JBOD_UNMOUNTED,
JBOD_ALREADY_MOUNTED,
JBOD_ALREADY_UNMOUNTED,
JBOD_CACHELOAD_FAIL,
JBOD_CACHEWRITE_FAIL,
JBOD_BAD_CMD,
JBOD_BAD_DISK_NUM,
JBOD_BAD_BLOCK_NUM,
JBOD_BAD_READ,
JBOD_BAD_WRITE,
JBOD_NUM_ERRNOS,
} jbod_error_t;
int jbod_operation(uint32_t op, uint8_t *block);
extern jbod_error_t jbod_error;
const char *jbod_error_string(int eno);
#endif