Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c2f4b6b in mainline


Ignore:
Timestamp:
2010-11-29T20:57:10Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
b38dfd8, cead2aa
Parents:
f07f6b2
Message:

Take the VFS node's content lock as reader even during writes when it
is safe to do so - i.e. the file system supports concurrent reads/writes
and the write never modifies the node size.

File:
1 edited

Legend:

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

    rf07f6b2 rc2f4b6b  
    781781static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read)
    782782{
     783        vfs_info_t *vi;
    783784
    784785        /*
     
    807808        fibril_mutex_lock(&file->lock);
    808809
     810        vi = fs_handle_to_info(file->node->fs_handle);
     811        assert(vi);
     812
    809813        /*
    810814         * Lock the file's node so that no other client can read/write to it at
    811          * the same time.
    812          */
    813         if (read)
     815         * the same time unless the FS supports concurrent reads/writes and its
     816         * write implementation does not modify the file size.
     817         */
     818        if (read || (vi->concurrent_read_write && vi->write_retains_size))
    814819                fibril_rwlock_read_lock(&file->node->contents_rwlock);
    815820        else
     
    857862       
    858863        /* Unlock the VFS node. */
    859         if (read)
     864        if (read || (vi->concurrent_read_write && vi->write_retains_size))
    860865                fibril_rwlock_read_unlock(&file->node->contents_rwlock);
    861866        else {
Note: See TracChangeset for help on using the changeset viewer.