Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/block.c

    rcde999a rb7fd2a0  
    8888} devcon_t;
    8989
    90 static int read_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);
    91 static int write_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);
     90static errno_t read_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);
     91static errno_t write_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);
    9292static aoff64_t ba_ltop(devcon_t *, aoff64_t);
    9393
     
    107107}
    108108
    109 static int devcon_add(service_id_t service_id, async_sess_t *sess,
     109static errno_t devcon_add(service_id_t service_id, async_sess_t *sess,
    110110    size_t bsize, aoff64_t dev_size, bd_t *bd)
    111111{
     
    146146}
    147147
    148 int block_init(service_id_t service_id, size_t comm_size)
     148errno_t block_init(service_id_t service_id, size_t comm_size)
    149149{
    150150        bd_t *bd;
     
    156156        }
    157157       
    158         int rc = bd_open(sess, &bd);
     158        errno_t rc = bd_open(sess, &bd);
    159159        if (rc != EOK) {
    160160                async_hangup(sess);
     
    209209}
    210210
    211 int block_bb_read(service_id_t service_id, aoff64_t ba)
     211errno_t block_bb_read(service_id_t service_id, aoff64_t ba)
    212212{
    213213        void *bb_buf;
    214         int rc;
     214        errno_t rc;
    215215
    216216        devcon_t *devcon = devcon_search(service_id);
     
    270270};
    271271
    272 int block_cache_init(service_id_t service_id, size_t size, unsigned blocks,
     272errno_t block_cache_init(service_id_t service_id, size_t size, unsigned blocks,
    273273    enum cache_mode mode)
    274274{
     
    307307}
    308308
    309 int block_cache_fini(service_id_t service_id)
     309errno_t block_cache_fini(service_id_t service_id)
    310310{
    311311        devcon_t *devcon = devcon_search(service_id);
    312312        cache_t *cache;
    313         int rc;
     313        errno_t rc;
    314314
    315315        if (!devcon)
     
    383383 * @return                      EOK on success or an error code.
    384384 */
    385 int block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)
     385errno_t block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)
    386386{
    387387        devcon_t *devcon;
     
    390390        link_t *link;
    391391        aoff64_t p_ba;
    392         int rc;
     392        errno_t rc;
    393393       
    394394        devcon = devcon_search(service_id);
     
    580580 * @return              EOK on success or an error code.
    581581 */
    582 int block_put(block_t *block)
     582errno_t block_put(block_t *block)
    583583{
    584584        devcon_t *devcon = devcon_search(block->service_id);
     
    586586        unsigned blocks_cached;
    587587        enum cache_mode mode;
    588         int rc = EOK;
     588        errno_t rc = EOK;
    589589
    590590        assert(devcon);
     
    701701 * @return              EOK on success or an error code on failure.
    702702 */
    703 int block_seqread(service_id_t service_id, void *buf, size_t *bufpos,
     703errno_t block_seqread(service_id_t service_id, void *buf, size_t *bufpos,
    704704    size_t *buflen, aoff64_t *pos, void *dst, size_t size)
    705705{
     
    735735                if (*bufpos == *buflen) {
    736736                        /* Refill the communication buffer with a new block. */
    737                         int rc;
     737                        errno_t rc;
    738738
    739739                        rc = read_blocks(devcon, *pos / block_size, 1, buf,
     
    760760 * @return              EOK on success or an error code on failure.
    761761 */
    762 int block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)
     762errno_t block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)
    763763{
    764764        devcon_t *devcon;
     
    779779 * @return              EOK on success or an error code on failure.
    780780 */
    781 int block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,
     781errno_t block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,
    782782    const void *data)
    783783{
     
    798798 * @return              EOK on success or an error code on failure.
    799799 */
    800 int block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
     800errno_t block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
    801801{
    802802        devcon_t *devcon;
     
    815815 * @return              EOK on success or an error code on failure.
    816816 */
    817 int block_get_bsize(service_id_t service_id, size_t *bsize)
     817errno_t block_get_bsize(service_id_t service_id, size_t *bsize)
    818818{
    819819        devcon_t *devcon;
     
    832832 * @return              EOK on success or an error code on failure.
    833833 */
    834 int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
     834errno_t block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
    835835{
    836836        devcon_t *devcon = devcon_search(service_id);
     
    849849 * @return              EOK on success or an error code on failure.
    850850 */
    851 int block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,
     851errno_t block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,
    852852    size_t bytes, void *data)
    853853{
    854         int rc;
     854        errno_t rc;
    855855        size_t phys_block_size;
    856856        size_t buf_size;
     
    901901 *
    902902 */
    903 int block_read_toc(service_id_t service_id, uint8_t session, void *buf,
     903errno_t block_read_toc(service_id_t service_id, uint8_t session, void *buf,
    904904    size_t bufsize)
    905905{
     
    919919 * @return              EOK on success or an error code on failure.
    920920 */
    921 static int read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,
     921static errno_t read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,
    922922    size_t size)
    923923{
    924924        assert(devcon);
    925925       
    926         int rc = bd_read_blocks(devcon->bd, ba, cnt, buf, size);
     926        errno_t rc = bd_read_blocks(devcon->bd, ba, cnt, buf, size);
    927927        if (rc != EOK) {
    928928                printf("Error %s reading %zu blocks starting at block %" PRIuOFF64
     
    946946 * @return              EOK on success or an error code on failure.
    947947 */
    948 static int write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,
     948static errno_t write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,
    949949    size_t size)
    950950{
    951951        assert(devcon);
    952952       
    953         int rc = bd_write_blocks(devcon->bd, ba, cnt, data, size);
     953        errno_t rc = bd_write_blocks(devcon->bd, ba, cnt, data, size);
    954954        if (rc != EOK) {
    955955                printf("Error %s writing %zu blocks starting at block %" PRIuOFF64
Note: See TracChangeset for help on using the changeset viewer.