63,6 → 63,7 |
* of the whole VFS tree. |
* |
* @return EOK on success or an error code from errno.h. |
* |
*/ |
int vfs_lookup_internal(char *path, int lflag, vfs_lookup_res_t *result, |
vfs_pair_t *altroot, ...) |
178,7 → 179,7 |
memset(plb, 0, cnt2); |
futex_up(&plb_futex); |
|
if ((rc == EOK) && result) { |
if ((rc == EOK) && (result)) { |
result->triplet.fs_handle = (fs_handle_t) IPC_GET_ARG1(answer); |
result->triplet.dev_handle = (dev_handle_t) IPC_GET_ARG2(answer); |
result->triplet.index = (fs_index_t) IPC_GET_ARG3(answer); |
195,6 → 196,41 |
return rc; |
} |
|
/** Perform a node open operation. |
* |
* @return EOK on success or an error code from errno.h. |
* |
*/ |
int vfs_open_node_internal(vfs_lookup_res_t *result) |
{ |
int phone = vfs_grab_phone(result->triplet.fs_handle); |
|
ipc_call_t answer; |
aid_t req = async_send_2(phone, VFS_OPEN_NODE, |
(ipcarg_t) result->triplet.dev_handle, |
(ipcarg_t) result->triplet.index, &answer); |
|
vfs_release_phone(phone); |
|
async_serialize_start(); |
ipcarg_t rc; |
async_wait_for(req, &rc); |
async_serialize_end(); |
|
if (rc == EOK) { |
result->size = (size_t) IPC_GET_ARG1(answer); |
result->lnkcnt = (unsigned) IPC_GET_ARG2(answer); |
if (IPC_GET_ARG3(answer) & L_FILE) |
result->type = VFS_NODE_FILE; |
else if (IPC_GET_ARG3(answer) & L_DIRECTORY) |
result->type = VFS_NODE_DIRECTORY; |
else |
result->type = VFS_NODE_UNKNOWN; |
} |
|
return rc; |
} |
|
/** |
* @} |
*/ |