Changeset 67e881c in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2017-03-30T20:59:36Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- a56cef9
- Parents:
- 79ea5af
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
r79ea5af r67e881c 585 585 } 586 586 587 int vfs_op_resize(int fd, int64_t size) 588 { 589 vfs_file_t *file = vfs_file_get(fd); 590 if (!file) 591 return EBADF; 592 593 fibril_rwlock_write_lock(&file->node->contents_rwlock); 594 595 int rc = vfs_truncate_internal(file->node->fs_handle, 596 file->node->service_id, file->node->index, size); 597 if (rc == EOK) 598 file->node->size = size; 599 600 fibril_rwlock_write_unlock(&file->node->contents_rwlock); 601 vfs_file_put(file); 602 return rc; 603 } 604 587 605 int vfs_op_stat(int fd) 588 606 { … … 652 670 653 671 return (int) rc; 654 }655 656 int vfs_op_truncate(int fd, int64_t size)657 {658 vfs_file_t *file = vfs_file_get(fd);659 if (!file)660 return EBADF;661 662 fibril_rwlock_write_lock(&file->node->contents_rwlock);663 664 int rc = vfs_truncate_internal(file->node->fs_handle,665 file->node->service_id, file->node->index, size);666 if (rc == EOK)667 file->node->size = size;668 669 fibril_rwlock_write_unlock(&file->node->contents_rwlock);670 vfs_file_put(file);671 return rc;672 672 } 673 673
Note:
See TracChangeset
for help on using the changeset viewer.