Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2011-08-16T18:53:00Z (10 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master
Children:
49160c4
Parents:
e0e922d (diff), 45058baa (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/bd/part/mbr_part/mbr_part.c

    re0e922d rdb6e419  
    6161#include <as.h>
    6262#include <fibril_synch.h>
    63 #include <devmap.h>
     63#include <loc.h>
    6464#include <sys/types.h>
    6565#include <sys/typefmt.h>
    6666#include <inttypes.h>
    6767#include <libblock.h>
    68 #include <devmap.h>
    6968#include <errno.h>
    7069#include <bool.h>
     
    10099        aoff64_t length;
    101100        /** Device representing the partition (outbound device) */
    102         devmap_handle_t dev;
     101        service_id_t dsid;
    103102        /** Points to next partition structure. */
    104103        struct part *next;
     
    141140
    142141/** Partitioned device (inbound device) */
    143 static devmap_handle_t indev_handle;
     142static service_id_t indef_sid;
    144143
    145144/** List of partitions. This structure is an empty head. */
     
    180179        int i;
    181180        char *name;
    182         devmap_handle_t dev;
     181        service_id_t dsid;
    183182        uint64_t size_mb;
    184183        part_t *part;
    185184
    186         rc = devmap_device_get_handle(dev_name, &indev_handle, 0);
     185        rc = loc_service_get_id(dev_name, &indef_sid, 0);
    187186        if (rc != EOK) {
    188187                printf(NAME ": could not resolve device `%s'.\n", dev_name);
     
    190189        }
    191190
    192         rc = block_init(EXCHANGE_SERIALIZE, indev_handle, 2048);
     191        rc = block_init(EXCHANGE_SERIALIZE, indef_sid, 2048);
    193192        if (rc != EOK)  {
    194193                printf(NAME ": could not init libblock.\n");
     
    198197        /* Determine and verify block size. */
    199198
    200         rc = block_get_bsize(indev_handle, &block_size);
     199        rc = block_get_bsize(indef_sid, &block_size);
    201200        if (rc != EOK) {
    202201                printf(NAME ": error getting block size.\n");
     
    214213                return rc;
    215214
    216         /* Register the driver with device mapper. */
    217         rc = devmap_driver_register(NAME, mbr_connection);
     215        /* Register server with location service. */
     216        rc = loc_server_register(NAME, mbr_connection);
    218217        if (rc != EOK) {
    219                 printf(NAME ": Unable to register driver.\n");
     218                printf(NAME ": Unable to register server.\n");
    220219                return rc;
    221220        }
     
    239238                        return ENOMEM;
    240239
    241                 rc = devmap_device_register(name, &dev);
     240                rc = loc_service_register(name, &dsid);
    242241                if (rc != EOK) {
    243                         printf(NAME ": Unable to register device %s.\n", name);
     242                        printf(NAME ": Unable to register service %s.\n", name);
    244243                        return rc;
    245244                }
     
    250249                    "%" PRIu64 " MB.\n", name, part->length, size_mb);
    251250
    252                 part->dev = dev;
     251                part->dsid = dsid;
    253252                free(name);
    254253
     
    281280         */
    282281
    283         rc = block_read_direct(indev_handle, 0, 1, brb);
     282        rc = block_read_direct(indef_sid, 0, 1, brb);
    284283        if (rc != EOK) {
    285284                printf(NAME ": Failed reading MBR block.\n");
     
    332331                 */
    333332                ba = cp.start_addr;
    334                 rc = block_read_direct(indev_handle, ba, 1, brb);
     333                rc = block_read_direct(indef_sid, ba, 1, brb);
    335334                if (rc != EOK) {
    336335                        printf(NAME ": Failed reading EBR block at %"
     
    381380        part->present = (pte->ptype != PT_UNUSED) ? true : false;
    382381
    383         part->dev = 0;
     382        part->dsid = 0;
    384383        part->next = NULL;
    385384}
     
    392391        ipc_call_t call;
    393392        sysarg_t method;
    394         devmap_handle_t dh;
     393        service_id_t dh;
    395394        unsigned int flags;
    396395        int retval;
     
    408407         */
    409408        part = plist_head.next;
    410         while (part != NULL && part->dev != dh)
     409        while (part != NULL && part->dsid != dh)
    411410                part = part->next;
    412411
     
    488487                return ELIMIT;
    489488
    490         return block_read_direct(indev_handle, gba, cnt, buf);
     489        return block_read_direct(indef_sid, gba, cnt, buf);
    491490}
    492491
     
    499498                return ELIMIT;
    500499
    501         return block_write_direct(indev_handle, gba, cnt, buf);
     500        return block_write_direct(indef_sid, gba, cnt, buf);
    502501}
    503502
Note: See TracChangeset for help on using the changeset viewer.