Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r4cac2d69 r0055cfd  
    168168                    (nodep->index == key[NODES_KEY_INDEX]));
    169169        default:
    170                 abort();
    171         }
     170                assert((keys == 1) || (keys == 2));
     171        }
     172
     173        return 0;
    172174}
    173175
     
    439441{
    440442        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
    441        
    442         /* Accept the mount options */
    443         char *opts;
    444         int rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    445        
    446         if (rc != EOK) {
    447                 ipc_answer_0(rid, rc);
     443        fs_node_t *rootfn;
     444        int rc;
     445
     446        /* accept the mount options */
     447        ipc_callid_t callid;
     448        size_t size;
     449        if (!async_data_write_receive(&callid, &size)) {
     450                ipc_answer_0(callid, EINVAL);
     451                ipc_answer_0(rid, EINVAL);
     452                return;
     453        }
     454        char *opts = malloc(size + 1);
     455        if (!opts) {
     456                ipc_answer_0(callid, ENOMEM);
     457                ipc_answer_0(rid, ENOMEM);
     458                return;
     459        }
     460        ipcarg_t retval = async_data_write_finalize(callid, opts, size);
     461        if (retval != EOK) {
     462                ipc_answer_0(rid, retval);
     463                free(opts);
     464                return;
     465        }
     466        opts[size] = '\0';
     467
     468        /*
     469         * Check if this device is not already mounted.
     470         */
     471        rc = tmpfs_root_get(&rootfn, dev_handle);
     472        if ((rc == EOK) && (rootfn)) {
     473                (void) tmpfs_node_put(rootfn);
     474                free(opts);
     475                ipc_answer_0(rid, EEXIST);
    448476                return;
    449477        }
     
    456484        }
    457485
    458         fs_node_t *rootfn;
    459486        rc = tmpfs_root_get(&rootfn, dev_handle);
    460487        assert(rc == EOK);
Note: See TracChangeset for help on using the changeset viewer.