Rev 3009 | Rev 3153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3009 | Rev 3150 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | #include <unistd.h> |
48 | #include <unistd.h> |
49 | #include <stdio.h> |
49 | #include <stdio.h> |
50 | #include <libfs.h> |
50 | #include <libfs.h> |
51 | #include "../../vfs/vfs.h" |
51 | #include "../../vfs/vfs.h" |
52 | 52 | ||
- | 53 | #define NAME "tmpfs" |
|
- | 54 | ||
53 | 55 | ||
54 | vfs_info_t tmpfs_vfs_info = { |
56 | vfs_info_t tmpfs_vfs_info = { |
55 | .name = "tmpfs", |
57 | .name = "tmpfs", |
56 | .ops = { |
58 | .ops = { |
57 | [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED, |
59 | [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED, |
Line 130... | Line 132... | ||
130 | 132 | ||
131 | int main(int argc, char **argv) |
133 | int main(int argc, char **argv) |
132 | { |
134 | { |
133 | int vfs_phone; |
135 | int vfs_phone; |
134 | 136 | ||
135 | printf("TMPFS: HelenOS TMPFS file system server.\n"); |
137 | printf(NAME ": HelenOS TMPFS file system server\n"); |
136 | 138 | ||
137 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0); |
139 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0); |
138 | while (vfs_phone < EOK) { |
140 | while (vfs_phone < EOK) { |
139 | usleep(10000); |
141 | usleep(10000); |
140 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0); |
142 | vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0); |
Line 142... | Line 144... | ||
142 | 144 | ||
143 | int rc; |
145 | int rc; |
144 | rc = fs_register(vfs_phone, &tmpfs_reg, &tmpfs_vfs_info, |
146 | rc = fs_register(vfs_phone, &tmpfs_reg, &tmpfs_vfs_info, |
145 | tmpfs_connection); |
147 | tmpfs_connection); |
146 | if (rc != EOK) { |
148 | if (rc != EOK) { |
147 | printf("Failed to register the TMPFS file system (%d)\n", rc); |
149 | printf(NAME ": Failed to register file system (%d)\n", rc); |
148 | return rc; |
150 | return rc; |
149 | } |
151 | } |
150 | 152 | ||
151 | dprintf("TMPFS filesystem registered, fs_handle=%d.\n", |
153 | printf(NAME ": Accepting connections\n"); |
152 | tmpfs_reg.fs_handle); |
- | |
153 | - | ||
154 | async_manager(); |
154 | async_manager(); |
155 | /* not reached */ |
155 | /* not reached */ |
156 | return 0; |
156 | return 0; |
157 | } |
157 | } |
158 | 158 |