Rev 2698 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2698 | Rev 2700 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | 53 | ||
54 | /** Perform a path lookup. |
54 | /** Perform a path lookup. |
55 | * |
55 | * |
56 | * @param path Path to be resolved; it needn't be an ASCIIZ string. |
56 | * @param path Path to be resolved; it needn't be an ASCIIZ string. |
57 | * @param len Number of path characters pointed by path. |
57 | * @param len Number of path characters pointed by path. |
- | 58 | * @param lflag Flags to be used during lookup. |
|
58 | * @param result Empty structure where the lookup result will be stored. |
59 | * @param result Empty structure where the lookup result will be stored. |
59 | * @param altroot If non-empty, will be used instead of rootfs as the root |
60 | * @param altroot If non-empty, will be used instead of rootfs as the root |
60 | * of the whole VFS tree. |
61 | * of the whole VFS tree. |
61 | * |
62 | * |
62 | * @return EOK on success or an error code from errno.h. |
63 | * @return EOK on success or an error code from errno.h. |
63 | */ |
64 | */ |
64 | int vfs_lookup_internal(char *path, size_t len, vfs_lookup_res_t *result, |
65 | int vfs_lookup_internal(char *path, size_t len, int lflag, |
65 | vfs_pair_t *altroot) |
66 | vfs_lookup_res_t *result, vfs_pair_t *altroot) |
66 | { |
67 | { |
67 | vfs_pair_t *root; |
68 | vfs_pair_t *root; |
68 | 69 | ||
69 | if (!len) |
70 | if (!len) |
70 | return EINVAL; |
71 | return EINVAL; |
Line 142... | Line 143... | ||
142 | memcpy(&plb[first], path, cnt1); |
143 | memcpy(&plb[first], path, cnt1); |
143 | memcpy(plb, &path[cnt1], cnt2); |
144 | memcpy(plb, &path[cnt1], cnt2); |
144 | 145 | ||
145 | ipc_call_t answer; |
146 | ipc_call_t answer; |
146 | int phone = vfs_grab_phone(root->fs_handle); |
147 | int phone = vfs_grab_phone(root->fs_handle); |
147 | aid_t req = async_send_3(phone, VFS_LOOKUP, (ipcarg_t) first, |
148 | aid_t req = async_send_4(phone, VFS_LOOKUP, (ipcarg_t) first, |
148 | (ipcarg_t) (first + len - 1) % PLB_SIZE, |
149 | (ipcarg_t) (first + len - 1) % PLB_SIZE, |
149 | (ipcarg_t) root->dev_handle, &answer); |
150 | (ipcarg_t) root->dev_handle, (ipcarg_t) lflag, &answer); |
150 | vfs_release_phone(phone); |
151 | vfs_release_phone(phone); |
151 | 152 | ||
152 | ipcarg_t rc; |
153 | ipcarg_t rc; |
153 | async_wait_for(req, &rc); |
154 | async_wait_for(req, &rc); |
154 | 155 |