Changeset f57f8ea in mainline for uspace/srv/vfs/vfs_rdwr.c


Ignore:
Timestamp:
2008-01-02T20:25:24Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9413c0d
Parents:
215e375
Message:

Rename unlink_futex to namespace_futex and introduce a new futex for serializing
concurrent access to a VFS node's contents by multiple clients.

File:
1 edited

Legend:

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

    r215e375 rf57f8ea  
    4040#include <async.h>
    4141#include <errno.h>
     42#include <futex.h>
    4243
    4344static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read)
     
    8182        }
    8283
     84        /*
     85         * Lock the file's node so that no other client can read/write to it at
     86         * the same time.
     87         */
     88        futex_down(&file->node->contents_futex);
     89
    8390        int fs_phone = vfs_grab_phone(file->node->fs_handle);   
    8491       
     
    109116
    110117        /*
     118         * Unlock the VFS node.
     119         */
     120        futex_up(&file->node->contents_futex);
     121
     122        /*
    111123         * Update the position pointer.
    112124         */
Note: See TracChangeset for help on using the changeset viewer.