234,6 → 234,7 |
mr_res.triplet.index = (fs_index_t) rindex; |
mr_res.size = (size_t) rsize; |
mr_res.lnkcnt = (unsigned) rlnkcnt; |
mr_res.type = VFS_NODE_DIRECTORY; |
|
rootfs.fs_handle = fs_handle; |
rootfs.dev_handle = dev_handle; |
302,6 → 303,16 |
int mode = IPC_GET_ARG3(*request); |
size_t len; |
|
/* |
* Make sure that we are called with exactly one of L_FILE and |
* L_DIRECTORY. |
*/ |
if ((lflag & (L_FILE | L_DIRECTORY)) == 0 || |
(lflag & (L_FILE | L_DIRECTORY)) == (L_FILE | L_DIRECTORY)) { |
ipc_answer_0(rid, EINVAL); |
return; |
} |
|
if (oflag & O_CREAT) |
lflag |= L_CREATE; |
if (oflag & O_EXCL) |
466,6 → 477,15 |
else |
rwlock_write_lock(&file->node->contents_rwlock); |
|
if (file->node->type == VFS_NODE_DIRECTORY) { |
/* |
* Make sure that no one is modifying the namespace |
* while we are in readdir(). |
*/ |
assert(read); |
rwlock_read_lock(&namespace_rwlock); |
} |
|
int fs_phone = vfs_grab_phone(file->node->fs_handle); |
|
/* Make a VFS_READ/VFS_WRITE request at the destination FS server. */ |
491,6 → 511,9 |
async_wait_for(msg, &rc); |
size_t bytes = IPC_GET_ARG1(answer); |
|
if (file->node->type == VFS_NODE_DIRECTORY) |
rwlock_read_unlock(&namespace_rwlock); |
|
/* Unlock the VFS node. */ |
if (read) |
rwlock_read_unlock(&file->node->contents_rwlock); |