Rev 2709 | Rev 2734 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2709 | Rev 2710 | ||
---|---|---|---|
Line 368... | Line 368... | ||
368 | ipc_answer_0(rid, fd); |
368 | ipc_answer_0(rid, fd); |
369 | return; |
369 | return; |
370 | } |
370 | } |
371 | vfs_file_t *file = vfs_file_get(fd); |
371 | vfs_file_t *file = vfs_file_get(fd); |
372 | file->node = node; |
372 | file->node = node; |
373 | if (oflag & O_APPEND) |
373 | if (oflag & O_APPEND) |
374 | file->append = true; |
374 | file->append = true; |
375 | 375 | ||
376 | /* |
376 | /* |
377 | * The following increase in reference count is for the fact that the |
377 | * The following increase in reference count is for the fact that the |
378 | * file is being opened and that a file structure is pointing to it. |
378 | * file is being opened and that a file structure is pointing to it. |
Line 468... | Line 468... | ||
468 | /* Unlock the VFS node. */ |
468 | /* Unlock the VFS node. */ |
469 | if (read) |
469 | if (read) |
470 | rwlock_read_unlock(&file->node->contents_rwlock); |
470 | rwlock_read_unlock(&file->node->contents_rwlock); |
471 | else { |
471 | else { |
472 | /* Update the cached version of node's size. */ |
472 | /* Update the cached version of node's size. */ |
- | 473 | if (rc == EOK) |
|
473 | file->node->size = IPC_GET_ARG2(answer); |
474 | file->node->size = IPC_GET_ARG2(answer); |
474 | rwlock_write_unlock(&file->node->contents_rwlock); |
475 | rwlock_write_unlock(&file->node->contents_rwlock); |
475 | } |
476 | } |
476 | 477 | ||
477 | /* Update the position pointer and unlock the open file. */ |
478 | /* Update the position pointer and unlock the open file. */ |
- | 479 | if (rc == EOK) |
|
478 | file->pos += bytes; |
480 | file->pos += bytes; |
479 | futex_up(&file->lock); |
481 | futex_up(&file->lock); |
480 | 482 | ||
481 | /* |
483 | /* |
482 | * FS server's reply is the final result of the whole operation we |
484 | * FS server's reply is the final result of the whole operation we |
483 | * return to the client. |
485 | * return to the client. |