Changeset 9b1baac in mainline for uspace/srv/vfs/vfs.c


Ignore:
Timestamp:
2018-07-18T08:35:42Z (6 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b05082
Parents:
edc64c0
Message:

ns: register service interfaces individually

Each service interface is now registered individually with the naming
service. This adds a degree of type safety, potentially allows the
individual interfaces to be implemented by independent tasks and moves
the code slightly closer to the full-fledged ports design.

Broker services (e.g. the location service) can still register a
fallback port for receiving connections to all interface types
explicitly using service_register_broker().

File:
1 edited

Legend:

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

    redc64c0 r9b1baac  
    117117
    118118        /*
    119          * Create a port for the pager.
    120          */
    121         port_id_t port;
    122         errno_t rc = async_create_port(INTERFACE_PAGER, vfs_pager, NULL, &port);
    123         if (rc != EOK) {
    124                 printf("%s: Cannot create pager port: %s\n", NAME, str_error(rc));
    125                 return rc;
    126         }
    127 
    128         /*
    129          * Set a connection handling function/fibril.
    130          */
    131         async_set_fallback_port_handler(vfs_connection, NULL);
    132 
    133         /*
    134119         * Subscribe to notifications.
    135120         */
     
    140125         * Register at the naming service.
    141126         */
    142         rc = service_register(SERVICE_VFS);
     127        errno_t rc = service_register(SERVICE_VFS, INTERFACE_PAGER, vfs_pager, NULL);
    143128        if (rc != EOK) {
    144                 printf("%s: Cannot register VFS service: %s\n", NAME, str_error(rc));
     129                printf("%s: Cannot register VFS pager port: %s\n", NAME, str_error(rc));
     130                return rc;
     131        }
     132
     133        rc = service_register(SERVICE_VFS, INTERFACE_VFS, vfs_connection, NULL);
     134        if (rc != EOK) {
     135                printf("%s: Cannot register VFS file system port: %s\n", NAME, str_error(rc));
     136                return rc;
     137        }
     138
     139        rc = service_register(SERVICE_VFS, INTERFACE_VFS_DRIVER, vfs_connection, NULL);
     140        if (rc != EOK) {
     141                printf("%s: Cannot register VFS driver port: %s\n", NAME, str_error(rc));
    145142                return rc;
    146143        }
Note: See TracChangeset for help on using the changeset viewer.