Changeset bd5f3b7 in mainline for uspace/srv/fs/locfs/locfs.c


Ignore:
Timestamp:
2011-08-21T13:07:35Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
00aece0, f1a9e87
Parents:
86a34d3e (diff), a6480d5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

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

    r86a34d3e rbd5f3b7  
    3232
    3333/**
    34  * @file devfs.c
    35  * @brief Devices file system.
     34 * @file locfs.c
     35 * @brief Location-service file system.
    3636 *
    37  * Every device registered to device mapper is represented as a file in this
     37 * Every service registered with location service is represented as a file in this
    3838 * file system.
    3939 */
     
    4646#include <task.h>
    4747#include <libfs.h>
    48 #include "devfs.h"
    49 #include "devfs_ops.h"
     48#include "locfs.h"
     49#include "locfs_ops.h"
    5050
    51 #define NAME  "devfs"
     51#define NAME  "locfs"
    5252
    53 static vfs_info_t devfs_vfs_info = {
     53static vfs_info_t locfs_vfs_info = {
    5454        .name = NAME,
    5555        .concurrent_read_write = false,
     
    5757};
    5858
    59 fs_reg_t devfs_reg;
    60 
    61 static void devfs_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                         devfs_mounted(callid, &call);
    76                         break;
    77                 case VFS_OUT_MOUNT:
    78                         devfs_mount(callid, &call);
    79                         break;
    80                 case VFS_OUT_UNMOUNTED:
    81                         devfs_unmounted(callid, &call);
    82                         break;
    83                 case VFS_OUT_UNMOUNT:
    84                         devfs_unmount(callid, &call);
    85                         break;
    86                 case VFS_OUT_LOOKUP:
    87                         devfs_lookup(callid, &call);
    88                         break;
    89                 case VFS_OUT_OPEN_NODE:
    90                         devfs_open_node(callid, &call);
    91                         break;
    92                 case VFS_OUT_STAT:
    93                         devfs_stat(callid, &call);
    94                         break;
    95                 case VFS_OUT_READ:
    96                         devfs_read(callid, &call);
    97                         break;
    98                 case VFS_OUT_WRITE:
    99                         devfs_write(callid, &call);
    100                         break;
    101                 case VFS_OUT_TRUNCATE:
    102                         devfs_truncate(callid, &call);
    103                         break;
    104                 case VFS_OUT_CLOSE:
    105                         devfs_close(callid, &call);
    106                         break;
    107                 case VFS_OUT_SYNC:
    108                         devfs_sync(callid, &call);
    109                         break;
    110                 case VFS_OUT_DESTROY:
    111                         devfs_destroy(callid, &call);
    112                         break;
    113                 default:
    114                         async_answer_0(callid, ENOTSUP);
    115                         break;
    116                 }
    117         }
    118 }
    119 
    12059int main(int argc, char *argv[])
    12160{
    12261        printf("%s: HelenOS Device Filesystem\n", NAME);
    12362       
    124         if (!devfs_init()) {
    125                 printf("%s: failed to initialize devfs\n", NAME);
     63        if (!locfs_init()) {
     64                printf("%s: failed to initialize locfs\n", NAME);
    12665                return -1;
    12766        }
     
    13473        }
    13574       
    136         int rc = fs_register(vfs_sess, &devfs_reg, &devfs_vfs_info,
    137             devfs_connection);
     75        int rc = fs_register(vfs_sess, &locfs_vfs_info, &locfs_ops,
     76            &locfs_libfs_ops);
    13877        if (rc != EOK) {
    13978                printf("%s: Failed to register file system (%d)\n", NAME, rc);
     
    15291 * @}
    15392 */
     93
Note: See TracChangeset for help on using the changeset viewer.