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

Changeset db6e419 in mainline for uspace/app/blkdump/blkdump.c


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/app/blkdump/blkdump.c

    re0e922d rdb6e419  
    4242#include <libblock.h>
    4343#include <mem.h>
    44 #include <devmap.h>
     44#include <loc.h>
    4545#include <byteorder.h>
    4646#include <sys/types.h>
     
    5959        int rc;
    6060        char *dev_path;
    61         devmap_handle_t handle;
     61        service_id_t service_id;
    6262        size_t block_size;
    6363        char *endptr;
     
    128128        dev_path = *argv;
    129129
    130         rc = devmap_device_get_handle(dev_path, &handle, 0);
     130        rc = loc_service_get_id(dev_path, &service_id, 0);
    131131        if (rc != EOK) {
    132132                printf(NAME ": Error resolving device `%s'.\n", dev_path);
     
    134134        }
    135135
    136         rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);
     136        rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
    137137        if (rc != EOK)  {
    138138                printf(NAME ": Error initializing libblock.\n");
     
    140140        }
    141141
    142         rc = block_get_bsize(handle, &block_size);
     142        rc = block_get_bsize(service_id, &block_size);
    143143        if (rc != EOK) {
    144144                printf(NAME ": Error determining device block size.\n");
     
    146146        }
    147147
    148         rc = block_get_nblocks(handle, &dev_nblocks);
     148        rc = block_get_nblocks(service_id, &dev_nblocks);
    149149        if (rc != EOK) {
    150150                printf(NAME ": Warning, failed to obtain block device size.\n");
     
    156156        if (data == NULL) {
    157157                printf(NAME ": Error allocating data buffer of %" PRIuOFF64 " bytes", (aoff64_t) block_size);
    158                 block_fini(handle);
     158                block_fini(service_id);
    159159                return 3;
    160160        }
     
    162162        limit = block_offset + block_count;
    163163        for (current = block_offset; current < limit; current++) {
    164                 rc = block_read_direct(handle, current, 1, data);
     164                rc = block_read_direct(service_id, current, 1, data);
    165165                if (rc != EOK) {
    166166                        printf(NAME ": Error reading block at %" PRIuOFF64 " \n", current);
     
    186186        free(data);
    187187
    188         block_fini(handle);
     188        block_fini(service_id);
    189189
    190190        return 0;
Note: See TracChangeset for help on using the changeset viewer.