Rev 2540 | Rev 2544 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2540 | Rev 2542 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | #define VFS_VFS_H_ |
34 | #define VFS_VFS_H_ |
35 | 35 | ||
36 | #include <ipc/ipc.h> |
36 | #include <ipc/ipc.h> |
37 | #include <libadt/list.h> |
37 | #include <libadt/list.h> |
38 | #include <atomic.h> |
38 | #include <atomic.h> |
39 | #include <types.h> |
39 | #include <sys/types.h> |
40 | 40 | ||
41 | #define dprintf(...) printf(__VA_ARGS__) |
41 | #define dprintf(...) printf(__VA_ARGS__) |
42 | 42 | ||
43 | #define VFS_FIRST FIRST_USER_METHOD |
43 | #define VFS_FIRST FIRST_USER_METHOD |
44 | 44 | ||
45 | #define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST) |
45 | #define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST) |
46 | 46 | ||
47 | typedef int64_t off_t; |
- | |
48 | - | ||
49 | typedef enum { |
47 | typedef enum { |
50 | VFS_REGISTER = VFS_FIRST, |
48 | VFS_REGISTER = VFS_FIRST, |
51 | VFS_MOUNT, |
49 | VFS_MOUNT, |
52 | VFS_UNMOUNT, |
50 | VFS_UNMOUNT, |
53 | VFS_LOOKUP, |
51 | VFS_LOOKUP, |
Line 123... | Line 121... | ||
123 | 121 | ||
124 | /** Current position in the file. */ |
122 | /** Current position in the file. */ |
125 | off_t pos; |
123 | off_t pos; |
126 | } vfs_file_t; |
124 | } vfs_file_t; |
127 | 125 | ||
- | 126 | extern link_t fs_head; /**< List of registered file systems. */ |
|
- | 127 | ||
- | 128 | extern vfs_node_t *rootfs; /**< Root node of the root file system. */ |
|
- | 129 | ||
- | 130 | #define MAX_PATH_LEN (64 * 1024) |
|
- | 131 | ||
- | 132 | #define PLB_SIZE (2 * MAX_PATH_LEN) |
|
- | 133 | ||
- | 134 | /** Each instance of this type describes one path lookup in progress. */ |
|
- | 135 | typedef struct { |
|
- | 136 | link_t plb_link; /**< Active PLB entries list link. */ |
|
- | 137 | unsigned index; /**< Index of the first character in PLB. */ |
|
- | 138 | size_t len; /**< Number of characters in this PLB entry. */ |
|
128 | extern link_t fs_head; |
139 | } plb_entry_t; |
- | 140 | ||
- | 141 | extern atomic_t plb_futex; /**< Futex protecting plb and plb_head. */ |
|
- | 142 | extern uint8_t *plb; /**< Path Lookup Buffer */ |
|
- | 143 | extern link_t plb_head; /**< List of active PLB entries. */ |
|
129 | 144 | ||
130 | extern void vfs_register(ipc_callid_t rid, ipc_call_t *request); |
145 | extern void vfs_register(ipc_callid_t, ipc_call_t *); |
- | 146 | extern void vfs_lookup(ipc_callid_t, ipc_call_t *); |
|
131 | 147 | ||
132 | #endif |
148 | #endif |
133 | 149 | ||
134 | /** |
150 | /** |
135 | * @} |
151 | * @} |