Changeset cad9c72 in mainline


Ignore:
Timestamp:
2008-01-08T21:58:58Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eb27ce5a
Parents:
861e7d1
Message:

Make a distinction between VFS operations that are common to VFS and FS
implementations, operations that are VFS only and operations that are FS
implementations only.

Location:
uspace/srv
Files:
5 edited

Legend:

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

    r861e7d1 rcad9c72  
    11/*
    22 * Copyright (c) 2006 Martin Decky
    3  * Copyright (c) 2007 Jakub Jermar
     3 * Copyright (c) 2008 Jakub Jermar
    44 * All rights reserved.
    55 *
     
    5151        .name = "fat",
    5252        .ops = {
    53                 [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED,
    54                 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED,
    55                 [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_DEFINED,
    5653                [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED,
    5754                [IPC_METHOD_TO_VFS_OP(VFS_OPEN)] = VFS_OP_DEFINED,
    58                 [IPC_METHOD_TO_VFS_OP(VFS_CREATE)] = VFS_OP_DEFINED,
    5955                [IPC_METHOD_TO_VFS_OP(VFS_CLOSE)] = VFS_OP_DEFINED,
    6056                [IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED,
    6157                [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_NULL,
    62                 [IPC_METHOD_TO_VFS_OP(VFS_SEEK)] = VFS_OP_DEFAULT
     58                [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_NULL,
     59                [IPC_METHOD_TO_VFS_OP(VFS_RENAME)] = VFS_OP_NULL,
     60                [IPC_METHOD_TO_VFS_OP(VFS_OPENDIR)] = VFS_OP_NULL,
     61                [IPC_METHOD_TO_VFS_OP(VFS_READDIR)] = VFS_OP_NULL,
     62                [IPC_METHOD_TO_VFS_OP(VFS_CLOSEDIR)] = VFS_OP_NULL,
     63                [IPC_METHOD_TO_VFS_OP(VFS_UNLINK)] = VFS_OP_NULL,
     64                [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL,
     65                [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL,
    6366        }
    6467};
     
    102105                callid = async_get_call(&call);
    103106                switch  (IPC_GET_METHOD(call)) {
    104                 case VFS_REGISTER:
    105                         ipc_answer_0(callid, EOK);
    106                         break;
    107107                case VFS_LOOKUP:
    108108                        fat_lookup(callid, &call);
  • uspace/srv/fs/tmpfs/tmpfs.c

    r861e7d1 rcad9c72  
    11/*
    22 * Copyright (c) 2006 Martin Decky
    3  * Copyright (c) 2007 Jakub Jermar
     3 * Copyright (c) 2008 Jakub Jermar
    44 * All rights reserved.
    55 *
     
    5555        .name = "tmpfs",
    5656        .ops = {
    57                 [IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] = VFS_OP_DEFINED,
    58                 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED,
    59                 [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_DEFINED,
    6057                [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED,
    6158                [IPC_METHOD_TO_VFS_OP(VFS_OPEN)] = VFS_OP_DEFINED,
    62                 [IPC_METHOD_TO_VFS_OP(VFS_CREATE)] = VFS_OP_DEFINED,
    6359                [IPC_METHOD_TO_VFS_OP(VFS_CLOSE)] = VFS_OP_DEFINED,
    6460                [IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED,
    6561                [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_DEFINED,
    66                 [IPC_METHOD_TO_VFS_OP(VFS_SEEK)] = VFS_OP_DEFAULT
     62                [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_NULL,
     63                [IPC_METHOD_TO_VFS_OP(VFS_RENAME)] = VFS_OP_NULL,
     64                [IPC_METHOD_TO_VFS_OP(VFS_OPENDIR)] = VFS_OP_NULL,
     65                [IPC_METHOD_TO_VFS_OP(VFS_READDIR)] = VFS_OP_NULL,
     66                [IPC_METHOD_TO_VFS_OP(VFS_CLOSEDIR)] = VFS_OP_NULL,
     67                [IPC_METHOD_TO_VFS_OP(VFS_UNLINK)] = VFS_OP_NULL,
     68                [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL,
     69                [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL,
    6770        }
    6871};
     
    107110                callid = async_get_call(&call);
    108111                switch  (IPC_GET_METHOD(call)) {
    109                 case VFS_REGISTER:
    110                         ipc_answer_0(callid, EOK);
    111                         break;
    112112                case VFS_LOOKUP:
    113113                        tmpfs_lookup(callid, &call);
  • uspace/srv/vfs/vfs.c

    r861e7d1 rcad9c72  
    103103                        vfs_seek(callid, &call);
    104104                        break;
     105                case VFS_TRUNCATE:
    105106                case VFS_UNMOUNT:
    106                 case VFS_CREATE:
    107107                case VFS_CLOSE:
    108108                case VFS_UNLINK:
    109109                case VFS_RENAME:
     110                case VFS_OPENDIR:
     111                case VFS_READDIR:
     112                case VFS_CLOSEDIR:
    110113                default:
    111114                        ipc_answer_0(callid, ENOTSUP);
  • uspace/srv/vfs/vfs.h

    r861e7d1 rcad9c72  
    4848
    4949typedef enum {
    50         VFS_REGISTER = VFS_FIRST,
    51         VFS_MOUNT,
    52         VFS_UNMOUNT,
    53         VFS_LOOKUP,
    54         VFS_OPEN,
    55         VFS_CREATE,
     50        VFS_OPEN = VFS_FIRST,
    5651        VFS_CLOSE,
    5752        VFS_READ,
    5853        VFS_WRITE,
     54        VFS_TRUNCATE,
     55        VFS_RENAME,
     56        VFS_OPENDIR,
     57        VFS_READDIR,
     58        VFS_CLOSEDIR,
     59        VFS_UNLINK,
     60        VFS_MOUNT,
     61        VFS_UNMOUNT,
     62        VFS_LAST_CMN,   /* keep this the last member of this enum */
     63} vfs_request_cmn_t;
     64
     65typedef enum {
     66        VFS_LOOKUP = VFS_LAST_CMN,
     67        VFS_LAST_CLNT,  /* keep this the last member of this enum */
     68} vfs_request_clnt_t;
     69
     70typedef enum {
     71        VFS_REGISTER = VFS_LAST_CMN,
    5972        VFS_SEEK,
    60         VFS_RENAME,
    61         VFS_UNLINK,
    62         VFS_LAST,               /* keep this the last member of the enum */
    63 } vfs_request_t;
     73        VFS_LAST_SRV,   /* keep this the last member of this enum */
     74} vfs_request_srv_t;
    6475
    6576
     
    8899       
    89100        /** Operations. */
    90         vfs_op_t ops[VFS_LAST - VFS_FIRST];
     101        vfs_op_t ops[VFS_LAST_CLNT - VFS_FIRST];
    91102} vfs_info_t;
    92103
  • uspace/srv/vfs/vfs_ops.c

    r861e7d1 rcad9c72  
    746746         * Check if the FS implements mandatory VFS operations.
    747747         */
    748         if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_REGISTER)] != VFS_OP_DEFINED) {
    749                 dprintf("Operation VFS_REGISTER not defined by the client.\n");
    750                 return false;
    751         }
    752         if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] != VFS_OP_DEFINED) {
    753                 dprintf("Operation VFS_MOUNT not defined by the client.\n");
    754                 return false;
    755         }
    756         if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] != VFS_OP_DEFINED) {
    757                 dprintf("Operation VFS_UNMOUNT not defined by the client.\n");
    758                 return false;
    759         }
    760748        if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] != VFS_OP_DEFINED) {
    761749                dprintf("Operation VFS_LOOKUP not defined by the client.\n");
     
    778766         * Check if each operation is either not defined, defined or default.
    779767         */
    780         for (i = VFS_FIRST; i < VFS_LAST; i++) {
     768        for (i = VFS_FIRST; i < VFS_LAST_CLNT; i++) {
    781769                if ((info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_NULL) &&
    782770                    (info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFAULT) &&
Note: See TracChangeset for help on using the changeset viewer.