Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2548 → Rev 2549

/trunk/uspace/srv/vfs/vfs_register.c
289,7 → 289,6
ipc_answer_fast(callid, EINVAL, 0, 0);
ipc_answer_fast(rid, EINVAL, 0, 0);
return;
}
 
/*
/trunk/uspace/srv/vfs/vfs.h
149,7 → 149,8
 
extern int fs_name_to_handle(char *name, bool lock);
 
extern int vfs_lookup_internal(char *path, size_t len, vfs_node_t *result);
extern int vfs_lookup_internal(char *path, size_t len, vfs_node_t *result,
vfs_node_t *altroot);
 
extern void vfs_register(ipc_callid_t, ipc_call_t *);
extern void vfs_mount(ipc_callid_t, ipc_call_t *);
/trunk/uspace/srv/vfs/vfs_lookup.c
51,12 → 51,30
link_t plb_head; /**< PLB entry ring buffer. */
uint8_t *plb = NULL;
 
int vfs_lookup_internal(char *path, size_t len, vfs_node_t *result)
/** Perform a path lookup.
*
* @param path Path to be resolved; it needn't be an ASCIIZ string.
* @param len Number of path characters pointed by path.
* @param result Empty node structure where the result will be stored.
* @param altroot If non-empty, will be used instead of rootfs as the root
* of the whole VFS tree.
*
* @return EOK on success or an error code from errno.h.
*/
int vfs_lookup_internal(char *path, size_t len, vfs_node_t *result,
vfs_node_t *altroot)
{
vfs_node_t *root;
 
if (!len)
return EINVAL;
 
if (!rootfs)
if (altroot)
root = altroot;
else
root = rootfs;
 
if (!root)
return ENOENT;
futex_down(&plb_futex);
125,9 → 143,9
memcpy(plb, &path[cnt1], cnt2);
 
ipc_call_t answer;
int phone = vfs_grab_phone(rootfs->fs_handle);
int phone = vfs_grab_phone(root->fs_handle);
aid_t req = async_send_3(phone, VFS_LOOKUP, (ipcarg_t) first,
(ipcarg_t) last, (ipcarg_t) rootfs->dev_handle, &answer);
(ipcarg_t) last, (ipcarg_t) root->dev_handle, &answer);
vfs_release_phone(phone);
 
ipcarg_t rc;
135,6 → 153,11
 
futex_down(&plb_futex);
list_remove(&entry.plb_link);
/*
* Erasing the path from PLB will come handy for debugging purposes.
*/
memset(&plb[first], 0, cnt1);
memset(plb, 0, cnt2);
futex_up(&plb_futex);
 
if (rc == EOK) {