Subversion Repositories HelenOS

Rev

Rev 4484 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4484 Rev 4584
Line 67... Line 67...
67
     * Tell VFS that we are here and want to get registered.
67
     * Tell VFS that we are here and want to get registered.
68
     * We use the async framework because VFS will answer the request
68
     * We use the async framework because VFS will answer the request
69
     * out-of-order, when it knows that the operation succeeded or failed.
69
     * out-of-order, when it knows that the operation succeeded or failed.
70
     */
70
     */
71
    ipc_call_t answer;
71
    ipc_call_t answer;
72
    aid_t req = async_send_0(vfs_phone, VFS_REGISTER, &answer);
72
    aid_t req = async_send_0(vfs_phone, VFS_IN_REGISTER, &answer);
73
 
73
 
74
    /*
74
    /*
75
     * Send our VFS info structure to VFS.
75
     * Send our VFS info structure to VFS.
76
     */
76
     */
77
    int rc = ipc_data_write_start(vfs_phone, info, sizeof(*info));
77
    int rc = ipc_data_write_start(vfs_phone, info, sizeof(*info));
Line 102... Line 102...
102
        async_wait_for(req, NULL);
102
        async_wait_for(req, NULL);
103
        return rc;
103
        return rc;
104
    }
104
    }
105
     
105
     
106
    /*
106
    /*
107
     * Pick up the answer for the request to the VFS_REQUEST call.
107
     * Pick up the answer for the request to the VFS_IN_REQUEST call.
108
     */
108
     */
109
    async_wait_for(req, NULL);
109
    async_wait_for(req, NULL);
110
    reg->fs_handle = (int) IPC_GET_ARG1(answer);
110
    reg->fs_handle = (int) IPC_GET_ARG1(answer);
111
   
111
   
112
    /*
112
    /*
Line 184... Line 184...
184
        ipc_answer_0(rid, rc);
184
        ipc_answer_0(rid, rc);
185
        return;
185
        return;
186
    }
186
    }
187
   
187
   
188
    ipc_call_t answer;
188
    ipc_call_t answer;
189
    aid_t msg = async_send_1(mountee_phone, VFS_MOUNTED, mr_dev_handle,
189
    aid_t msg = async_send_1(mountee_phone, VFS_OUT_MOUNTED, mr_dev_handle,
190
        &answer);
190
        &answer);
191
    ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
191
    ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
192
    async_wait_for(msg, &rc);
192
    async_wait_for(msg, &rc);
193
   
193
   
194
    if (rc == EOK) {
194
    if (rc == EOK) {
Line 211... Line 211...
211
 *
211
 *
212
 * @param ops       libfs operations structure with function pointers to
212
 * @param ops       libfs operations structure with function pointers to
213
 *                  file system implementation
213
 *                  file system implementation
214
 * @param fs_handle File system handle of the file system where to perform
214
 * @param fs_handle File system handle of the file system where to perform
215
 *                  the lookup.
215
 *                  the lookup.
216
 * @param rid       Request ID of the VFS_LOOKUP request.
216
 * @param rid       Request ID of the VFS_OUT_LOOKUP request.
217
 * @param request   VFS_LOOKUP request data itself.
217
 * @param request   VFS_OUT_LOOKUP request data itself.
218
 *
218
 *
219
 */
219
 */
220
void libfs_lookup(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid,
220
void libfs_lookup(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid,
221
    ipc_call_t *request)
221
    ipc_call_t *request)
222
{
222
{
Line 235... Line 235...
235
    fs_node_t *par = NULL;
235
    fs_node_t *par = NULL;
236
    fs_node_t *cur = ops->root_get(dev_handle);
236
    fs_node_t *cur = ops->root_get(dev_handle);
237
    fs_node_t *tmp = NULL;
237
    fs_node_t *tmp = NULL;
238
 
238
 
239
    if (cur->mp_data.mp_active) {
239
    if (cur->mp_data.mp_active) {
240
        ipc_forward_slow(rid, cur->mp_data.phone, VFS_LOOKUP,
240
        ipc_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP,
241
            next, last, cur->mp_data.dev_handle, lflag, index,
241
            next, last, cur->mp_data.dev_handle, lflag, index,
242
            IPC_FF_ROUTE_FROM_ME);
242
            IPC_FF_ROUTE_FROM_ME);
243
        ops->node_put(cur);
243
        ops->node_put(cur);
244
        return;
244
        return;
245
    }
245
    }
Line 270... Line 270...
270
            if (next > last)
270
            if (next > last)
271
                next = last = first;
271
                next = last = first;
272
            else
272
            else
273
                next--;
273
                next--;
274
               
274
               
275
            ipc_forward_slow(rid, tmp->mp_data.phone, VFS_LOOKUP,
275
            ipc_forward_slow(rid, tmp->mp_data.phone,
276
                next, last, tmp->mp_data.dev_handle, lflag, index,
276
                VFS_OUT_LOOKUP, next, last, tmp->mp_data.dev_handle,
277
                IPC_FF_ROUTE_FROM_ME);
277
                lflag, index, IPC_FF_ROUTE_FROM_ME);
278
            ops->node_put(cur);
278
            ops->node_put(cur);
279
            ops->node_put(tmp);
279
            ops->node_put(tmp);
280
            if (par)
280
            if (par)
281
                ops->node_put(par);
281
                ops->node_put(par);
282
            return;
282
            return;
Line 430... Line 430...
430
 
430
 
431
/** Open VFS triplet.
431
/** Open VFS triplet.
432
 *
432
 *
433
 * @param ops       libfs operations structure with function pointers to
433
 * @param ops       libfs operations structure with function pointers to
434
 *                  file system implementation
434
 *                  file system implementation
435
 * @param rid       Request ID of the VFS_OPEN_NODE request.
435
 * @param rid       Request ID of the VFS_OUT_OPEN_NODE request.
436
 * @param request   VFS_OPEN_NODE request data itself.
436
 * @param request   VFS_OUT_OPEN_NODE request data itself.
437
 *
437
 *
438
 */
438
 */
439
void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid,
439
void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid,
440
    ipc_call_t *request)
440
    ipc_call_t *request)
441
{
441
{