Changeset 4863e50b in mainline
- Timestamp:
- 2009-01-31T23:15:13Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4a10b63
- Parents:
- 516ff92
- Location:
- uspace/srv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat.c
r516ff92 r4863e50b 50 50 vfs_info_t fat_vfs_info = { 51 51 .name = "fat", 52 .ops = {53 [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED,54 [IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED,55 [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_NULL,56 [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_NULL,57 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL,58 [IPC_METHOD_TO_VFS_OP(VFS_MOUNTED)] = VFS_OP_DEFINED,59 [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL,60 }61 52 }; 62 53 -
uspace/srv/fs/tmpfs/tmpfs.c
r516ff92 r4863e50b 56 56 vfs_info_t tmpfs_vfs_info = { 57 57 .name = "tmpfs", 58 .ops = {59 [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED,60 [IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED,61 [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_DEFINED,62 [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_DEFINED,63 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED,64 [IPC_METHOD_TO_VFS_OP(VFS_MOUNTED)] = VFS_OP_DEFINED,65 [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL,66 [IPC_METHOD_TO_VFS_OP(VFS_DESTROY)] = VFS_OP_DEFINED,67 }68 58 }; 69 59 -
uspace/srv/vfs/vfs.h
r516ff92 r4863e50b 48 48 #define VFS_FIRST IPC_FIRST_USER_METHOD 49 49 50 #define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST)51 52 50 /* Basic types. */ 53 51 typedef int16_t fs_handle_t; … … 82 80 } vfs_request_srv_t; 83 81 84 85 /**86 * An instance of this structure is associated with a particular FS operation.87 * It tells VFS if the FS supports the operation or maybe if a default one88 * should be used.89 */90 typedef enum {91 VFS_OP_NULL = 0,92 VFS_OP_DEFAULT,93 VFS_OP_DEFINED94 } vfs_op_t;95 96 82 #define FS_NAME_MAXLEN 20 97 83 … … 99 85 * A structure like this is passed to VFS by each individual FS upon its 100 86 * registration. It assosiates a human-readable identifier with each 101 * registered FS. More importantly, through this structure, the FS announces 102 * what operations it supports. 87 * registered FS. 103 88 */ 104 89 typedef struct { 105 90 /** Unique identifier of the fs. */ 106 91 char name[FS_NAME_MAXLEN + 1]; 107 108 /** Operations. */109 vfs_op_t ops[VFS_LAST_CLNT - VFS_FIRST];110 92 } vfs_info_t; 111 93 -
uspace/srv/vfs/vfs_register.c
r516ff92 r4863e50b 99 99 } 100 100 101 102 /*103 * Check if the FS implements mandatory VFS operations.104 */105 if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] != VFS_OP_DEFINED) {106 dprintf("Operation VFS_LOOKUP not defined by the client.\n");107 return false;108 }109 if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_READ)] != VFS_OP_DEFINED) {110 dprintf("Operation VFS_READ not defined by the client.\n");111 return false;112 }113 114 /*115 * Check if each operation is either not defined, defined or default.116 */117 for (i = VFS_FIRST; i < VFS_LAST_CLNT; i++) {118 if ((info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_NULL) &&119 (info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFAULT) &&120 (info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFINED)) {121 dprintf("Operation info not understood.\n");122 return false;123 }124 }125 101 return true; 126 102 }
Note:
See TracChangeset
for help on using the changeset viewer.