Changeset 2db4ac8 in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2008-01-27T16:19:25Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 15b9970
- Parents:
- 72bde81
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
r72bde81 r2db4ac8 48 48 #include <unistd.h> 49 49 #include <ctype.h> 50 #include <fcntl.h> 50 51 #include <assert.h> 51 52 #include <atomic.h> … … 292 293 size_t len; 293 294 295 if (oflag & O_CREAT) 296 lflag |= L_CREATE; 297 if (oflag & O_EXCL) 298 lflag |= L_EXCLUSIVE; 299 294 300 ipc_callid_t callid; 295 301 … … 326 332 * triplet. 327 333 */ 328 rwlock_read_lock(&namespace_rwlock); 334 if (lflag & L_CREATE) 335 rwlock_write_lock(&namespace_rwlock); 336 else 337 rwlock_read_lock(&namespace_rwlock); 329 338 330 339 /* The path is now populated and we can call vfs_lookup_internal(). */ … … 332 341 rc = vfs_lookup_internal(path, len, lflag, &lr, NULL); 333 342 if (rc) { 334 rwlock_read_unlock(&namespace_rwlock); 343 if (lflag & L_CREATE) 344 rwlock_write_unlock(&namespace_rwlock); 345 else 346 rwlock_read_unlock(&namespace_rwlock); 335 347 ipc_answer_0(rid, rc); 336 348 free(path); … … 342 354 343 355 vfs_node_t *node = vfs_node_get(&lr); 344 rwlock_read_unlock(&namespace_rwlock); 356 if (lflag & L_CREATE) 357 rwlock_write_unlock(&namespace_rwlock); 358 else 359 rwlock_read_unlock(&namespace_rwlock); 345 360 346 361 /*
Note:
See TracChangeset
for help on using the changeset viewer.