/trunk/uspace/srv/fs/tmpfs/tmpfs.c |
---|
55,16 → 55,6 |
vfs_info_t tmpfs_vfs_info = { |
.name = "tmpfs", |
.ops = { |
[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_MOUNTED)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL, |
[IPC_METHOD_TO_VFS_OP(VFS_DESTROY)] = VFS_OP_DEFINED, |
} |
}; |
fs_reg_t tmpfs_reg; |
/trunk/uspace/srv/fs/fat/fat.c |
---|
49,15 → 49,6 |
vfs_info_t fat_vfs_info = { |
.name = "fat", |
.ops = { |
[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_NULL, |
[IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_NULL, |
[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL, |
[IPC_METHOD_TO_VFS_OP(VFS_MOUNTED)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL, |
} |
}; |
fs_reg_t fat_reg; |
/trunk/uspace/srv/vfs/vfs_register.c |
---|
98,30 → 98,6 |
return false; |
} |
/* |
* Check if the FS implements mandatory VFS operations. |
*/ |
if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] != VFS_OP_DEFINED) { |
dprintf("Operation VFS_LOOKUP not defined by the client.\n"); |
return false; |
} |
if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_READ)] != VFS_OP_DEFINED) { |
dprintf("Operation VFS_READ not defined by the client.\n"); |
return false; |
} |
/* |
* Check if each operation is either not defined, defined or default. |
*/ |
for (i = VFS_FIRST; i < VFS_LAST_CLNT; i++) { |
if ((info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_NULL) && |
(info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFAULT) && |
(info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFINED)) { |
dprintf("Operation info not understood.\n"); |
return false; |
} |
} |
return true; |
} |
/trunk/uspace/srv/vfs/vfs.h |
---|
47,8 → 47,6 |
#define VFS_FIRST IPC_FIRST_USER_METHOD |
#define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST) |
/* Basic types. */ |
typedef int16_t fs_handle_t; |
typedef int16_t dev_handle_t; |
81,32 → 79,16 |
VFS_LAST_SRV, /* keep this the last member of this enum */ |
} vfs_request_srv_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_NULL = 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. |
* registered FS. |
*/ |
typedef struct { |
/** Unique identifier of the fs. */ |
char name[FS_NAME_MAXLEN + 1]; |
/** Operations. */ |
vfs_op_t ops[VFS_LAST_CLNT - VFS_FIRST]; |
} vfs_info_t; |
/** |