Rev 3675 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3675 | Rev 4377 | ||
|---|---|---|---|
| Line 45... | Line 45... | ||
| 45 | 45 | ||
| 46 | #define dprintf(...) |
46 | #define dprintf(...) |
| 47 | 47 | ||
| 48 | #define VFS_FIRST IPC_FIRST_USER_METHOD |
48 | #define VFS_FIRST IPC_FIRST_USER_METHOD |
| 49 | 49 | ||
| 50 | #define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST) |
- | |
| 51 | - | ||
| 52 | /* Basic types. */ |
50 | /* Basic types. */ |
| 53 | typedef int16_t fs_handle_t; |
51 | typedef int16_t fs_handle_t; |
| 54 | typedef int16_t dev_handle_t; |
52 | typedef int16_t dev_handle_t; |
| 55 | typedef uint32_t fs_index_t; |
53 | typedef uint32_t fs_index_t; |
| 56 | 54 | ||
| Line 79... | Line 77... | ||
| 79 | VFS_UNLINK, |
77 | VFS_UNLINK, |
| 80 | VFS_RENAME, |
78 | VFS_RENAME, |
| 81 | VFS_LAST_SRV, /* keep this the last member of this enum */ |
79 | VFS_LAST_SRV, /* keep this the last member of this enum */ |
| 82 | } vfs_request_srv_t; |
80 | } vfs_request_srv_t; |
| 83 | 81 | ||
| 84 | - | ||
| 85 | /** |
- | |
| 86 | * An instance of this structure is associated with a particular FS operation. |
- | |
| 87 | * It tells VFS if the FS supports the operation or maybe if a default one |
- | |
| 88 | * should be used. |
- | |
| 89 | */ |
- | |
| 90 | typedef enum { |
- | |
| 91 | VFS_OP_NULL = 0, |
- | |
| 92 | VFS_OP_DEFAULT, |
- | |
| 93 | VFS_OP_DEFINED |
- | |
| 94 | } vfs_op_t; |
- | |
| 95 | - | ||
| 96 | #define FS_NAME_MAXLEN 20 |
82 | #define FS_NAME_MAXLEN 20 |
| 97 | 83 | ||
| 98 | /** |
84 | /** |
| 99 | * A structure like this is passed to VFS by each individual FS upon its |
85 | * A structure like this is passed to VFS by each individual FS upon its |
| 100 | * registration. It assosiates a human-readable identifier with each |
86 | * registration. It assosiates a human-readable identifier with each |
| 101 | * registered FS. More importantly, through this structure, the FS announces |
- | |
| 102 | * what operations it supports. |
87 | * registered FS. |
| 103 | */ |
88 | */ |
| 104 | typedef struct { |
89 | typedef struct { |
| 105 | /** Unique identifier of the fs. */ |
90 | /** Unique identifier of the fs. */ |
| 106 | char name[FS_NAME_MAXLEN + 1]; |
91 | char name[FS_NAME_MAXLEN + 1]; |
| 107 | - | ||
| 108 | /** Operations. */ |
- | |
| 109 | vfs_op_t ops[VFS_LAST_CLNT - VFS_FIRST]; |
- | |
| 110 | } vfs_info_t; |
92 | } vfs_info_t; |
| 111 | 93 | ||
| 112 | /** |
94 | /** |
| 113 | * A structure like this will be allocated for each registered file system. |
95 | * A structure like this will be allocated for each registered file system. |
| 114 | */ |
96 | */ |
| Line 182... | Line 164... | ||
| 182 | * L_UNLINK is used to remove leaves from the file system namespace. This flag |
164 | * L_UNLINK is used to remove leaves from the file system namespace. This flag |
| 183 | * cannot be passed directly by the client, but will be set by VFS during |
165 | * cannot be passed directly by the client, but will be set by VFS during |
| 184 | * VFS_UNLINK. |
166 | * VFS_UNLINK. |
| 185 | */ |
167 | */ |
| 186 | #define L_UNLINK 32 |
168 | #define L_UNLINK 32 |
| 187 | /** |
- | |
| 188 | * L_PARENT performs a lookup but returns the triplet of the parent node. |
- | |
| 189 | * This flag may not be combined with any other lookup flag. |
- | |
| 190 | */ |
- | |
| 191 | #define L_PARENT 64 |
- | |
| 192 | 169 | ||
| 193 | typedef enum vfs_node_type { |
170 | typedef enum vfs_node_type { |
| 194 | VFS_NODE_UNKNOWN, |
171 | VFS_NODE_UNKNOWN, |
| 195 | VFS_NODE_FILE, |
172 | VFS_NODE_FILE, |
| 196 | VFS_NODE_DIRECTORY, |
173 | VFS_NODE_DIRECTORY, |
| Line 270... | Line 247... | ||
| 270 | 247 | ||
| 271 | extern futex_t plb_futex; /**< Futex protecting plb and plb_head. */ |
248 | extern futex_t plb_futex; /**< Futex protecting plb and plb_head. */ |
| 272 | extern uint8_t *plb; /**< Path Lookup Buffer */ |
249 | extern uint8_t *plb; /**< Path Lookup Buffer */ |
| 273 | extern link_t plb_head; /**< List of active PLB entries. */ |
250 | extern link_t plb_head; /**< List of active PLB entries. */ |
| 274 | 251 | ||
| - | 252 | #define MAX_MNTOPTS_LEN 256 |
|
| - | 253 | ||
| 275 | /** Holding this rwlock prevents changes in file system namespace. */ |
254 | /** Holding this rwlock prevents changes in file system namespace. */ |
| 276 | extern rwlock_t namespace_rwlock; |
255 | extern rwlock_t namespace_rwlock; |
| 277 | 256 | ||
| 278 | extern int vfs_grab_phone(fs_handle_t); |
257 | extern int vfs_grab_phone(fs_handle_t); |
| 279 | extern void vfs_release_phone(int); |
258 | extern void vfs_release_phone(int); |
| Line 298... | Line 277... | ||
| 298 | extern void vfs_file_delref(vfs_file_t *); |
277 | extern void vfs_file_delref(vfs_file_t *); |
| 299 | 278 | ||
| 300 | extern void vfs_node_addref(vfs_node_t *); |
279 | extern void vfs_node_addref(vfs_node_t *); |
| 301 | extern void vfs_node_delref(vfs_node_t *); |
280 | extern void vfs_node_delref(vfs_node_t *); |
| 302 | 281 | ||
| - | 282 | extern void vfs_process_pending_mount(void); |
|
| 303 | extern void vfs_register(ipc_callid_t, ipc_call_t *); |
283 | extern void vfs_register(ipc_callid_t, ipc_call_t *); |
| 304 | extern void vfs_mount(ipc_callid_t, ipc_call_t *); |
284 | extern void vfs_mount(ipc_callid_t, ipc_call_t *); |
| 305 | extern void vfs_open(ipc_callid_t, ipc_call_t *); |
285 | extern void vfs_open(ipc_callid_t, ipc_call_t *); |
| 306 | extern void vfs_close(ipc_callid_t, ipc_call_t *); |
286 | extern void vfs_close(ipc_callid_t, ipc_call_t *); |
| 307 | extern void vfs_read(ipc_callid_t, ipc_call_t *); |
287 | extern void vfs_read(ipc_callid_t, ipc_call_t *); |