Changeset 61bc901 in mainline


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.

Location:
uspace
Files:
3 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,
  • uspace/lib/libfs/libfs.h

    rd2c1fd5 r61bc901  
    7070extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *);
    7171
    72 extern bool libfs_blockread(int, void *, size_t *, size_t *, size_t *, void *,
     72extern bool libfs_blockread(int, void *, off_t *, size_t *, off_t *, void *,
    7373    size_t, size_t);
    7474
  • uspace/srv/fs/tmpfs/tmpfs_dump.c

    rd2c1fd5 r61bc901  
    6060
    6161static bool
    62 tmpfs_restore_recursion(int phone, void *block, size_t *bufpos, size_t *buflen,
    63     size_t *pos, tmpfs_dentry_t *parent)
     62tmpfs_restore_recursion(int phone, void *block, off_t *bufpos, size_t *buflen,
     63    off_t *pos, tmpfs_dentry_t *parent)
    6464{
    6565        struct rdentry entry;
     
    183183                goto error;
    184184       
    185         size_t bufpos = 0;
     185        off_t bufpos = 0;
    186186        size_t buflen = 0;
    187         size_t pos = 0;
     187        off_t pos = 0;
    188188       
    189189        char tag[6];
Note: See TracChangeset for help on using the changeset viewer.