Changeset 37e7dc54 in mainline
- Timestamp:
- 2007-09-27T15:27:53Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6c117bb
- Parents:
- bcf23cf
- Location:
- uspace/srv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat.c
rbcf23cf r37e7dc54 43 43 #include <unistd.h> 44 44 #include <stdio.h> 45 #include <as.h>> 45 46 #include "../../vfs/vfs.h" 46 47 … … 62 63 } 63 64 }; 65 66 uint8_t *plb_ro = NULL; 64 67 65 68 /** … … 142 145 143 146 /* 147 * Allocate piece of address space for PLB. 148 */ 149 plb_ro = as_get_mappable_page(PLB_SIZE); 150 if (!plb_ro) { 151 async_wait_for(req, NULL); 152 return ENOMEM; 153 } 154 155 /* 156 * Request sharing the Path Lookup Buffer with VFS. 157 */ 158 rc = ipc_call_sync_3(vfs_phone, IPC_M_AS_AREA_RECV, plb_ro, PLB_SIZE, 0, 159 NULL, NULL, NULL); 160 if (rc) { 161 async_wait_for(req, NULL); 162 return rc; 163 } 164 165 /* 144 166 * Create a connection fibril to handle the callback connection. 145 167 */ -
uspace/srv/vfs/vfs.c
rbcf23cf r37e7dc54 121 121 list_initialize(&plb_head); 122 122 plb = as_get_mappable_page(PLB_SIZE); 123 // memset(plb, 0, PLB_SIZE); 123 if (!plb) { 124 printf("Cannot allocate a mappable piece of address space\n"); 125 return ENOMEM; 126 } 127 if (as_area_create(plb, PLB_SIZE, AS_AREA_READ | AS_AREA_WRITE | 128 AS_AREA_CACHEABLE) != plb) { 129 printf("Cannot create address space area.\n"); 130 return ENOMEM; 131 } 132 memset(plb, 0, PLB_SIZE); 124 133 125 134 /* -
uspace/srv/vfs/vfs_register.c
rbcf23cf r37e7dc54 46 46 #include <bool.h> 47 47 #include <futex.h> 48 #include <as.h> 48 49 #include <libadt/list.h> 49 50 #include "vfs.h" … … 175 176 return; 176 177 } 178 179 /* 180 * Allocate and initialize a buffer for the fs_info structure. 181 */ 177 182 fs_info_t *fs_info; 178 179 /*180 * Allocate and initialize a buffer for the fs_info structure.181 */182 183 fs_info = (fs_info_t *) malloc(sizeof(fs_info_t)); 183 184 if (!fs_info) { … … 262 263 dprintf("Callback connection to FS created.\n"); 263 264 265 /* 266 * The client will want us to send him the address space area with PLB. 267 */ 268 callid = async_get_call(&call); 269 if (IPC_GET_METHOD(call) != IPC_M_AS_AREA_RECV) { 270 dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call)); 271 list_remove(&fs_info->fs_link); 272 futex_up(&fs_head_futex); 273 ipc_hangup(fs_info->phone); 274 free(fs_info); 275 ipc_answer_fast(callid, EINVAL, 0, 0); 276 ipc_answer_fast(rid, EINVAL, 0, 0); 277 return; 278 } 279 280 /* 281 * We can only send the client address space area PLB_SIZE bytes long. 282 */ 283 size = IPC_GET_ARG2(call); 284 if (size != PLB_SIZE) { 285 dprintf("Client suggests wrong size of PFB, size = %d\n", size); 286 list_remove(&fs_info->fs_link); 287 futex_up(&fs_head_futex); 288 ipc_hangup(fs_info->phone); 289 free(fs_info); 290 ipc_answer_fast(callid, EINVAL, 0, 0); 291 ipc_answer_fast(rid, EINVAL, 0, 0); 292 return; 293 294 } 295 296 /* 297 * Commit to read-only sharing the PLB with the client. 298 */ 299 ipc_answer_fast(callid, EOK, (ipcarg_t) plb, 300 (ipcarg_t) (AS_AREA_READ | AS_AREA_CACHEABLE)); 301 302 dprintf("Sharing PLB.\n"); 303 264 304 futex_up(&fs_head_futex); 265 305
Note:
See TracChangeset
for help on using the changeset viewer.