Changeset 553492be in mainline
- 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
- Location:
- uspace/srv/vfs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.h
rca093b3 r553492be 37 37 #include <adt/list.h> 38 38 #include <fibril_sync.h> 39 #include <futex.h>40 39 #include <sys/types.h> 41 40 #include <devmap.h> … … 146 145 } vfs_file_t; 147 146 148 extern f utex_t nodes_futex;147 extern fibril_mutex_t nodes_mutex; 149 148 150 149 extern link_t fs_head; /**< List of registered file systems. */ … … 159 158 } plb_entry_t; 160 159 161 extern f utex_t plb_futex; /**< Futex protecting plb and plb_head. */160 extern fibril_mutex_t plb_mutex;/**< Mutex protecting plb and plb_head. */ 162 161 extern uint8_t *plb; /**< Path Lookup Buffer */ 163 162 extern link_t plb_head; /**< List of active PLB entries. */ -
uspace/srv/vfs/vfs_file.c
rca093b3 r553492be 58 58 * 59 59 * This resource being per-connection and, in the first place, per-fibril, we 60 * don't need to protect it by a futex.60 * don't need to protect it by a mutex. 61 61 */ 62 62 fibril_local vfs_file_t **files = NULL; -
uspace/srv/vfs/vfs_lookup.c
rca093b3 r553492be 43 43 #include <stdarg.h> 44 44 #include <bool.h> 45 #include <f utex.h>45 #include <fibril_sync.h> 46 46 #include <adt/list.h> 47 47 #include <vfs/canonify.h> … … 49 49 #define min(a, b) ((a) < (b) ? (a) : (b)) 50 50 51 futex_t plb_futex = FUTEX_INITIALIZER;51 FIBRIL_MUTEX_INITIALIZE(plb_mutex); 52 52 link_t plb_head; /**< PLB entry ring buffer. */ 53 53 uint8_t *plb = NULL; … … 93 93 } 94 94 95 f utex_down(&plb_futex);95 fibril_mutex_lock(&plb_mutex); 96 96 97 97 plb_entry_t entry; … … 120 120 * The buffer cannot absorb the path. 121 121 */ 122 f utex_up(&plb_futex);122 fibril_mutex_unlock(&plb_mutex); 123 123 return ELIMIT; 124 124 } … … 128 128 * The buffer cannot absorb the path. 129 129 */ 130 f utex_up(&plb_futex);130 fibril_mutex_unlock(&plb_mutex); 131 131 return ELIMIT; 132 132 } … … 147 147 list_append(&entry.plb_link, &plb_head); 148 148 149 f utex_up(&plb_futex);149 fibril_mutex_unlock(&plb_mutex); 150 150 151 151 /* … … 169 169 vfs_release_phone(phone); 170 170 171 f utex_down(&plb_futex);171 fibril_mutex_lock(&plb_mutex); 172 172 list_remove(&entry.plb_link); 173 173 /* … … 176 176 memset(&plb[first], 0, cnt1); 177 177 memset(plb, 0, cnt2); 178 f utex_up(&plb_futex);178 fibril_mutex_unlock(&plb_mutex); 179 179 180 180 if ((rc == EOK) && (result)) { -
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; -
uspace/srv/vfs/vfs_ops.c
rca093b3 r553492be 44 44 #include <string.h> 45 45 #include <bool.h> 46 #include <futex.h>47 46 #include <fibril_sync.h> 48 47 #include <adt/list.h> … … 1132 1131 */ 1133 1132 vfs_node_t *node = vfs_node_get(&lr); 1134 f utex_down(&nodes_futex);1133 fibril_mutex_lock(&nodes_mutex); 1135 1134 node->lnkcnt--; 1136 f utex_up(&nodes_futex);1135 fibril_mutex_unlock(&nodes_mutex); 1137 1136 fibril_rwlock_write_unlock(&namespace_rwlock); 1138 1137 vfs_node_put(node); … … 1283 1282 return; 1284 1283 } 1285 f utex_down(&nodes_futex);1284 fibril_mutex_lock(&nodes_mutex); 1286 1285 new_node->lnkcnt--; 1287 f utex_up(&nodes_futex);1286 fibril_mutex_unlock(&nodes_mutex); 1288 1287 break; 1289 1288 default: … … 1305 1304 return; 1306 1305 } 1307 f utex_down(&nodes_futex);1306 fibril_mutex_lock(&nodes_mutex); 1308 1307 old_node->lnkcnt++; 1309 f utex_up(&nodes_futex);1308 fibril_mutex_unlock(&nodes_mutex); 1310 1309 /* Destroy the link for the old name. */ 1311 1310 rc = vfs_lookup_internal(oldc, L_UNLINK, NULL, NULL); … … 1320 1319 return; 1321 1320 } 1322 f utex_down(&nodes_futex);1321 fibril_mutex_lock(&nodes_mutex); 1323 1322 old_node->lnkcnt--; 1324 f utex_up(&nodes_futex);1323 fibril_mutex_unlock(&nodes_mutex); 1325 1324 fibril_rwlock_write_unlock(&namespace_rwlock); 1326 1325 vfs_node_put(old_node);
Note:
See TracChangeset
for help on using the changeset viewer.