Changeset 984a9ba in mainline for uspace/srv/fs/udf/udf_ops.c


Ignore:
Timestamp:
2018-07-05T09:34:09Z (6 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63d46341
Parents:
76f566d
Message:

do not expose the call capability handler from the async framework

Keep the call capability handler encapsulated within the async framework
and do not expose it explicitly via its API. Use the pointer to
ipc_call_t as the sole object identifying an IPC call in the code that
uses the async framework.

This plugs a major leak in the abstraction and also simplifies both the
async framework (slightly) and all IPC servers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/udf/udf_ops.c

    r76f566d r984a9ba  
    464464        udf_node_t *node = UDF_NODE(rfn);
    465465
    466         cap_call_handle_t chandle;
     466        ipc_call_t call;
    467467        size_t len = 0;
    468         if (!async_data_read_receive(&chandle, &len)) {
    469                 async_answer_0(chandle, EINVAL);
     468        if (!async_data_read_receive(&call, &len)) {
     469                async_answer_0(&call, EINVAL);
    470470                udf_node_put(rfn);
    471471                return EINVAL;
     
    475475                if (pos >= node->data_size) {
    476476                        *rbytes = 0;
    477                         async_data_read_finalize(chandle, NULL, 0);
     477                        async_data_read_finalize(&call, NULL, 0);
    478478                        udf_node_put(rfn);
    479479                        return EOK;
     
    482482                size_t read_len = 0;
    483483                if (node->data == NULL)
    484                         rc = udf_read_file(&read_len, chandle, node, pos, len);
     484                        rc = udf_read_file(&read_len, &call, node, pos, len);
    485485                else {
    486486                        /* File in allocation descriptors area */
    487487                        read_len = (len < node->data_size) ? len : node->data_size;
    488                         async_data_read_finalize(chandle, node->data + pos, read_len);
     488                        async_data_read_finalize(&call, node->data + pos, read_len);
    489489                        rc = EOK;
    490490                }
     
    505505                            fid->lenght_file_id, &node->instance->charset);
    506506
    507                         async_data_read_finalize(chandle, name, str_size(name) + 1);
     507                        async_data_read_finalize(&call, name, str_size(name) + 1);
    508508                        *rbytes = 1;
    509509                        free(name);
     
    517517                        *rbytes = 0;
    518518                        udf_node_put(rfn);
    519                         async_answer_0(chandle, ENOENT);
     519                        async_answer_0(&call, ENOENT);
    520520                        return ENOENT;
    521521                }
Note: See TracChangeset for help on using the changeset viewer.