Changeset 92fd52d7 in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c
- Timestamp:
- 2009-04-09T21:16:50Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7afb4a5
- Parents:
- a2c58f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
ra2c58f6 r92fd52d7 256 256 assert(hlp); 257 257 tmpfs_name_t *namep = hash_table_get_instance(hlp, tmpfs_name_t, link); 258 return !str cmp(namep->name, component);258 return !str_cmp(namep->name, component); 259 259 } 260 260 … … 320 320 return ENOMEM; 321 321 tmpfs_name_initialize(namep); 322 size_t len = strlen(nm);323 namep->name = malloc( len+ 1);322 size_t size = str_size(nm); 323 namep->name = malloc(size + 1); 324 324 if (!namep->name) { 325 325 free(namep); … … 455 455 */ 456 456 ipc_callid_t callid; 457 size_t len;458 if (!ipc_data_read_receive(&callid, & len)) {457 size_t size; 458 if (!ipc_data_read_receive(&callid, &size)) { 459 459 ipc_answer_0(callid, EINVAL); 460 460 ipc_answer_0(rid, EINVAL); … … 464 464 size_t bytes; 465 465 if (dentry->type == TMPFS_FILE) { 466 bytes = max(0, min(dentry->size - pos, len));466 bytes = max(0, min(dentry->size - pos, size)); 467 467 (void) ipc_data_read_finalize(callid, dentry->data + pos, 468 468 bytes); … … 495 495 496 496 (void) ipc_data_read_finalize(callid, namep->name, 497 str len(namep->name) + 1);497 str_size(namep->name) + 1); 498 498 bytes = 1; 499 499 } … … 528 528 */ 529 529 ipc_callid_t callid; 530 size_t len;531 if (!ipc_data_write_receive(&callid, & len)) {530 size_t size; 531 if (!ipc_data_write_receive(&callid, &size)) { 532 532 ipc_answer_0(callid, EINVAL); 533 533 ipc_answer_0(rid, EINVAL); … … 538 538 * Check whether the file needs to grow. 539 539 */ 540 if (pos + len<= dentry->size) {540 if (pos + size <= dentry->size) { 541 541 /* The file size is not changing. */ 542 (void) ipc_data_write_finalize(callid, dentry->data + pos, len);543 ipc_answer_2(rid, EOK, len, dentry->size);544 return; 545 } 546 size_t delta = (pos + len) - dentry->size;542 (void) ipc_data_write_finalize(callid, dentry->data + pos, size); 543 ipc_answer_2(rid, EOK, size, dentry->size); 544 return; 545 } 546 size_t delta = (pos + size) - dentry->size; 547 547 /* 548 548 * At this point, we are deliberately extremely straightforward and … … 562 562 dentry->size += delta; 563 563 dentry->data = newdata; 564 (void) ipc_data_write_finalize(callid, dentry->data + pos, len);565 ipc_answer_2(rid, EOK, len, dentry->size);564 (void) ipc_data_write_finalize(callid, dentry->data + pos, size); 565 ipc_answer_2(rid, EOK, size, dentry->size); 566 566 } 567 567
Note:
See TracChangeset
for help on using the changeset viewer.