Changeset 61bc901 in mainline for uspace/lib/libfs/libfs.c


Ignore:
Timestamp:
2008-08-07T21:20:54Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a61d1fc3
Parents:
d2c1fd5
Message:

Add a comment to libfs_blockread() and change type from size_t to off_t at
various places.

File:
1 edited

Legend:

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

    rd2c1fd5 r61bc901  
    334334#define RD_READ_BLOCK   (RD_BASE + 1)
    335335
    336 bool libfs_blockread(int phone, void *buffer, size_t *bufpos, size_t *buflen,
    337     size_t *pos, void *dst, size_t size, size_t block_size)
     336/** Read data from a block device.
     337 *
     338 * @param phone         Phone to be used to communicate with the device.
     339 * @param buffer        Communication buffer shared with the device.
     340 * @param bufpos        Pointer to the first unread valid offset within the
     341 *                      communication buffer.
     342 * @param buflen        Pointer to the number of unread bytes that are ready in
     343 *                      the communication buffer.
     344 * @param pos           Device position to be read.
     345 * @param dst           Destination buffer.
     346 * @param size          Size of the destination buffer.
     347 * @param block_size    Block size to be used for the transfer.
     348 *
     349 * @return              True on success, false on failure.
     350 */
     351bool libfs_blockread(int phone, void *buffer, off_t *bufpos, size_t *buflen,
     352    off_t *pos, void *dst, size_t size, size_t block_size)
    338353{
    339         size_t offset = 0;
     354        off_t offset = 0;
    340355        size_t left = size;
    341356       
     
    349364               
    350365                if (rd > 0) {
     366                        /*
     367                         * Copy the contents of the communication buffer to the
     368                         * destination buffer.
     369                         */
    351370                        memcpy(dst + offset, buffer + *bufpos, rd);
    352371                        offset += rd;
     
    357376               
    358377                if (*bufpos == *buflen) {
     378                        /* Refill the communication buffer with a new block. */
    359379                        ipcarg_t retval;
    360380                        int rc = async_req_2_1(phone, RD_READ_BLOCK,
Note: See TracChangeset for help on using the changeset viewer.