Changeset 8b5690f in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c


Ignore:
Timestamp:
2011-02-03T05:11:01Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba38f72c
Parents:
22027b6e (diff), 86d7bfa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    r22027b6e r8b5690f  
    3939#include "tmpfs.h"
    4040#include "../../vfs/vfs.h"
    41 #include <ipc/ipc.h>
    4241#include <macros.h>
    4342#include <stdint.h>
     
    450449        rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    451450        if (rc != EOK) {
    452                 ipc_answer_0(rid, rc);
     451                async_answer_0(rid, rc);
    453452                return;
    454453        }
     
    459458                (void) tmpfs_node_put(rootfn);
    460459                free(opts);
    461                 ipc_answer_0(rid, EEXIST);
     460                async_answer_0(rid, EEXIST);
    462461                return;
    463462        }
     
    466465        if (!tmpfs_instance_init(devmap_handle)) {
    467466                free(opts);
    468                 ipc_answer_0(rid, ENOMEM);
     467                async_answer_0(rid, ENOMEM);
    469468                return;
    470469        }
     
    475474        if (str_cmp(opts, "restore") == 0) {
    476475                if (tmpfs_restore(devmap_handle))
    477                         ipc_answer_3(rid, EOK, rootp->index, rootp->size,
     476                        async_answer_3(rid, EOK, rootp->index, rootp->size,
    478477                            rootp->lnkcnt);
    479478                else
    480                         ipc_answer_0(rid, ELIMIT);
     479                        async_answer_0(rid, ELIMIT);
    481480        } else {
    482                 ipc_answer_3(rid, EOK, rootp->index, rootp->size,
     481                async_answer_3(rid, EOK, rootp->index, rootp->size,
    483482                    rootp->lnkcnt);
    484483        }
     
    496495
    497496        tmpfs_instance_done(devmap_handle);
    498         ipc_answer_0(rid, EOK);
     497        async_answer_0(rid, EOK);
    499498}
    500499
     
    526525        hlp = hash_table_find(&nodes, key);
    527526        if (!hlp) {
    528                 ipc_answer_0(rid, ENOENT);
     527                async_answer_0(rid, ENOENT);
    529528                return;
    530529        }
     
    538537        size_t size;
    539538        if (!async_data_read_receive(&callid, &size)) {
    540                 ipc_answer_0(callid, EINVAL);
    541                 ipc_answer_0(rid, EINVAL);
     539                async_answer_0(callid, EINVAL);
     540                async_answer_0(rid, EINVAL);
    542541                return;
    543542        }
     
    566565
    567566                if (lnk == &nodep->cs_head) {
    568                         ipc_answer_0(callid, ENOENT);
    569                         ipc_answer_1(rid, ENOENT, 0);
     567                        async_answer_0(callid, ENOENT);
     568                        async_answer_1(rid, ENOENT, 0);
    570569                        return;
    571570                }
     
    581580         * Answer the VFS_READ call.
    582581         */
    583         ipc_answer_1(rid, EOK, bytes);
     582        async_answer_1(rid, EOK, bytes);
    584583}
    585584
     
    601600        hlp = hash_table_find(&nodes, key);
    602601        if (!hlp) {
    603                 ipc_answer_0(rid, ENOENT);
     602                async_answer_0(rid, ENOENT);
    604603                return;
    605604        }
     
    613612        size_t size;
    614613        if (!async_data_write_receive(&callid, &size)) {
    615                 ipc_answer_0(callid, EINVAL);   
    616                 ipc_answer_0(rid, EINVAL);
     614                async_answer_0(callid, EINVAL);
     615                async_answer_0(rid, EINVAL);
    617616                return;
    618617        }
     
    624623                /* The file size is not changing. */
    625624                (void) async_data_write_finalize(callid, nodep->data + pos, size);
    626                 ipc_answer_2(rid, EOK, size, nodep->size);
     625                async_answer_2(rid, EOK, size, nodep->size);
    627626                return;
    628627        }
     
    637636        void *newdata = realloc(nodep->data, nodep->size + delta);
    638637        if (!newdata) {
    639                 ipc_answer_0(callid, ENOMEM);
    640                 ipc_answer_2(rid, EOK, 0, nodep->size);
     638                async_answer_0(callid, ENOMEM);
     639                async_answer_2(rid, EOK, 0, nodep->size);
    641640                return;
    642641        }
     
    646645        nodep->data = newdata;
    647646        (void) async_data_write_finalize(callid, nodep->data + pos, size);
    648         ipc_answer_2(rid, EOK, size, nodep->size);
     647        async_answer_2(rid, EOK, size, nodep->size);
    649648}
    650649
     
    665664        link_t *hlp = hash_table_find(&nodes, key);
    666665        if (!hlp) {
    667                 ipc_answer_0(rid, ENOENT);
     666                async_answer_0(rid, ENOENT);
    668667                return;
    669668        }
     
    672671       
    673672        if (size == nodep->size) {
    674                 ipc_answer_0(rid, EOK);
     673                async_answer_0(rid, EOK);
    675674                return;
    676675        }
    677676       
    678677        if (size > SIZE_MAX) {
    679                 ipc_answer_0(rid, ENOMEM);
     678                async_answer_0(rid, ENOMEM);
    680679                return;
    681680        }
     
    683682        void *newdata = realloc(nodep->data, size);
    684683        if (!newdata) {
    685                 ipc_answer_0(rid, ENOMEM);
     684                async_answer_0(rid, ENOMEM);
    686685                return;
    687686        }
     
    694693        nodep->size = size;
    695694        nodep->data = newdata;
    696         ipc_answer_0(rid, EOK);
     695        async_answer_0(rid, EOK);
    697696}
    698697
    699698void tmpfs_close(ipc_callid_t rid, ipc_call_t *request)
    700699{
    701         ipc_answer_0(rid, EOK);
     700        async_answer_0(rid, EOK);
    702701}
    703702
     
    715714        hlp = hash_table_find(&nodes, key);
    716715        if (!hlp) {
    717                 ipc_answer_0(rid, ENOENT);
     716                async_answer_0(rid, ENOENT);
    718717                return;
    719718        }
     
    721720            nh_link);
    722721        rc = tmpfs_destroy_node(FS_NODE(nodep));
    723         ipc_answer_0(rid, rc);
     722        async_answer_0(rid, rc);
    724723}
    725724
     
    740739         * thus the sync operation is a no-op.
    741740         */
    742         ipc_answer_0(rid, EOK);
     741        async_answer_0(rid, EOK);
    743742}
    744743
Note: See TracChangeset for help on using the changeset viewer.