Rev 4268 | Rev 4306 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4268 | Rev 4305 | ||
---|---|---|---|
Line 397... | Line 397... | ||
397 | 397 | ||
398 | void tmpfs_mounted(ipc_callid_t rid, ipc_call_t *request) |
398 | void tmpfs_mounted(ipc_callid_t rid, ipc_call_t *request) |
399 | { |
399 | { |
400 | dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
400 | dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
401 | 401 | ||
- | 402 | /* accept the mount options */ |
|
- | 403 | ipc_callid_t callid; |
|
- | 404 | size_t size; |
|
- | 405 | if (!ipc_data_write_receive(&callid, &size)) { |
|
- | 406 | ipc_answer_0(callid, EINVAL); |
|
- | 407 | ipc_answer_0(rid, EINVAL); |
|
- | 408 | return; |
|
- | 409 | } |
|
- | 410 | char *opts = malloc(size + 1); |
|
- | 411 | if (!opts) { |
|
- | 412 | ipc_answer_0(callid, ENOMEM); |
|
- | 413 | ipc_answer_0(rid, ENOMEM); |
|
- | 414 | return; |
|
- | 415 | } |
|
- | 416 | ipcarg_t retval = ipc_data_write_finalize(callid, opts, size); |
|
- | 417 | if (retval != EOK) { |
|
- | 418 | ipc_answer_0(rid, retval); |
|
- | 419 | free(opts); |
|
- | 420 | return; |
|
- | 421 | } |
|
- | 422 | opts[size] = '\0'; |
|
- | 423 | ||
402 | /* Initialize TMPFS. */ |
424 | /* Initialize TMPFS. */ |
403 | if (!root && !tmpfs_init()) { |
425 | if (!root && !tmpfs_init()) { |
404 | ipc_answer_0(rid, ENOMEM); |
426 | ipc_answer_0(rid, ENOMEM); |
405 | return; |
427 | return; |
406 | } |
428 | } |
407 | 429 | ||
408 | if (dev_handle >= 0) { |
430 | if (str_cmp(opts, "restore") == 0) { |
409 | if (tmpfs_restore(dev_handle)) |
431 | if (tmpfs_restore(dev_handle)) |
410 | ipc_answer_3(rid, EOK, root->index, root->size, |
432 | ipc_answer_3(rid, EOK, root->index, root->size, |
411 | root->lnkcnt); |
433 | root->lnkcnt); |
412 | else |
434 | else |
413 | ipc_answer_0(rid, ELIMIT); |
435 | ipc_answer_0(rid, ELIMIT); |