Changeset 553492be in mainline for uspace/srv/vfs/vfs_node.c
- Timestamp:
- 2009-06-17T22:33:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ac47b7c2
- Parents:
- ca093b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_node.c
rca093b3 r553492be 39 39 #include <stdlib.h> 40 40 #include <string.h> 41 #include <futex.h>42 41 #include <fibril_sync.h> 43 42 #include <adt/hash_table.h> … … 46 45 #include <errno.h> 47 46 48 /** Futex protecting the VFS node hash table. */49 futex_t nodes_futex = FUTEX_INITIALIZER;47 /** Mutex protecting the VFS node hash table. */ 48 FIBRIL_MUTEX_INITIALIZE(nodes_mutex); 50 49 51 50 #define NODES_BUCKETS_LOG 8 … … 90 89 void vfs_node_addref(vfs_node_t *node) 91 90 { 92 f utex_down(&nodes_futex);91 fibril_mutex_lock(&nodes_mutex); 93 92 _vfs_node_addref(node); 94 f utex_up(&nodes_futex);93 fibril_mutex_unlock(&nodes_mutex); 95 94 } 96 95 … … 106 105 bool free_fs_node = false; 107 106 108 f utex_down(&nodes_futex);107 fibril_mutex_lock(&nodes_mutex); 109 108 if (node->refcnt-- == 1) { 110 109 /* … … 122 121 free_fs_node = true; 123 122 } 124 f utex_up(&nodes_futex);123 fibril_mutex_unlock(&nodes_mutex); 125 124 126 125 if (free_fs_node) { … … 162 161 vfs_node_t *node; 163 162 164 f utex_down(&nodes_futex);163 fibril_mutex_lock(&nodes_mutex); 165 164 tmp = hash_table_find(&nodes, key); 166 165 if (!tmp) { 167 166 node = (vfs_node_t *) malloc(sizeof(vfs_node_t)); 168 167 if (!node) { 169 f utex_up(&nodes_futex);168 fibril_mutex_unlock(&nodes_mutex); 170 169 return NULL; 171 170 } … … 194 193 195 194 _vfs_node_addref(node); 196 f utex_up(&nodes_futex);195 fibril_mutex_unlock(&nodes_mutex); 197 196 198 197 return node;
Note:
See TracChangeset
for help on using the changeset viewer.