Changeset 4863e50b in mainline


Ignore:
Timestamp:
2009-01-31T23:15:13Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4a10b63
Parents:
516ff92
Message:

Nuke VFS operations structure.

Location:
uspace/srv
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat.c

    r516ff92 r4863e50b  
    5050vfs_info_t fat_vfs_info = {
    5151        .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         }
    6152};
    6253
  • uspace/srv/fs/tmpfs/tmpfs.c

    r516ff92 r4863e50b  
    5656vfs_info_t tmpfs_vfs_info = {
    5757        .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         }
    6858};
    6959
  • uspace/srv/vfs/vfs.h

    r516ff92 r4863e50b  
    4848#define VFS_FIRST       IPC_FIRST_USER_METHOD
    4949
    50 #define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST)       
    51 
    5250/* Basic types. */
    5351typedef int16_t fs_handle_t;
     
    8280} vfs_request_srv_t;
    8381
    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 one
    88  * should be used.
    89  */
    90 typedef enum {
    91         VFS_OP_NULL = 0,
    92         VFS_OP_DEFAULT,
    93         VFS_OP_DEFINED
    94 } vfs_op_t;
    95 
    9682#define FS_NAME_MAXLEN  20
    9783
     
    9985 * A structure like this is passed to VFS by each individual FS upon its
    10086 * 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.
    10388 */
    10489typedef struct {
    10590        /** Unique identifier of the fs. */
    10691        char name[FS_NAME_MAXLEN + 1];
    107        
    108         /** Operations. */
    109         vfs_op_t ops[VFS_LAST_CLNT - VFS_FIRST];
    11092} vfs_info_t;
    11193
  • uspace/srv/vfs/vfs_register.c

    r516ff92 r4863e50b  
    9999        }
    100100       
    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         }
    125101        return true;
    126102}
Note: See TracChangeset for help on using the changeset viewer.