Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2520 → Rev 2521

/trunk/uspace/srv/vfs/vfs.c
41,6 → 41,38
#include <errno.h>
#include "vfs.h"
 
static void vfs_register(ipc_callid_t iid, ipc_call_t *icall)
{
ipc_callid_t callid;
ipc_call_t call;
 
callid = async_get_call(&call);
if (IPC_GET_METHOD(call) == IPC_M_DATA_SEND) {
size_t size = IPC_GET_ARG3(call);
if (size != sizeof(vfs_info_t)) {
/*
* The client is sending us something, which cannot be
* the info structure.
*/
ipc_answer_fast(iid, EINVAL, 0, 0);
ipc_answer_fast(callid, EINVAL, 0, 0);
return;
}
/*
* XXX: continue here
* Allocate an info structue, answer the call, check sanity
* of the copied-in info structure, ...
*/
} else {
/*
* The client doesn't obey the same protocol as we do.
*/
ipc_answer_fast(iid, EINVAL, 0, 0);
ipc_answer_fast(callid, EINVAL, 0, 0);
return;
}
}
 
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
{
ipcarg_t iarg1, iarg2;
64,6 → 96,8
*/
switch (iarg1) {
case VFS_REGISTER:
vfs_register(iid, icall);
break;
case VFS_MOUNT:
case VFS_UNMOUNT:
case VFS_OPEN:
/trunk/uspace/srv/vfs/vfs.h
34,12 → 34,38
#define VFS_VFS_H_
 
typedef enum {
VFS_REGISTER = 1,
VFS_REGISTER = 0,
VFS_MOUNT,
VFS_UNMOUNT,
VFS_OPEN
VFS_OPEN,
VFS_LAST, /* keep this the last member of the enum */
} vfs_request_t;
 
 
/**
* An instance of this structure is associated with a particular FS operation.
* It tells VFS if the FS supports the operation or maybe if a default one
* should be used.
*/
typedef enum {
VFS_OP_NOTSUP = 0,
VFS_OP_DEFAULT,
VFS_OP_DEFINED
} vfs_op_t;
 
#define FS_NAME_MAXLEN 20
 
/**
* A structure like this is passed to VFS by each individual FS upon its
* registration. It assosiates a human-readable identifier with each
* registered FS. More importantly, through this structure, the FS announces
* what operations it supports.
*/
typedef struct {
char fs_name[FS_NAME_MAXLEN]; /**< Unique identifier of the fs. */
vfs_op_t ops[VFS_LAST]; /**< Operations. */
} vfs_info_t;
 
#endif
 
/**