Changeset 2c2d54a in mainline for uspace/srv/vfs/vfs.c


Ignore:
Timestamp:
2016-09-02T17:58:05Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4c3602c4
Parents:
4bf0926e (diff), 3233adb (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 from lp:~jakub/helenos/pager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs.c

    r4bf0926e r2c2d54a  
    3737
    3838#include <vfs/vfs.h>
     39#include <stdlib.h>
    3940#include <ipc/services.h>
     41#include <abi/ipc/methods.h>
     42#include <libarch/config.h>
    4043#include <ns.h>
    4144#include <async.h>
     
    5154#define NAME  "vfs"
    5255
     56static void vfs_pager(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     57{
     58        async_answer_0(iid, EOK);
     59
     60        while (true) {
     61                ipc_call_t call;
     62                ipc_callid_t callid = async_get_call(&call);
     63               
     64                if (!IPC_GET_IMETHOD(call))
     65                        break;
     66               
     67                switch (IPC_GET_IMETHOD(call)) {
     68                case IPC_M_PAGE_IN:
     69                        vfs_page_in(callid, &call);
     70                        break;
     71                default:
     72                        async_answer_0(callid, ENOTSUP);
     73                        break;
     74                }
     75        }
     76}
     77
    5378static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    5479{
     
    150175int main(int argc, char **argv)
    151176{
     177        int rc;
     178
    152179        printf("%s: HelenOS VFS server\n", NAME);
    153180       
     
    165192         */
    166193        plb = as_area_create(AS_AREA_ANY, PLB_SIZE,
    167             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     194            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
    168195        if (plb == AS_MAP_FAILED) {
    169196                printf("%s: Cannot create address space area\n", NAME);
     
    179206
    180207        /*
     208         * Create a port for the pager.
     209         */
     210        port_id_t port;
     211        rc = async_create_port(INTERFACE_PAGER, vfs_pager, NULL, &port);
     212        if (rc != EOK)
     213                return rc;
     214               
     215        /*
    181216         * Set a connection handling function/fibril.
    182217         */
     
    192227         * Register at the naming service.
    193228         */
    194         int rc = service_register(SERVICE_VFS);
     229        rc = service_register(SERVICE_VFS);
    195230        if (rc != EOK) {
    196231                printf("%s: Cannot register VFS service\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.