Changeset b17186d in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2008-11-29T15:39:24Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dfd77382
- Parents:
- abd36f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
rabd36f7 rb17186d 235 235 mr_res.size = (size_t) rsize; 236 236 mr_res.lnkcnt = (unsigned) rlnkcnt; 237 mr_res.type = VFS_NODE_DIRECTORY; 237 238 238 239 rootfs.fs_handle = fs_handle; … … 302 303 int mode = IPC_GET_ARG3(*request); 303 304 size_t len; 305 306 /* 307 * Make sure that we are called with exactly one of L_FILE and 308 * L_DIRECTORY. 309 */ 310 if ((lflag & (L_FILE | L_DIRECTORY)) == 0 || 311 (lflag & (L_FILE | L_DIRECTORY)) == (L_FILE | L_DIRECTORY)) { 312 ipc_answer_0(rid, EINVAL); 313 return; 314 } 304 315 305 316 if (oflag & O_CREAT) … … 457 468 */ 458 469 futex_down(&file->lock); 459 470 460 471 /* 461 472 * Lock the file's node so that no other client can read/write to it at … … 466 477 else 467 478 rwlock_write_lock(&file->node->contents_rwlock); 479 480 if (file->node->type == VFS_NODE_DIRECTORY) { 481 /* 482 * Make sure that no one is modifying the namespace 483 * while we are in readdir(). 484 */ 485 assert(read); 486 rwlock_read_lock(&namespace_rwlock); 487 } 468 488 469 489 int fs_phone = vfs_grab_phone(file->node->fs_handle); … … 491 511 async_wait_for(msg, &rc); 492 512 size_t bytes = IPC_GET_ARG1(answer); 513 514 if (file->node->type == VFS_NODE_DIRECTORY) 515 rwlock_read_unlock(&namespace_rwlock); 493 516 494 517 /* Unlock the VFS node. */
Note:
See TracChangeset
for help on using the changeset viewer.