Changeset 132ab5d1 in mainline for uspace/lib/block/block.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

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

    r8bfb163 r132ab5d1  
    4949#include <macros.h>
    5050#include <mem.h>
    51 #include <malloc.h>
     51#include <stdlib.h>
    5252#include <stdio.h>
    5353#include <stacktrace.h>
     54#include <str_error.h>
    5455#include <offset.h>
    5556#include <inttypes.h>
     
    380381 *                              device.
    381382 *
    382  * @return                      EOK on success or a negative error code.
     383 * @return                      EOK on success or an error code.
    383384 */
    384385int block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)
     
    577578 * @param block         Block of which a reference is to be released.
    578579 *
    579  * @return              EOK on success or a negative error code.
     580 * @return              EOK on success or an error code.
    580581 */
    581582int block_put(block_t *block)
     
    698699 * @param block_size    Block size to be used for the transfer.
    699700 *
    700  * @return              EOK on success or a negative return code on failure.
     701 * @return              EOK on success or an error code on failure.
    701702 */
    702703int block_seqread(service_id_t service_id, void *buf, size_t *bufpos,
     
    757758 * @param src           Buffer for storing the data.
    758759 *
    759  * @return              EOK on success or negative error code on failure.
     760 * @return              EOK on success or an error code on failure.
    760761 */
    761762int block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)
     
    776777 * @param src           The data to be written.
    777778 *
    778  * @return              EOK on success or negative error code on failure.
     779 * @return              EOK on success or an error code on failure.
    779780 */
    780781int block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,
     
    795796 * @param cnt           Number of blocks.
    796797 *
    797  * @return              EOK on success or negative error code on failure.
     798 * @return              EOK on success or an error code on failure.
    798799 */
    799800int block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
     
    812813 * @param bsize         Output block size.
    813814 *
    814  * @return              EOK on success or negative error code on failure.
     815 * @return              EOK on success or an error code on failure.
    815816 */
    816817int block_get_bsize(service_id_t service_id, size_t *bsize)
     
    829830 * @param nblocks       Output number of blocks.
    830831 *
    831  * @return              EOK on success or negative error code on failure.
     832 * @return              EOK on success or an error code on failure.
    832833 */
    833834int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
     
    846847 * @param data                  Buffer that receives the data
    847848 *
    848  * @return              EOK on success or negative error code on failure.
     849 * @return              EOK on success or an error code on failure.
    849850 */
    850851int block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,
     
    897898 *
    898899 * @return Allocated TOC structure.
    899  * @return EOK on success or negative error code.
     900 * @return EOK on success or an error code.
    900901 *
    901902 */
     
    916917 * @param src           Buffer for storing the data.
    917918 *
    918  * @return              EOK on success or negative error code on failure.
     919 * @return              EOK on success or an error code on failure.
    919920 */
    920921static int read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,
     
    925926        int rc = bd_read_blocks(devcon->bd, ba, cnt, buf, size);
    926927        if (rc != EOK) {
    927                 printf("Error %d reading %zu blocks starting at block %" PRIuOFF64
    928                     " from device handle %" PRIun "\n", rc, cnt, ba,
     928                printf("Error %s reading %zu blocks starting at block %" PRIuOFF64
     929                    " from device handle %" PRIun "\n", str_error_name(rc), cnt, ba,
    929930                    devcon->service_id);
    930931#ifndef NDEBUG
     
    943944 * @param src           Buffer containing the data to write.
    944945 *
    945  * @return              EOK on success or negative error code on failure.
     946 * @return              EOK on success or an error code on failure.
    946947 */
    947948static int write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,
     
    952953        int rc = bd_write_blocks(devcon->bd, ba, cnt, data, size);
    953954        if (rc != EOK) {
    954                 printf("Error %d writing %zu blocks starting at block %" PRIuOFF64
    955                     " to device handle %" PRIun "\n", rc, cnt, ba, devcon->service_id);
     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);
    956957#ifndef NDEBUG
    957958                stacktrace_print();
Note: See TracChangeset for help on using the changeset viewer.