Ignore:
File:
1 edited

Legend:

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

    rcde999a r7354b5e  
    4949#include <macros.h>
    5050#include <mem.h>
    51 #include <stdlib.h>
     51#include <malloc.h>
    5252#include <stdio.h>
    5353#include <stacktrace.h>
    54 #include <str_error.h>
    5554#include <offset.h>
    5655#include <inttypes.h>
     
    381380 *                              device.
    382381 *
    383  * @return                      EOK on success or an error code.
     382 * @return                      EOK on success or a negative error code.
    384383 */
    385384int block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)
     
    578577 * @param block         Block of which a reference is to be released.
    579578 *
    580  * @return              EOK on success or an error code.
     579 * @return              EOK on success or a negative error code.
    581580 */
    582581int block_put(block_t *block)
     
    699698 * @param block_size    Block size to be used for the transfer.
    700699 *
    701  * @return              EOK on success or an error code on failure.
     700 * @return              EOK on success or a negative return code on failure.
    702701 */
    703702int block_seqread(service_id_t service_id, void *buf, size_t *bufpos,
     
    758757 * @param src           Buffer for storing the data.
    759758 *
    760  * @return              EOK on success or an error code on failure.
     759 * @return              EOK on success or negative error code on failure.
    761760 */
    762761int block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)
     
    777776 * @param src           The data to be written.
    778777 *
    779  * @return              EOK on success or an error code on failure.
     778 * @return              EOK on success or negative error code on failure.
    780779 */
    781780int block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,
     
    796795 * @param cnt           Number of blocks.
    797796 *
    798  * @return              EOK on success or an error code on failure.
     797 * @return              EOK on success or negative error code on failure.
    799798 */
    800799int block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
     
    813812 * @param bsize         Output block size.
    814813 *
    815  * @return              EOK on success or an error code on failure.
     814 * @return              EOK on success or negative error code on failure.
    816815 */
    817816int block_get_bsize(service_id_t service_id, size_t *bsize)
     
    830829 * @param nblocks       Output number of blocks.
    831830 *
    832  * @return              EOK on success or an error code on failure.
     831 * @return              EOK on success or negative error code on failure.
    833832 */
    834833int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
     
    847846 * @param data                  Buffer that receives the data
    848847 *
    849  * @return              EOK on success or an error code on failure.
     848 * @return              EOK on success or negative error code on failure.
    850849 */
    851850int block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,
     
    898897 *
    899898 * @return Allocated TOC structure.
    900  * @return EOK on success or an error code.
     899 * @return EOK on success or negative error code.
    901900 *
    902901 */
     
    917916 * @param src           Buffer for storing the data.
    918917 *
    919  * @return              EOK on success or an error code on failure.
     918 * @return              EOK on success or negative error code on failure.
    920919 */
    921920static int read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,
     
    926925        int rc = bd_read_blocks(devcon->bd, ba, cnt, buf, size);
    927926        if (rc != EOK) {
    928                 printf("Error %s reading %zu blocks starting at block %" PRIuOFF64
    929                     " from device handle %" PRIun "\n", str_error_name(rc), cnt, ba,
     927                printf("Error %d reading %zu blocks starting at block %" PRIuOFF64
     928                    " from device handle %" PRIun "\n", rc, cnt, ba,
    930929                    devcon->service_id);
    931930#ifndef NDEBUG
     
    944943 * @param src           Buffer containing the data to write.
    945944 *
    946  * @return              EOK on success or an error code on failure.
     945 * @return              EOK on success or negative error code on failure.
    947946 */
    948947static int write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,
     
    953952        int rc = bd_write_blocks(devcon->bd, ba, cnt, data, size);
    954953        if (rc != EOK) {
    955                 printf("Error %s writing %zu blocks starting at block %" PRIuOFF64
    956                     " to device handle %" PRIun "\n", str_error_name(rc), cnt, ba, devcon->service_id);
     954                printf("Error %d writing %zu blocks starting at block %" PRIuOFF64
     955                    " to device handle %" PRIun "\n", rc, cnt, ba, devcon->service_id);
    957956#ifndef NDEBUG
    958957                stacktrace_print();
Note: See TracChangeset for help on using the changeset viewer.