Changeset 925a21e in mainline for uspace/app/blkdump/blkdump.c
- Timestamp:
- 2011-09-24T14:20:29Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bf76c1
- Parents:
- 867e2555 (diff), 1ab4aca (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/blkdump/blkdump.c
r867e2555 r925a21e 42 42 #include <libblock.h> 43 43 #include <mem.h> 44 #include < devmap.h>44 #include <loc.h> 45 45 #include <byteorder.h> 46 46 #include <sys/types.h> … … 59 59 int rc; 60 60 char *dev_path; 61 devmap_handle_t handle;61 service_id_t service_id; 62 62 size_t block_size; 63 63 char *endptr; … … 128 128 dev_path = *argv; 129 129 130 rc = devmap_device_get_handle(dev_path, &handle, 0);130 rc = loc_service_get_id(dev_path, &service_id, 0); 131 131 if (rc != EOK) { 132 132 printf(NAME ": Error resolving device `%s'.\n", dev_path); … … 134 134 } 135 135 136 rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);136 rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048); 137 137 if (rc != EOK) { 138 138 printf(NAME ": Error initializing libblock.\n"); … … 140 140 } 141 141 142 rc = block_get_bsize( handle, &block_size);142 rc = block_get_bsize(service_id, &block_size); 143 143 if (rc != EOK) { 144 144 printf(NAME ": Error determining device block size.\n"); … … 146 146 } 147 147 148 rc = block_get_nblocks( handle, &dev_nblocks);148 rc = block_get_nblocks(service_id, &dev_nblocks); 149 149 if (rc != EOK) { 150 150 printf(NAME ": Warning, failed to obtain block device size.\n"); … … 156 156 if (data == NULL) { 157 157 printf(NAME ": Error allocating data buffer of %" PRIuOFF64 " bytes", (aoff64_t) block_size); 158 block_fini( handle);158 block_fini(service_id); 159 159 return 3; 160 160 } … … 162 162 limit = block_offset + block_count; 163 163 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); 165 165 if (rc != EOK) { 166 166 printf(NAME ": Error reading block at %" PRIuOFF64 " \n", current); … … 186 186 free(data); 187 187 188 block_fini( handle);188 block_fini(service_id); 189 189 190 190 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.