Ignore:
File:
1 edited

Legend:

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

    r15f3c3f r4979403  
    5555        .concurrent_read_write = false,
    5656        .write_retains_size = false,
     57        .instance = 0,
    5758};
    58 
    59 fs_reg_t locfs_reg;
    60 
    61 static void locfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    62 {
    63         if (iid)
    64                 async_answer_0(iid, EOK);
    65        
    66         while (true) {
    67                 ipc_call_t call;
    68                 ipc_callid_t callid = async_get_call(&call);
    69                
    70                 if (!IPC_GET_IMETHOD(call))
    71                         return;
    72                
    73                 switch (IPC_GET_IMETHOD(call)) {
    74                 case VFS_OUT_MOUNTED:
    75                         locfs_mounted(callid, &call);
    76                         break;
    77                 case VFS_OUT_MOUNT:
    78                         locfs_mount(callid, &call);
    79                         break;
    80                 case VFS_OUT_UNMOUNTED:
    81                         locfs_unmounted(callid, &call);
    82                         break;
    83                 case VFS_OUT_UNMOUNT:
    84                         locfs_unmount(callid, &call);
    85                         break;
    86                 case VFS_OUT_LOOKUP:
    87                         locfs_lookup(callid, &call);
    88                         break;
    89                 case VFS_OUT_OPEN_NODE:
    90                         locfs_open_node(callid, &call);
    91                         break;
    92                 case VFS_OUT_STAT:
    93                         locfs_stat(callid, &call);
    94                         break;
    95                 case VFS_OUT_READ:
    96                         locfs_read(callid, &call);
    97                         break;
    98                 case VFS_OUT_WRITE:
    99                         locfs_write(callid, &call);
    100                         break;
    101                 case VFS_OUT_TRUNCATE:
    102                         locfs_truncate(callid, &call);
    103                         break;
    104                 case VFS_OUT_CLOSE:
    105                         locfs_close(callid, &call);
    106                         break;
    107                 case VFS_OUT_SYNC:
    108                         locfs_sync(callid, &call);
    109                         break;
    110                 case VFS_OUT_DESTROY:
    111                         locfs_destroy(callid, &call);
    112                         break;
    113                 default:
    114                         async_answer_0(callid, ENOTSUP);
    115                         break;
    116                 }
    117         }
    118 }
    11959
    12060int main(int argc, char *argv[])
     
    12262        printf("%s: HelenOS Device Filesystem\n", NAME);
    12363       
     64        if (argc == 3) {
     65                if (!str_cmp(argv[1], "--instance"))
     66                        locfs_vfs_info.instance = strtol(argv[2], NULL, 10);
     67                else {
     68                        printf(NAME " Unrecognized parameters");
     69                        return -1;
     70                }
     71        }
     72
     73
    12474        if (!locfs_init()) {
    12575                printf("%s: failed to initialize locfs\n", NAME);
     
    13484        }
    13585       
    136         int rc = fs_register(vfs_sess, &locfs_reg, &locfs_vfs_info,
    137             locfs_connection);
     86        int rc = fs_register(vfs_sess, &locfs_vfs_info, &locfs_ops,
     87            &locfs_libfs_ops);
    13888        if (rc != EOK) {
    13989                printf("%s: Failed to register file system (%d)\n", NAME, rc);
     
    152102 * @}
    153103 */
     104
Note: See TracChangeset for help on using the changeset viewer.