Changeset 984a9ba in mainline for uspace/srv/fs/cdfs/cdfs_ops.c


Ignore:
Timestamp:
2018-07-05T09:34:09Z (7 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/cdfs/cdfs_ops.c

    r76f566d r984a9ba  
    12731273        }
    12741274
    1275         cap_call_handle_t chandle;
     1275        ipc_call_t call;
    12761276        size_t len;
    1277         if (!async_data_read_receive(&chandle, &len)) {
    1278                 async_answer_0(chandle, EINVAL);
     1277        if (!async_data_read_receive(&call, &len)) {
     1278                async_answer_0(&call, EINVAL);
    12791279                return EINVAL;
    12801280        }
     
    12831283                if (pos >= node->size) {
    12841284                        *rbytes = 0;
    1285                         async_data_read_finalize(chandle, NULL, 0);
     1285                        async_data_read_finalize(&call, NULL, 0);
    12861286                } else {
    12871287                        cdfs_lba_t lba = pos / BLOCK_SIZE;
     
    12951295                            BLOCK_FLAGS_NONE);
    12961296                        if (rc != EOK) {
    1297                                 async_answer_0(chandle, rc);
     1297                                async_answer_0(&call, rc);
    12981298                                return rc;
    12991299                        }
    13001300
    1301                         async_data_read_finalize(chandle, block->data + offset,
     1301                        async_data_read_finalize(&call, block->data + offset,
    13021302                            *rbytes);
    13031303                        rc = block_put(block);
     
    13081308                link_t *link = list_nth(&node->cs_list, pos);
    13091309                if (link == NULL) {
    1310                         async_answer_0(chandle, ENOENT);
     1310                        async_answer_0(&call, ENOENT);
    13111311                        return ENOENT;
    13121312                }
     
    13161316
    13171317                *rbytes = 1;
    1318                 async_data_read_finalize(chandle, dentry->name,
     1318                async_data_read_finalize(&call, dentry->name,
    13191319                    str_size(dentry->name) + 1);
    13201320        }
Note: See TracChangeset for help on using the changeset viewer.