Changeset 472c09d in mainline for uspace/srv/fs


Ignore:
Timestamp:
2010-02-03T15:18:40Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b4cbef1
Parents:
28be7fa
Message:

more consistent naming scheme:

async_data_blob_receive → async_data_receive
async_data_string_receive → async_string_receive
CLIPBOARD_TAG_BLOB → CLIPBOARD_TAG_DATA

async_data_receive can now check the granularity of the received data
async_string_receive can now return the raw size of the received data

replace several common patterns of async_data_write_receive/_finalize
with a single async_data_receive/_string_receive (this greatly improves
code readability)

Location:
uspace/srv/fs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/devfs/devfs_ops.c

    r28be7fa r472c09d  
    419419       
    420420        /* Accept the mount options */
    421         ipcarg_t retval = async_data_string_receive(&opts, 0);
     421        ipcarg_t retval = async_string_receive(&opts, 0, NULL);
    422422        if (retval != EOK) {
    423423                ipc_answer_0(rid, retval);
  • uspace/srv/fs/fat/fat_ops.c

    r28be7fa r472c09d  
    974974        uint16_t bps;
    975975        uint16_t rde;
    976         int rc;
    977 
    978         /* accept the mount options */
    979         ipc_callid_t callid;
    980         size_t size;
    981         if (!async_data_write_receive(&callid, &size)) {
    982                 ipc_answer_0(callid, EINVAL);
    983                 ipc_answer_0(rid, EINVAL);
    984                 return;
    985         }
    986         char *opts = malloc(size + 1);
    987         if (!opts) {
    988                 ipc_answer_0(callid, ENOMEM);
    989                 ipc_answer_0(rid, ENOMEM);
    990                 return;
    991         }
    992         ipcarg_t retval = async_data_write_finalize(callid, opts, size);
    993         if (retval != EOK) {
    994                 ipc_answer_0(rid, retval);
    995                 free(opts);
    996                 return;
    997         }
    998         opts[size] = '\0';
     976       
     977        /* Accept the mount options */
     978        char *opts;
     979        int rc = async_string_receive(&opts, 0, NULL);
     980       
     981        if (rc != EOK) {
     982                ipc_answer_0(rid, rc);
     983                return;
     984        }
    999985
    1000986        /* Check for option enabling write through. */
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r28be7fa r472c09d  
    439439{
    440440        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
    441         int rc;
    442 
    443         /* accept the mount options */
    444         ipc_callid_t callid;
    445         size_t size;
    446         if (!async_data_write_receive(&callid, &size)) {
    447                 ipc_answer_0(callid, EINVAL);
    448                 ipc_answer_0(rid, EINVAL);
    449                 return;
    450         }
    451         char *opts = malloc(size + 1);
    452         if (!opts) {
    453                 ipc_answer_0(callid, ENOMEM);
    454                 ipc_answer_0(rid, ENOMEM);
    455                 return;
    456         }
    457         ipcarg_t retval = async_data_write_finalize(callid, opts, size);
    458         if (retval != EOK) {
    459                 ipc_answer_0(rid, retval);
    460                 free(opts);
    461                 return;
    462         }
    463         opts[size] = '\0';
     441       
     442        /* Accept the mount options */
     443        char *opts;
     444        int rc = async_string_receive(&opts, 0, NULL);
     445       
     446        if (rc != EOK) {
     447                ipc_answer_0(rid, rc);
     448                return;
     449        }
    464450
    465451        /* Initialize TMPFS instance. */
Note: See TracChangeset for help on using the changeset viewer.