Rev 2520 | Rev 2523 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2520 | Rev 2521 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <ipc/services.h> |
39 | #include <ipc/services.h> |
40 | #include <async.h> |
40 | #include <async.h> |
41 | #include <errno.h> |
41 | #include <errno.h> |
42 | #include "vfs.h" |
42 | #include "vfs.h" |
43 | 43 | ||
- | 44 | static void vfs_register(ipc_callid_t iid, ipc_call_t *icall) |
|
- | 45 | { |
|
- | 46 | ipc_callid_t callid; |
|
- | 47 | ipc_call_t call; |
|
- | 48 | ||
- | 49 | callid = async_get_call(&call); |
|
- | 50 | if (IPC_GET_METHOD(call) == IPC_M_DATA_SEND) { |
|
- | 51 | size_t size = IPC_GET_ARG3(call); |
|
- | 52 | if (size != sizeof(vfs_info_t)) { |
|
- | 53 | /* |
|
- | 54 | * The client is sending us something, which cannot be |
|
- | 55 | * the info structure. |
|
- | 56 | */ |
|
- | 57 | ipc_answer_fast(iid, EINVAL, 0, 0); |
|
- | 58 | ipc_answer_fast(callid, EINVAL, 0, 0); |
|
- | 59 | return; |
|
- | 60 | } |
|
- | 61 | /* |
|
- | 62 | * XXX: continue here |
|
- | 63 | * Allocate an info structue, answer the call, check sanity |
|
- | 64 | * of the copied-in info structure, ... |
|
- | 65 | */ |
|
- | 66 | } else { |
|
- | 67 | /* |
|
- | 68 | * The client doesn't obey the same protocol as we do. |
|
- | 69 | */ |
|
- | 70 | ipc_answer_fast(iid, EINVAL, 0, 0); |
|
- | 71 | ipc_answer_fast(callid, EINVAL, 0, 0); |
|
- | 72 | return; |
|
- | 73 | } |
|
- | 74 | } |
|
- | 75 | ||
44 | static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall) |
76 | static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall) |
45 | { |
77 | { |
46 | ipcarg_t iarg1, iarg2; |
78 | ipcarg_t iarg1, iarg2; |
47 | 79 | ||
48 | /* |
80 | /* |
Line 62... | Line 94... | ||
62 | * Or, the connection is a regular connection from a client that wants |
94 | * Or, the connection is a regular connection from a client that wants |
63 | * us to do something for it (e.g. open a file, mount a fs etc.). |
95 | * us to do something for it (e.g. open a file, mount a fs etc.). |
64 | */ |
96 | */ |
65 | switch (iarg1) { |
97 | switch (iarg1) { |
66 | case VFS_REGISTER: |
98 | case VFS_REGISTER: |
- | 99 | vfs_register(iid, icall); |
|
- | 100 | break; |
|
67 | case VFS_MOUNT: |
101 | case VFS_MOUNT: |
68 | case VFS_UNMOUNT: |
102 | case VFS_UNMOUNT: |
69 | case VFS_OPEN: |
103 | case VFS_OPEN: |
70 | default: |
104 | default: |
71 | ipc_answer_fast(iid, ENOTSUP, 0, 0); |
105 | ipc_answer_fast(iid, ENOTSUP, 0, 0); |