Changeset c24b0dcb in mainline for uspace/lib/fdisk/src/fdisk.c
- Timestamp:
- 2019-09-30T16:38:33Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8f57fb2
- Parents:
- ef0a3375
- git-author:
- Jakub Jermar <jakub@…> (2019-09-30 16:34:10)
- git-committer:
- Jakub Jermar <jakub@…> (2019-09-30 16:38:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fdisk/src/fdisk.c
ref0a3375 rc24b0dcb 35 35 36 36 #include <adt/list.h> 37 #include <cap .h>37 #include <capa.h> 38 38 #include <errno.h> 39 39 #include <fdisk.h> … … 219 219 } 220 220 221 errno_t fdisk_dev_info_capacity(fdisk_dev_info_t *info, cap _spec_t *cap)221 errno_t fdisk_dev_info_capacity(fdisk_dev_info_t *info, capa_spec_t *capa) 222 222 { 223 223 vbd_disk_info_t vinfo; … … 228 228 return EIO; 229 229 230 cap _from_blocks(vinfo.nblocks, vinfo.block_size, cap);230 capa_from_blocks(vinfo.nblocks, vinfo.block_size, capa); 231 231 return EOK; 232 232 } … … 295 295 dev->ext_part = part; 296 296 297 cap _from_blocks(part->nblocks, dev->dinfo.block_size,297 capa_from_blocks(part->nblocks, dev->dinfo.block_size, 298 298 &part->capacity); 299 299 part->part_id = partid; … … 536 536 } 537 537 538 errno_t fdisk_dev_capacity(fdisk_dev_t *dev, cap _spec_t *cap)539 { 540 cap _from_blocks(dev->dinfo.nblocks, dev->dinfo.block_size, cap);538 errno_t fdisk_dev_capacity(fdisk_dev_t *dev, capa_spec_t *capa) 539 { 540 capa_from_blocks(dev->dinfo.nblocks, dev->dinfo.block_size, capa); 541 541 return EOK; 542 542 } … … 679 679 680 680 /** Get size of largest free block. */ 681 errno_t fdisk_part_get_max_avail(fdisk_dev_t *dev, fdisk_spc_t spc, cap_spec_t *cap) 681 errno_t fdisk_part_get_max_avail(fdisk_dev_t *dev, fdisk_spc_t spc, 682 capa_spec_t *capa) 682 683 { 683 684 errno_t rc; … … 698 699 } 699 700 700 cap _from_blocks(nb, dev->dinfo.block_size, cap);701 capa_from_blocks(nb, dev->dinfo.block_size, capa); 701 702 return EOK; 702 703 } … … 704 705 /** Get total free space capacity. */ 705 706 errno_t fdisk_part_get_tot_avail(fdisk_dev_t *dev, fdisk_spc_t spc, 706 cap _spec_t *cap)707 capa_spec_t *capa) 707 708 { 708 709 fdisk_free_range_t fr; … … 726 727 } while (fdisk_free_range_next(&fr)); 727 728 728 cap _from_blocks(totb, dev->dinfo.block_size, cap);729 capa_from_blocks(totb, dev->dinfo.block_size, capa); 729 730 return EOK; 730 731 } … … 938 939 errno_t rc; 939 940 940 rc = cap _to_blocks(&pspec->capacity, cv_nom, dev->dinfo.block_size,941 rc = capa_to_blocks(&pspec->capacity, cv_nom, dev->dinfo.block_size, 941 942 &nom_blocks); 942 943 if (rc != EOK) 943 944 return rc; 944 945 945 rc = cap _to_blocks(&pspec->capacity, cv_min, dev->dinfo.block_size,946 rc = capa_to_blocks(&pspec->capacity, cv_min, dev->dinfo.block_size, 946 947 &min_blocks); 947 948 if (rc != EOK) 948 949 return rc; 949 950 950 rc = cap _to_blocks(&pspec->capacity, cv_max, dev->dinfo.block_size,951 rc = capa_to_blocks(&pspec->capacity, cv_max, dev->dinfo.block_size, 951 952 &max_blocks); 952 953 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.