Changeset ee68e4bc in mainline


Ignore:
Timestamp:
2008-02-28T21:41:51Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1e50f81
Parents:
7fe1f75
Message:

contents_rwlock should not be acquired as a futex but rather as a rwlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    r7fe1f75 ree68e4bc  
    364364        /* Truncate the file if requested and if necessary. */
    365365        if (oflag & O_TRUNC) {
    366                 futex_down(&node->contents_rwlock);
     366                rwlock_write_lock(&node->contents_rwlock);
    367367                if (node->size) {
    368368                        rc = vfs_truncate_internal(node->fs_handle,
    369369                            node->dev_handle, node->index, 0);
    370370                        if (rc) {
    371                                 futex_up(&node->contents_rwlock);
     371                                rwlock_write_unlock(&node->contents_rwlock);
    372372                                vfs_node_put(node);
    373373                                ipc_answer_0(rid, rc);
     
    376376                        node->size = 0;
    377377                }
    378                 futex_up(&node->contents_rwlock);
     378                rwlock_write_unlock(&node->contents_rwlock);
    379379        }
    380380
Note: See TracChangeset for help on using the changeset viewer.