Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_fat.c

    r38d150e rb7fd2a0  
    7171 * @param max_clusters  Maximum number of clusters to visit.
    7272 *
    73  * @return              EOK on success or a negative error code.
    74  */
    75 int
     73 * @return              EOK on success or an error code.
     74 */
     75errno_t
    7676fat_cluster_walk(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc,
    7777    fat_cluster_t *lastc, uint32_t *numc, uint32_t max_clusters)
     
    8080        fat_cluster_t clst = firstc, clst_last1 = FAT_CLST_LAST1(bs);
    8181        fat_cluster_t clst_bad = FAT_CLST_BAD(bs);
    82         int rc;
     82        errno_t rc;
    8383
    8484        if (firstc == FAT_CLST_RES0) {
     
    121121 * @param flags         Flags passed to libblock.
    122122 *
    123  * @return              EOK on success or a negative error code.
    124  */
    125 int
     123 * @return              EOK on success or an error code.
     124 */
     125errno_t
    126126fat_block_get(block_t **block, struct fat_bs *bs, fat_node_t *nodep,
    127127    aoff64_t bn, int flags)
     
    130130        fat_cluster_t currc = 0;
    131131        aoff64_t relbn = bn;
    132         int rc;
     132        errno_t rc;
    133133
    134134        if (!nodep->size)
     
    186186 * @param flags         Flags passed to libblock.
    187187 *
    188  * @return              EOK on success or a negative error code.
    189  */
    190 int
     188 * @return              EOK on success or an error code.
     189 */
     190errno_t
    191191_fat_block_get(block_t **block, fat_bs_t *bs, service_id_t service_id,
    192192    fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags)
     
    195195        uint32_t max_clusters;
    196196        fat_cluster_t c = 0;
    197         int rc;
     197        errno_t rc;
    198198
    199199        /*
     
    235235 * @param pos           Position in the last node block.
    236236 *
    237  * @return              EOK on success or a negative error code.
    238  */
    239 int
     237 * @return              EOK on success or an error code.
     238 */
     239errno_t
    240240fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, aoff64_t pos)
    241241{
    242242        block_t *b;
    243243        aoff64_t o, boundary;
    244         int rc;
     244        errno_t rc;
    245245
    246246        boundary = ROUND_UP(nodep->size, BPS(bs) * SPC(bs));
     
    287287 * @param value         Output argument holding the value of the cluster.
    288288 *
    289  * @return              EOK or a negative error code.
    290  */
    291 static int
     289 * @return              EOK or an error code.
     290 */
     291static errno_t
    292292fat_get_cluster_fat12(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    293293    fat_cluster_t clst, fat_cluster_t *value)
     
    296296        uint16_t byte1, byte2;
    297297        aoff64_t offset;
    298         int rc;
     298        errno_t rc;
    299299
    300300        offset = (clst + clst / 2);
     
    357357 * @param value         Output argument holding the value of the cluster.
    358358 *
    359  * @return              EOK or a negative error code.
    360  */
    361 static int
     359 * @return              EOK or an error code.
     360 */
     361static errno_t
    362362fat_get_cluster_fat16(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    363363    fat_cluster_t clst, fat_cluster_t *value)
     
    365365        block_t *b;
    366366        aoff64_t offset;
    367         int rc;
     367        errno_t rc;
    368368
    369369        offset = (clst * FAT16_CLST_SIZE);
     
    388388 * @param value         Output argument holding the value of the cluster.
    389389 *
    390  * @return              EOK or a negative error code.
    391  */
    392 static int
     390 * @return              EOK or an error code.
     391 */
     392static errno_t
    393393fat_get_cluster_fat32(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    394394    fat_cluster_t clst, fat_cluster_t *value)
     
    396396        block_t *b;
    397397        aoff64_t offset;
    398         int rc;
     398        errno_t rc;
    399399
    400400        offset = (clst * FAT32_CLST_SIZE);
     
    421421 * @param value         Output argument holding the value of the cluster.
    422422 *
    423  * @return              EOK or a negative error code.
    424  */
    425 int
     423 * @return              EOK or an error code.
     424 */
     425errno_t
    426426fat_get_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    427427    fat_cluster_t clst, fat_cluster_t *value)
    428428{
    429         int rc;
     429        errno_t rc;
    430430
    431431        assert(fatno < FATCNT(bs));
     
    449449 * @param value         Value to set the cluster with.
    450450 *
    451  * @return              EOK on success or a negative error code.
    452  */
    453 static int
     451 * @return              EOK on success or an error code.
     452 */
     453static errno_t
    454454fat_set_cluster_fat12(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    455455    fat_cluster_t clst, fat_cluster_t value)
     
    458458        aoff64_t offset;
    459459        uint16_t byte1, byte2;
    460         int rc;
     460        errno_t rc;
    461461
    462462        offset = (clst + clst / 2);
     
    537537 * @param value         Value to set the cluster with.
    538538 *
    539  * @return              EOK on success or a negative error code.
    540  */
    541 static int
     539 * @return              EOK on success or an error code.
     540 */
     541static errno_t
    542542fat_set_cluster_fat16(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    543543    fat_cluster_t clst, fat_cluster_t value)
     
    545545        block_t *b;
    546546        aoff64_t offset;
    547         int rc;
     547        errno_t rc;
    548548
    549549        offset = (clst * FAT16_CLST_SIZE);
     
    570570 * @param value         Value to set the cluster with.
    571571 *
    572  * @return              EOK on success or a negative error code.
    573  */
    574 static int
     572 * @return              EOK on success or an error code.
     573 */
     574static errno_t
    575575fat_set_cluster_fat32(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    576576    fat_cluster_t clst, fat_cluster_t value)
     
    578578        block_t *b;
    579579        aoff64_t offset;
    580         int rc;
     580        errno_t rc;
    581581        fat_cluster_t temp;
    582582
     
    607607 * @param value         Value to set the cluster with.
    608608 *
    609  * @return              EOK on success or a negative error code.
    610  */
    611 int
     609 * @return              EOK on success or an error code.
     610 */
     611errno_t
    612612fat_set_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
    613613    fat_cluster_t clst, fat_cluster_t value)
    614614{
    615         int rc;
     615        errno_t rc;
    616616
    617617        assert(fatno < FATCNT(bs));
     
    634634 * @param nclsts        Number of clusters in the lifo chain.
    635635 *
    636  * @return              EOK on success or a negative error code.
    637  */
    638 int fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id,
     636 * @return              EOK on success or an error code.
     637 */
     638errno_t fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id,
    639639    fat_cluster_t *lifo, unsigned nclsts)
    640640{
     
    642642        unsigned c;
    643643        fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs);
    644         int rc;
     644        errno_t rc;
    645645
    646646        for (fatno = FAT1 + 1; fatno < FATCNT(bs); fatno++) {
     
    671671 *                      will be returned.
    672672 *
    673  * @return              EOK on success, a negative error code otherwise.
    674  */
    675 int
     673 * @return              EOK on success, an error code otherwise.
     674 */
     675errno_t
    676676fat_alloc_clusters(fat_bs_t *bs, service_id_t service_id, unsigned nclsts,
    677677    fat_cluster_t *mcl, fat_cluster_t *lcl)
     
    682682        fat_cluster_t value = 0;
    683683        fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs);
    684         int rc = EOK;
     684        errno_t rc = EOK;
    685685
    686686        lifo = (fat_cluster_t *) malloc(nclsts * sizeof(fat_cluster_t));
     
    742742 * @param firstc        First cluster in the chain which is to be freed.
    743743 *
    744  * @return              EOK on success or a negative return code.
    745  */
    746 int
     744 * @return              EOK on success or an error code.
     745 */
     746errno_t
    747747fat_free_clusters(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc)
    748748{
     
    750750        fat_cluster_t nextc = 0;
    751751        fat_cluster_t clst_bad = FAT_CLST_BAD(bs);
    752         int rc;
     752        errno_t rc;
    753753
    754754        /* Mark all clusters in the chain as free in all copies of FAT. */
     
    780780 * @param lcl           Last cluster of the cluster chain to append.
    781781 *
    782  * @return              EOK on success or a negative error code.
    783  */
    784 int fat_append_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl,
     782 * @return              EOK on success or an error code.
     783 */
     784errno_t fat_append_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl,
    785785    fat_cluster_t lcl)
    786786{
     
    788788        fat_cluster_t lastc = 0;
    789789        uint8_t fatno;
    790         int rc;
     790        errno_t rc;
    791791
    792792        if (nodep->firstc == FAT_CLST_RES0) {
     
    827827 *                      be chopped off.
    828828 *
    829  * @return              EOK on success or a negative return code.
    830  */
    831 int fat_chop_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lcl)
     829 * @return              EOK on success or an error code.
     830 */
     831errno_t fat_chop_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lcl)
    832832{
    833833        fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs);
    834         int rc;
     834        errno_t rc;
    835835        service_id_t service_id = nodep->idx->service_id;
    836836
     
    880880}
    881881
    882 int
     882errno_t
    883883fat_zero_cluster(struct fat_bs *bs, service_id_t service_id, fat_cluster_t c)
    884884{
    885885        int i;
    886886        block_t *b;
    887         int rc;
     887        errno_t rc;
    888888
    889889        for (i = 0; i < SPC(bs); i++) {
     
    908908 * does not contain a fat file system.
    909909 */
    910 int fat_sanity_check(fat_bs_t *bs, service_id_t service_id)
     910errno_t fat_sanity_check(fat_bs_t *bs, service_id_t service_id)
    911911{
    912912        fat_cluster_t e0 = 0;
    913913        fat_cluster_t e1 = 0;
    914914        unsigned fat_no;
    915         int rc;
     915        errno_t rc;
    916916
    917917        /* Check number of FATs. */
Note: See TracChangeset for help on using the changeset viewer.