Subversion Repositories HelenOS

Rev

Rev 3386 | Rev 4581 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3386 Rev 4153
Line 53... Line 53...
53
#define NAME "tmpfs"
53
#define NAME "tmpfs"
54
 
54
 
55
 
55
 
56
vfs_info_t tmpfs_vfs_info = {
56
vfs_info_t tmpfs_vfs_info = {
57
    .name = "tmpfs",
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
 
70
fs_reg_t tmpfs_reg;
60
fs_reg_t tmpfs_reg;
71
 
61
 
72
/**
62
/**
Line 134... Line 124...
134
    }
124
    }
135
}
125
}
136
 
126
 
137
int main(int argc, char **argv)
127
int main(int argc, char **argv)
138
{
128
{
139
    int vfs_phone;
-
 
140
 
-
 
141
    printf(NAME ": HelenOS TMPFS file system server\n");
129
    printf(NAME ": HelenOS TMPFS file system server\n");
142
 
130
   
143
    vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0);
131
    int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
144
    while (vfs_phone < EOK) {
132
    if (vfs_phone < EOK) {
-
 
133
        printf(NAME ": Unable to connect to VFS\n");
145
        usleep(10000);
134
        return -1;
146
        vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0);
-
 
147
    }
135
    }
148
   
136
   
149
    int rc;
-
 
150
    rc = fs_register(vfs_phone, &tmpfs_reg, &tmpfs_vfs_info,
137
    int rc = fs_register(vfs_phone, &tmpfs_reg, &tmpfs_vfs_info,
151
        tmpfs_connection);
138
        tmpfs_connection);
152
    if (rc != EOK) {
139
    if (rc != EOK) {
153
        printf(NAME ": Failed to register file system (%d)\n", rc);
140
        printf(NAME ": Failed to register file system (%d)\n", rc);
154
        return rc;
141
        return rc;
155
    }
142
    }