Subversion Repositories HelenOS

Rev

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

Rev 3215 Rev 3255
Line 69... Line 69...
69
 
69
 
70
void vfs_mount(ipc_callid_t rid, ipc_call_t *request)
70
void vfs_mount(ipc_callid_t rid, ipc_call_t *request)
71
{
71
{
72
    dev_handle_t dev_handle;
72
    dev_handle_t dev_handle;
73
    vfs_node_t *mp_node = NULL;
73
    vfs_node_t *mp_node = NULL;
-
 
74
    ipc_callid_t callid;
-
 
75
    ipc_call_t data;
74
    int rc;
76
    int rc;
75
    int phone;
77
    int phone;
-
 
78
    size_t size;
76
 
79
 
77
    /*
80
    /*
78
     * We expect the library to do the device-name to device-handle
81
     * We expect the library to do the device-name to device-handle
79
     * translation for us, thus the device handle will arrive as ARG1
82
     * translation for us, thus the device handle will arrive as ARG1
80
     * in the request.
83
     * in the request.
Line 84... Line 87...
84
    /*
87
    /*
85
     * For now, don't make use of ARG2 and ARG3, but they can be used to
88
     * For now, don't make use of ARG2 and ARG3, but they can be used to
86
     * carry mount options in the future.
89
     * carry mount options in the future.
87
     */
90
     */
88
 
91
 
89
    ipc_callid_t callid;
-
 
90
    size_t size;
-
 
91
 
-
 
92
    /*
92
    /*
93
     * Now, we expect the client to send us data with the name of the file
93
     * Now, we expect the client to send us data with the name of the file
94
     * system.
94
     * system.
95
     */
95
     */
96
    if (!ipc_data_write_receive(&callid, &size)) {
96
    if (!ipc_data_write_receive(&callid, &size)) {
Line 113... Line 113...
113
    char fs_name[FS_NAME_MAXLEN + 1];
113
    char fs_name[FS_NAME_MAXLEN + 1];
114
    (void) ipc_data_write_finalize(callid, fs_name, size);
114
    (void) ipc_data_write_finalize(callid, fs_name, size);
115
    fs_name[size] = '\0';
115
    fs_name[size] = '\0';
116
   
116
   
117
    /*
117
    /*
-
 
118
     * Wait for IPC_M_PING so that we can return an error if we don't know
-
 
119
     * fs_name.
-
 
120
     */
-
 
121
    callid = async_get_call(&data);
-
 
122
    if (IPC_GET_METHOD(data) != IPC_M_PING) {
-
 
123
        ipc_answer_0(callid, ENOTSUP);
-
 
124
        ipc_answer_0(rid, ENOTSUP);
-
 
125
        return;
-
 
126
    }
-
 
127
 
-
 
128
    /*
118
     * Check if we know a file system with the same name as is in fs_name.
129
     * Check if we know a file system with the same name as is in fs_name.
119
     * This will also give us its file system handle.
130
     * This will also give us its file system handle.
120
     */
131
     */
121
    fs_handle_t fs_handle = fs_name_to_handle(fs_name, true);
132
    fs_handle_t fs_handle = fs_name_to_handle(fs_name, true);
122
    if (!fs_handle) {
133
    if (!fs_handle) {
-
 
134
        ipc_answer_0(callid, ENOENT);
123
        ipc_answer_0(rid, ENOENT);
135
        ipc_answer_0(rid, ENOENT);
124
        return;
136
        return;
125
    }
137
    }
126
 
138
 
-
 
139
    /* Acknowledge that we know fs_name. */
-
 
140
    ipc_answer_0(callid, EOK);
-
 
141
 
127
    /* Now, we want the client to send us the mount point. */
142
    /* Now, we want the client to send us the mount point. */
128
    if (!ipc_data_write_receive(&callid, &size)) {
143
    if (!ipc_data_write_receive(&callid, &size)) {
129
        ipc_answer_0(callid, EINVAL);
144
        ipc_answer_0(callid, EINVAL);
130
        ipc_answer_0(rid, EINVAL);
145
        ipc_answer_0(rid, EINVAL);
131
        return;
146
        return;