Changeset 6c4eedf in mainline for uspace/lib/fdisk/src/fdisk.c
- Timestamp:
- 2017-09-13T20:14:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 120d5bc
- Parents:
- 1d40c93d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fdisk/src/fdisk.c
r1d40c93d r6c4eedf 35 35 36 36 #include <adt/list.h> 37 #include <cap.h> 37 38 #include <errno.h> 38 39 #include <fdisk.h> … … 218 219 } 219 220 220 int fdisk_dev_info_capacity(fdisk_dev_info_t *info, fdisk_cap_t *cap)221 int fdisk_dev_info_capacity(fdisk_dev_info_t *info, cap_spec_t *cap) 221 222 { 222 223 vbd_disk_info_t vinfo; … … 227 228 return EIO; 228 229 229 fdisk_cap_from_blocks(vinfo.nblocks, vinfo.block_size, cap);230 cap_from_blocks(vinfo.nblocks, vinfo.block_size, cap); 230 231 return EOK; 231 232 } … … 294 295 dev->ext_part = part; 295 296 296 fdisk_cap_from_blocks(part->nblocks, dev->dinfo.block_size,297 cap_from_blocks(part->nblocks, dev->dinfo.block_size, 297 298 &part->capacity); 298 299 part->part_id = partid; … … 535 536 } 536 537 537 int fdisk_dev_capacity(fdisk_dev_t *dev, fdisk_cap_t *cap)538 { 539 fdisk_cap_from_blocks(dev->dinfo.nblocks, dev->dinfo.block_size, cap);538 int fdisk_dev_capacity(fdisk_dev_t *dev, cap_spec_t *cap) 539 { 540 cap_from_blocks(dev->dinfo.nblocks, dev->dinfo.block_size, cap); 540 541 return EOK; 541 542 } … … 677 678 678 679 /** Get size of largest free block. */ 679 int fdisk_part_get_max_avail(fdisk_dev_t *dev, fdisk_spc_t spc, fdisk_cap_t *cap)680 int fdisk_part_get_max_avail(fdisk_dev_t *dev, fdisk_spc_t spc, cap_spec_t *cap) 680 681 { 681 682 int rc; … … 696 697 } 697 698 698 fdisk_cap_from_blocks(nb, dev->dinfo.block_size, cap);699 cap_from_blocks(nb, dev->dinfo.block_size, cap); 699 700 return EOK; 700 701 } … … 702 703 /** Get total free space capacity. */ 703 704 int fdisk_part_get_tot_avail(fdisk_dev_t *dev, fdisk_spc_t spc, 704 fdisk_cap_t *cap)705 cap_spec_t *cap) 705 706 { 706 707 fdisk_free_range_t fr; … … 724 725 } while (fdisk_free_range_next(&fr)); 725 726 726 fdisk_cap_from_blocks(totb, dev->dinfo.block_size, cap);727 cap_from_blocks(totb, dev->dinfo.block_size, cap); 727 728 return EOK; 728 729 } … … 995 996 int rc; 996 997 997 rc = fdisk_cap_to_blocks(&pspec->capacity, fcv_nom, dev->dinfo.block_size,998 rc = cap_spec_to_blocks(&pspec->capacity, cv_nom, dev->dinfo.block_size, 998 999 &nom_blocks); 999 1000 if (rc != EOK) 1000 1001 return rc; 1001 1002 1002 rc = fdisk_cap_to_blocks(&pspec->capacity, fcv_min, dev->dinfo.block_size,1003 rc = cap_spec_to_blocks(&pspec->capacity, cv_min, dev->dinfo.block_size, 1003 1004 &min_blocks); 1004 1005 if (rc != EOK) 1005 1006 return rc; 1006 1007 1007 rc = fdisk_cap_to_blocks(&pspec->capacity, fcv_max, dev->dinfo.block_size,1008 rc = cap_spec_to_blocks(&pspec->capacity, cv_max, dev->dinfo.block_size, 1008 1009 &max_blocks); 1009 1010 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.