Rev 2619 | Rev 2635 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2619 | Rev 2627 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | /** |
34 | /** |
| 35 | * @file fat.c |
35 | * @file fat.c |
| 36 | * @brief FAT file system driver for HelenOS. |
36 | * @brief FAT file system driver for HelenOS. |
| 37 | */ |
37 | */ |
| 38 | 38 | ||
| - | 39 | #include "fat.h" |
|
| 39 | #include <ipc/ipc.h> |
40 | #include <ipc/ipc.h> |
| 40 | #include <ipc/services.h> |
41 | #include <ipc/services.h> |
| 41 | #include <async.h> |
42 | #include <async.h> |
| 42 | #include <errno.h> |
43 | #include <errno.h> |
| 43 | #include <unistd.h> |
44 | #include <unistd.h> |
| 44 | #include <stdio.h> |
45 | #include <stdio.h> |
| 45 | #include <as.h> |
46 | #include <as.h> |
| 46 | #include "../../vfs/vfs.h" |
47 | #include "../../vfs/vfs.h" |
| 47 | 48 | ||
| 48 | #define dprintf(...) printf(__VA_ARGS__) |
- | |
| 49 | 49 | ||
| 50 | vfs_info_t fat_vfs_info = { |
50 | vfs_info_t fat_vfs_info = { |
| 51 | .name = "fat", |
51 | .name = "fat", |
| 52 | .ops = { |
52 | .ops = { |
| 53 | [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED, |
53 | [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED, |
| Line 77... | Line 77... | ||
| 77 | * call. In that case, a new connection fibril will be created, which in turn |
77 | * call. In that case, a new connection fibril will be created, which in turn |
| 78 | * will accept the call. Thus, a new phone will be opened for VFS. |
78 | * will accept the call. Thus, a new phone will be opened for VFS. |
| 79 | * |
79 | * |
| 80 | * There are few issues with this arrangement. First, VFS can run out of |
80 | * There are few issues with this arrangement. First, VFS can run out of |
| 81 | * available phones. In that case, VFS can close some other phones or use one |
81 | * available phones. In that case, VFS can close some other phones or use one |
| 82 | * phone for more serialized requests. Similarly, FAT can refuse to duplicate |
82 | * phone for more serialized requests. Similarily, FAT can refuse to duplicate |
| 83 | * the connection. VFS should then just make use of already existing phones and |
83 | * the connection. VFS should then just make use of already existing phones and |
| 84 | * route its requests through them. To avoid paying the fibril creation price |
84 | * route its requests through them. To avoid paying the fibril creation price |
| 85 | * upon each request, FAT might want to keep the connections open after the |
85 | * upon each request, FAT might want to keep the connections open after the |
| 86 | * request has been completed. |
86 | * request has been completed. |
| 87 | */ |
87 | */ |
| Line 101... | Line 101... | ||
| 101 | ipc_callid_t callid; |
101 | ipc_callid_t callid; |
| 102 | ipc_call_t call; |
102 | ipc_call_t call; |
| 103 | 103 | ||
| 104 | callid = async_get_call(&call); |
104 | callid = async_get_call(&call); |
| 105 | switch (IPC_GET_METHOD(call)) { |
105 | switch (IPC_GET_METHOD(call)) { |
| - | 106 | case VFS_REGISTER: |
|
| - | 107 | ipc_answer_0(callid, EOK); |
|
| - | 108 | break; |
|
| - | 109 | case VFS_LOOKUP: |
|
| - | 110 | fat_lookup(callid, &call); |
|
| - | 111 | break; |
|
| 106 | default: |
112 | default: |
| 107 | ipc_answer_0(callid, ENOTSUP); |
113 | ipc_answer_0(callid, ENOTSUP); |
| 108 | break; |
114 | break; |
| 109 | } |
115 | } |
| 110 | } |
116 | } |
| 111 | } |
117 | } |
| 112 | 118 | ||
| - | 119 | int block_read(int dev_handle, unsigned long blkno, void *buf) |
|
| - | 120 | { |
|
| - | 121 | } |
|
| - | 122 | ||
| 113 | int main(int argc, char **argv) |
123 | int main(int argc, char **argv) |
| 114 | { |
124 | { |
| 115 | int vfs_phone; |
125 | int vfs_phone; |
| 116 | 126 | ||
| 117 | printf("FAT: HelenOS FAT file system server.\n"); |
127 | printf("FAT: HelenOS FAT file system server.\n"); |