Subversion Repositories HelenOS

Rev

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

Rev 2526 Rev 2527
Line 84... Line 84...
84
        return false;
84
        return false;
85
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] != VFS_OP_DEFINED)
85
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] != VFS_OP_DEFINED)
86
        return false;
86
        return false;
87
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] != VFS_OP_DEFINED)
87
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] != VFS_OP_DEFINED)
88
        return false;
88
        return false;
-
 
89
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] != VFS_OP_DEFINED)
-
 
90
        return false;
89
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_OPEN)] != VFS_OP_DEFINED)
91
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_OPEN)] != VFS_OP_DEFINED)
90
        return false;
92
        return false;
91
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_CLOSE)] != VFS_OP_DEFINED)
93
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_CLOSE)] != VFS_OP_DEFINED)
92
        return false;
94
        return false;
93
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_READ)] != VFS_OP_DEFINED)
95
    if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_READ)] != VFS_OP_DEFINED)
Line 190... Line 192...
190
            ipc_answer_fast(callid, EEXISTS, 0, 0);
192
            ipc_answer_fast(callid, EEXISTS, 0, 0);
191
            ipc_answer_fast(rid, EEXISTS, 0, 0);
193
            ipc_answer_fast(rid, EEXISTS, 0, 0);
192
            return;
194
            return;
193
        }
195
        }
194
    }
196
    }
195
   
197
 
-
 
198
    /*
-
 
199
     * Add fs_info to the list of registered FS's.
-
 
200
     */
-
 
201
    list_append(&fs_info->fs_link, &fs_head);
-
 
202
 
196
    /*
203
    /*
197
     * TODO:
-
 
198
     * 1. send the client the IPC_M_CONNECT_TO_ME call so that it makes a
204
     * ACK receiving a properly formatted, non-duplicit vfs_info.
199
     *    callback connection.
-
 
200
     * 2. add the fs_info into fs_head
-
 
201
     */
205
     */
-
 
206
    ipc_answer_fast(callid, EOK, 0, 0);
-
 
207
   
-
 
208
    /*
-
 
209
     * Now we want the client to send us the IPC_M_CONNECT_TO_ME call so
-
 
210
     * that a callback connection is created and we have a phone through
-
 
211
     * which to forward VFS requests to it.
-
 
212
     */
-
 
213
    callid = async_get_call(&call);
-
 
214
    if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) {
-
 
215
        list_remove(&fs_info->fs_link);
-
 
216
        futex_up(&fs_head_futex);
-
 
217
        free(fs_info);
-
 
218
        ipc_answer_fast(callid, EINVAL, 0, 0);
-
 
219
        ipc_answer_fast(rid, EINVAL, 0, 0);
-
 
220
        return;
-
 
221
    }
-
 
222
    fs_info->phone = IPC_GET_ARG3(call);
-
 
223
    ipc_answer_fast(callid, EOK, 0, 0);
202
 
224
 
203
    futex_up(&fs_head_futex);
225
    futex_up(&fs_head_futex);
-
 
226
 
-
 
227
    /*
-
 
228
     * That was it. The FS has been registered.
-
 
229
     */
-
 
230
    ipc_answer_fast(rid, EOK, 0, 0);
204
}
231
}
205
 
232
 
206
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
233
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
207
{
234
{
208
    bool keep_on_going = 1;
235
    bool keep_on_going = 1;