~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to uspace/srv/vfs/vfs_lookup.c

  • Committer: Jakub Jermar
  • Date: 2011-08-19 08:58:50 UTC
  • mfrom: (1143.1.18 HelenOS.camp2011)
  • Revision ID: jakub@jermar.eu-20110819085850-kt1aho3ugtqnuqi3
MergeĀ fromĀ lp:~jakub/helenos/camp2011.

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        return EOK;
201
201
}
202
202
 
203
 
/** Perform a node open operation.
204
 
 *
205
 
 * @return EOK on success or an error code from errno.h.
206
 
 *
207
 
 */
208
 
int vfs_open_node_internal(vfs_lookup_res_t *result)
209
 
{
210
 
        async_exch_t *exch = vfs_exchange_grab(result->triplet.fs_handle);
211
 
        
212
 
        ipc_call_t answer;
213
 
        aid_t req = async_send_2(exch, VFS_OUT_OPEN_NODE,
214
 
            (sysarg_t) result->triplet.service_id,
215
 
            (sysarg_t) result->triplet.index, &answer);
216
 
        
217
 
        sysarg_t rc;
218
 
        async_wait_for(req, &rc);
219
 
        vfs_exchange_release(exch);
220
 
        
221
 
        if (rc == EOK) {
222
 
                result->size =
223
 
                    MERGE_LOUP32(IPC_GET_ARG1(answer), IPC_GET_ARG2(answer));
224
 
                result->lnkcnt = (unsigned int) IPC_GET_ARG3(answer);
225
 
                if (IPC_GET_ARG4(answer) & L_FILE)
226
 
                        result->type = VFS_NODE_FILE;
227
 
                else if (IPC_GET_ARG4(answer) & L_DIRECTORY)
228
 
                        result->type = VFS_NODE_DIRECTORY;
229
 
                else
230
 
                        result->type = VFS_NODE_UNKNOWN;
231
 
        }
232
 
        
233
 
        return rc;
234
 
}
235
 
 
236
203
/**
237
204
 * @}
238
205
 */