Subversion Repositories HelenOS

Rev

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

Rev 4439 Rev 4537
Line 40... Line 40...
40
#include <async.h>
40
#include <async.h>
41
#include <ipc/ipc.h>
41
#include <ipc/ipc.h>
42
#include <as.h>
42
#include <as.h>
43
#include <assert.h>
43
#include <assert.h>
44
#include <dirent.h>
44
#include <dirent.h>
-
 
45
#include <mem.h>
45
 
46
 
46
/** Register file system server.
47
/** Register file system server.
47
 *
48
 *
48
 * This function abstracts away the tedious registration protocol from
49
 * This function abstracts away the tedious registration protocol from
49
 * file system implementations and lets them to reuse this registration glue
50
 * file system implementations and lets them to reuse this registration glue
Line 206... Line 207...
206
/** Lookup VFS triplet by name in the file system name space.
207
/** Lookup VFS triplet by name in the file system name space.
207
 *
208
 *
208
 * The path passed in the PLB must be in the canonical file system path format
209
 * The path passed in the PLB must be in the canonical file system path format
209
 * as returned by the canonify() function.
210
 * as returned by the canonify() function.
210
 *
211
 *
211
 * @param ops       libfs operations structure with function pointers to
212
 * @param ops       libfs operations structure with function pointers to
212
 *          file system implementation
213
 *                  file system implementation
213
 * @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
214
 *          the lookup.
215
 *                  the lookup.
215
 * @param rid       Request ID of the VFS_LOOKUP request.
216
 * @param rid       Request ID of the VFS_LOOKUP request.
216
 * @param request   VFS_LOOKUP request data itself.
217
 * @param request   VFS_LOOKUP request data itself.
-
 
218
 *
217
 */
219
 */
218
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,
219
    ipc_call_t *request)
221
    ipc_call_t *request)
220
{
222
{
221
    unsigned first = IPC_GET_ARG1(*request);
223
    unsigned first = IPC_GET_ARG1(*request);
Line 424... Line 426...
424
        ops->node_put(cur);
426
        ops->node_put(cur);
425
    if (tmp)
427
    if (tmp)
426
        ops->node_put(tmp);
428
        ops->node_put(tmp);
427
}
429
}
428
 
430
 
-
 
431
/** Open VFS triplet.
-
 
432
 *
-
 
433
 * @param ops       libfs operations structure with function pointers to
-
 
434
 *                  file system implementation
-
 
435
 * @param rid       Request ID of the VFS_OPEN_NODE request.
-
 
436
 * @param request   VFS_OPEN_NODE request data itself.
-
 
437
 *
-
 
438
 */
-
 
439
void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid,
-
 
440
    ipc_call_t *request)
-
 
441
{
-
 
442
    dev_handle_t dev_handle = IPC_GET_ARG1(*request);
-
 
443
    fs_index_t index = IPC_GET_ARG2(*request);
-
 
444
   
-
 
445
    fs_node_t *node = ops->node_get(dev_handle, index);
-
 
446
   
-
 
447
    if (node == NULL) {
-
 
448
        ipc_answer_0(rid, ENOENT);
-
 
449
        return;
-
 
450
    }
-
 
451
   
-
 
452
    ipc_answer_5(rid, EOK, fs_handle, dev_handle, index,
-
 
453
        ops->size_get(node), ops->lnkcnt_get(node));
-
 
454
   
-
 
455
    ops->node_put(node);
-
 
456
}
-
 
457
 
429
/** @}
458
/** @}
430
 */
459
 */