Changeset 15f3c3f in mainline for uspace/srv/bd/part


Ignore:
Timestamp:
2011-06-22T22:00:52Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86ffa27f
Parents:
ef09a7a
Message:

Rename devmap to loc, devfs to locfs.

Location:
uspace/srv/bd/part
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/part/guid_part/guid_part.c

    ref09a7a r15f3c3f  
    5151#include <as.h>
    5252#include <fibril_synch.h>
    53 #include <devmap.h>
     53#include <loc.h>
    5454#include <sys/types.h>
    5555#include <sys/typefmt.h>
    5656#include <inttypes.h>
    5757#include <libblock.h>
    58 #include <devmap.h>
     58#include <loc.h>
    5959#include <errno.h>
    6060#include <bool.h>
     
    8181        /** Number of blocks */
    8282        aoff64_t length;
    83         /** Device representing the partition (outbound device) */
    84         devmap_handle_t dev;
     83        /** Service representing the partition (outbound device) */
     84        service_id_t dsid;
    8585        /** Points to next partition structure. */
    8686        struct part *next;
     
    9090
    9191/** Partitioned device (inbound device) */
    92 static devmap_handle_t indev_handle;
     92static service_id_t indev_sid;
    9393
    9494/** List of partitions. This structure is an empty head. */
     
    129129        int i;
    130130        char *name;
    131         devmap_handle_t dev;
     131        service_id_t dsid;
    132132        uint64_t size_mb;
    133133        part_t *part;
    134134
    135         rc = devmap_device_get_handle(dev_name, &indev_handle, 0);
     135        rc = loc_service_get_id(dev_name, &indev_sid, 0);
    136136        if (rc != EOK) {
    137137                printf(NAME ": could not resolve device `%s'.\n", dev_name);
     
    139139        }
    140140
    141         rc = block_init(EXCHANGE_SERIALIZE, indev_handle, 2048);
     141        rc = block_init(EXCHANGE_SERIALIZE, indev_sid, 2048);
    142142        if (rc != EOK)  {
    143143                printf(NAME ": could not init libblock.\n");
     
    147147        /* Determine and verify block size. */
    148148
    149         rc = block_get_bsize(indev_handle, &block_size);
     149        rc = block_get_bsize(indev_sid, &block_size);
    150150        if (rc != EOK) {
    151151                printf(NAME ": error getting block size.\n");
     
    163163                return rc;
    164164
    165         /* Register the driver with device mapper. */
    166         rc = devmap_driver_register(NAME, gpt_connection);
     165        /* Register server with location service. */
     166        rc = loc_server_register(NAME, gpt_connection);
    167167        if (rc != EOK) {
    168                 printf(NAME ": Unable to register driver.\n");
     168                printf(NAME ": Unable to register server.\n");
    169169                return rc;
    170170        }
     
    188188                        return ENOMEM;
    189189
    190                 rc = devmap_device_register(name, &dev);
     190                rc = loc_service_register(name, &dsid);
    191191                if (rc != EOK) {
    192                         printf(NAME ": Unable to register device %s.\n", name);
     192                        printf(NAME ": Unable to register service %s.\n", name);
    193193                        return rc;
    194194                }
     
    199199                    "%" PRIuOFF64 " MB.\n", name, part->length, size_mb);
    200200
    201                 part->dev = dev;
     201                part->dsid = dsid;
    202202                free(name);
    203203
     
    228228        }
    229229
    230         rc = block_read_direct(indev_handle, GPT_HDR_BA, 1, gpt_hdr);
     230        rc = block_read_direct(indev_sid, GPT_HDR_BA, 1, gpt_hdr);
    231231        if (rc != EOK) {
    232232                printf(NAME ": Failed reading GPT header block.\n");
     
    256256        }
    257257
    258         rc = block_read_direct(indev_handle, ba, bcnt, etable);
     258        rc = block_read_direct(indev_sid, ba, bcnt, etable);
    259259        if (rc != EOK) {
    260260                printf(NAME ": Failed reading GPT entries.\n");
     
    303303        }
    304304
    305         part->dev = 0;
     305        part->dsid = 0;
    306306        part->next = NULL;
    307307}
     
    314314        ipc_call_t call;
    315315        sysarg_t method;
    316         devmap_handle_t dh;
     316        service_id_t dh;
    317317        unsigned int flags;
    318318        int retval;
     
    330330         */
    331331        part = plist_head.next;
    332         while (part != NULL && part->dev != dh)
     332        while (part != NULL && part->dsid != dh)
    333333                part = part->next;
    334334
     
    410410                return ELIMIT;
    411411
    412         return block_read_direct(indev_handle, gba, cnt, buf);
     412        return block_read_direct(indev_sid, gba, cnt, buf);
    413413}
    414414
     
    421421                return ELIMIT;
    422422
    423         return block_write_direct(indev_handle, gba, cnt, buf);
     423        return block_write_direct(indev_sid, gba, cnt, buf);
    424424}
    425425
  • uspace/srv/bd/part/mbr_part/mbr_part.c

    ref09a7a r15f3c3f  
    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>
     68#include <loc.h>
    6969#include <errno.h>
    7070#include <bool.h>
     
    100100        aoff64_t length;
    101101        /** Device representing the partition (outbound device) */
    102         devmap_handle_t dev;
     102        service_id_t dsid;
    103103        /** Points to next partition structure. */
    104104        struct part *next;
     
    141141
    142142/** Partitioned device (inbound device) */
    143 static devmap_handle_t indev_handle;
     143static service_id_t indef_sid;
    144144
    145145/** List of partitions. This structure is an empty head. */
     
    180180        int i;
    181181        char *name;
    182         devmap_handle_t dev;
     182        service_id_t dsid;
    183183        uint64_t size_mb;
    184184        part_t *part;
    185185
    186         rc = devmap_device_get_handle(dev_name, &indev_handle, 0);
     186        rc = loc_service_get_id(dev_name, &indef_sid, 0);
    187187        if (rc != EOK) {
    188188                printf(NAME ": could not resolve device `%s'.\n", dev_name);
     
    190190        }
    191191
    192         rc = block_init(EXCHANGE_SERIALIZE, indev_handle, 2048);
     192        rc = block_init(EXCHANGE_SERIALIZE, indef_sid, 2048);
    193193        if (rc != EOK)  {
    194194                printf(NAME ": could not init libblock.\n");
     
    198198        /* Determine and verify block size. */
    199199
    200         rc = block_get_bsize(indev_handle, &block_size);
     200        rc = block_get_bsize(indef_sid, &block_size);
    201201        if (rc != EOK) {
    202202                printf(NAME ": error getting block size.\n");
     
    214214                return rc;
    215215
    216         /* Register the driver with device mapper. */
    217         rc = devmap_driver_register(NAME, mbr_connection);
     216        /* Register server with location service. */
     217        rc = loc_server_register(NAME, mbr_connection);
    218218        if (rc != EOK) {
    219                 printf(NAME ": Unable to register driver.\n");
     219                printf(NAME ": Unable to register server.\n");
    220220                return rc;
    221221        }
     
    239239                        return ENOMEM;
    240240
    241                 rc = devmap_device_register(name, &dev);
     241                rc = loc_service_register(name, &dsid);
    242242                if (rc != EOK) {
    243                         printf(NAME ": Unable to register device %s.\n", name);
     243                        printf(NAME ": Unable to register service %s.\n", name);
    244244                        return rc;
    245245                }
     
    250250                    "%" PRIu64 " MB.\n", name, part->length, size_mb);
    251251
    252                 part->dev = dev;
     252                part->dsid = dsid;
    253253                free(name);
    254254
     
    281281         */
    282282
    283         rc = block_read_direct(indev_handle, 0, 1, brb);
     283        rc = block_read_direct(indef_sid, 0, 1, brb);
    284284        if (rc != EOK) {
    285285                printf(NAME ": Failed reading MBR block.\n");
     
    332332                 */
    333333                ba = cp.start_addr;
    334                 rc = block_read_direct(indev_handle, ba, 1, brb);
     334                rc = block_read_direct(indef_sid, ba, 1, brb);
    335335                if (rc != EOK) {
    336336                        printf(NAME ": Failed reading EBR block at %"
     
    381381        part->present = (pte->ptype != PT_UNUSED) ? true : false;
    382382
    383         part->dev = 0;
     383        part->dsid = 0;
    384384        part->next = NULL;
    385385}
     
    392392        ipc_call_t call;
    393393        sysarg_t method;
    394         devmap_handle_t dh;
     394        service_id_t dh;
    395395        unsigned int flags;
    396396        int retval;
     
    408408         */
    409409        part = plist_head.next;
    410         while (part != NULL && part->dev != dh)
     410        while (part != NULL && part->dsid != dh)
    411411                part = part->next;
    412412
     
    488488                return ELIMIT;
    489489
    490         return block_read_direct(indev_handle, gba, cnt, buf);
     490        return block_read_direct(indef_sid, gba, cnt, buf);
    491491}
    492492
     
    499499                return ELIMIT;
    500500
    501         return block_write_direct(indev_handle, gba, cnt, buf);
     501        return block_write_direct(indef_sid, gba, cnt, buf);
    502502}
    503503
Note: See TracChangeset for help on using the changeset viewer.