Changeset 61bc901 in mainline
- Timestamp:
- 2008-08-07T21:20:54Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a61d1fc3
- Parents:
- d2c1fd5
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libfs/libfs.c
rd2c1fd5 r61bc901 334 334 #define RD_READ_BLOCK (RD_BASE + 1) 335 335 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 */ 351 bool 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) 338 353 { 339 size_t offset = 0;354 off_t offset = 0; 340 355 size_t left = size; 341 356 … … 349 364 350 365 if (rd > 0) { 366 /* 367 * Copy the contents of the communication buffer to the 368 * destination buffer. 369 */ 351 370 memcpy(dst + offset, buffer + *bufpos, rd); 352 371 offset += rd; … … 357 376 358 377 if (*bufpos == *buflen) { 378 /* Refill the communication buffer with a new block. */ 359 379 ipcarg_t retval; 360 380 int rc = async_req_2_1(phone, RD_READ_BLOCK, -
uspace/lib/libfs/libfs.h
rd2c1fd5 r61bc901 70 70 extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); 71 71 72 extern bool libfs_blockread(int, void *, size_t *, size_t *, size_t *, void *,72 extern bool libfs_blockread(int, void *, off_t *, size_t *, off_t *, void *, 73 73 size_t, size_t); 74 74 -
uspace/srv/fs/tmpfs/tmpfs_dump.c
rd2c1fd5 r61bc901 60 60 61 61 static bool 62 tmpfs_restore_recursion(int phone, void *block, size_t *bufpos, size_t *buflen,63 size_t *pos, tmpfs_dentry_t *parent)62 tmpfs_restore_recursion(int phone, void *block, off_t *bufpos, size_t *buflen, 63 off_t *pos, tmpfs_dentry_t *parent) 64 64 { 65 65 struct rdentry entry; … … 183 183 goto error; 184 184 185 size_t bufpos = 0;185 off_t bufpos = 0; 186 186 size_t buflen = 0; 187 size_t pos = 0;187 off_t pos = 0; 188 188 189 189 char tag[6];
Note:
See TracChangeset
for help on using the changeset viewer.