Changeset c91f2d1b in mainline for uspace/lib/libblock/libblock.c


Ignore:
Timestamp:
2009-08-27T18:31:27Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cd688d9
Parents:
02ee6bf5
Message:

Enable the block_get() and block_put() APIs to return error.

File:
1 edited

Legend:

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

    r02ee6bf5 rc91f2d1b  
    313313/** Instantiate a block in memory and get a reference to it.
    314314 *
     315 * @param block                 Pointer to where the function will store the
     316 *                              block pointer on success.
    315317 * @param dev_handle            Device handle of the block device.
    316318 * @param boff                  Block offset.
     
    319321 *                              device.
    320322 *
    321  * @return                      Block structure.
    322  */
    323 block_t *block_get(dev_handle_t dev_handle, bn_t boff, int flags)
     323 * @return                      EOK on success or a negative error code.
     324 */
     325int block_get(block_t **block, dev_handle_t dev_handle, bn_t boff, int flags)
    324326{
    325327        devcon_t *devcon;
     
    450452                fibril_mutex_unlock(&b->lock);
    451453        }
    452         return b;
     454        *block = b;
     455        return EOK;
    453456}
    454457
     
    458461 *
    459462 * @param block         Block of which a reference is to be released.
    460  */
    461 void block_put(block_t *block)
     463 *
     464 * @return              EOK on success or a negative error code.
     465 */
     466int block_put(block_t *block)
    462467{
    463468        devcon_t *devcon = devcon_search(block->dev_handle);
     
    546551        fibril_mutex_unlock(&block->lock);
    547552        fibril_mutex_unlock(&cache->lock);
     553
     554        return EOK;
    548555}
    549556
Note: See TracChangeset for help on using the changeset viewer.