source: mainline/uspace/srv/fs/ext2fs/ext2fs_ops.c@ b83e16ff

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since b83e16ff was b83e16ff, checked in by Martin Sucha <sucha14@…>, 14 years ago

Split ext2fs_read_directory from ext2fs_read

  • Property mode set to 100644
File size: 17.2 KB
Line 
1/*
2 * Copyright (c) 2008 Jakub Jermar
3 * Copyright (c) 2011 Martin Sucha
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup fs
31 * @{
32 */
33
34/**
35 * @file ext2fs_ops.c
36 * @brief Implementation of VFS operations for the EXT2 file system server.
37 */
38
39#include "ext2fs.h"
40#include "../../vfs/vfs.h"
41#include <libfs.h>
42#include <libblock.h>
43#include <libext2.h>
44#include <ipc/services.h>
45#include <ipc/devmap.h>
46#include <macros.h>
47#include <async.h>
48#include <errno.h>
49#include <str.h>
50#include <byteorder.h>
51#include <adt/hash_table.h>
52#include <adt/list.h>
53#include <assert.h>
54#include <fibril_synch.h>
55#include <sys/mman.h>
56#include <align.h>
57#include <adt/hash_table.h>
58
59#define EXT2FS_NODE(node) ((node) ? (ext2fs_node_t *) (node)->data : NULL)
60#define EXT2FS_DBG(format, ...) {if (false) printf("ext2fs: %s: " format "\n", __FUNCTION__, ##__VA_ARGS__);}
61
62typedef struct ext2fs_instance {
63 link_t link;
64 devmap_handle_t devmap_handle;
65 ext2_filesystem_t *filesystem;
66} ext2fs_instance_t;
67
68typedef struct ext2fs_node {
69 ext2fs_instance_t *instance;
70 ext2_inode_ref_t *inode_ref;
71} ext2fs_node_t;
72
73static int ext2fs_instance_get(devmap_handle_t, ext2fs_instance_t **);
74static void ext2fs_read_directory(ipc_callid_t, ipc_callid_t, aoff64_t,
75 size_t, ext2fs_instance_t *, ext2_inode_ref_t *);
76
77/*
78 * Forward declarations of EXT2 libfs operations.
79 */
80static int ext2fs_root_get(fs_node_t **, devmap_handle_t);
81static int ext2fs_match(fs_node_t **, fs_node_t *, const char *);
82static int ext2fs_node_get(fs_node_t **, devmap_handle_t, fs_index_t);
83static int ext2fs_node_open(fs_node_t *);
84static int ext2fs_node_put(fs_node_t *);
85static int ext2fs_create_node(fs_node_t **, devmap_handle_t, int);
86static int ext2fs_destroy_node(fs_node_t *);
87static int ext2fs_link(fs_node_t *, fs_node_t *, const char *);
88static int ext2fs_unlink(fs_node_t *, fs_node_t *, const char *);
89static int ext2fs_has_children(bool *, fs_node_t *);
90static fs_index_t ext2fs_index_get(fs_node_t *);
91static aoff64_t ext2fs_size_get(fs_node_t *);
92static unsigned ext2fs_lnkcnt_get(fs_node_t *);
93static char ext2fs_plb_get_char(unsigned);
94static bool ext2fs_is_directory(fs_node_t *);
95static bool ext2fs_is_file(fs_node_t *node);
96static devmap_handle_t ext2fs_device_get(fs_node_t *node);
97
98/*
99 * Static variables
100 */
101static LIST_INITIALIZE(instance_list);
102
103/**
104 *
105 */
106int ext2fs_global_init(void)
107{
108 return EOK;
109}
110
111int ext2fs_global_fini(void)
112{
113 return EOK;
114}
115
116
117
118/*
119 * EXT2 libfs operations.
120 */
121
122/**
123 * Find an instance of filesystem for the given devmap_handle
124 */
125int ext2fs_instance_get(devmap_handle_t devmap_handle, ext2fs_instance_t **inst)
126{
127 EXT2FS_DBG("(%u, -)", devmap_handle);
128 link_t *link;
129 ext2fs_instance_t *tmp;
130
131 if (list_empty(&instance_list)) {
132 EXT2FS_DBG("list empty");
133 return EINVAL;
134 }
135
136 for (link = instance_list.next; link != &instance_list; link = link->next) {
137 tmp = list_get_instance(link, ext2fs_instance_t, link);
138
139 if (tmp->devmap_handle == devmap_handle) {
140 *inst = tmp;
141 return EOK;
142 }
143 }
144
145 EXT2FS_DBG("not found");
146 return EINVAL;
147}
148
149
150
151int ext2fs_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)
152{
153 EXT2FS_DBG("(-, %u)", devmap_handle);
154 return ext2fs_node_get(rfn, devmap_handle, EXT2_INODE_ROOT_INDEX);
155}
156
157int ext2fs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
158{
159 EXT2FS_DBG("(-,-,%s)", component);
160 ext2fs_node_t *eparent = EXT2FS_NODE(pfn);
161 ext2_filesystem_t *fs;
162 ext2_directory_iterator_t it;
163 int rc;
164 size_t name_size;
165 size_t component_size;
166 bool found = false;
167
168 fs = eparent->instance->filesystem;
169
170 if (!ext2_inode_is_type(fs->superblock, eparent->inode_ref->inode,
171 EXT2_INODE_MODE_DIRECTORY)) {
172 return ENOTDIR;
173 }
174
175 rc = ext2_directory_iterator_init(&it, fs, eparent->inode_ref);
176 if (rc != EOK) {
177 return rc;
178 }
179
180 // Find length of component in bytes
181 // TODO: check for library function call that does this
182 component_size = 0;
183 while (*(component+component_size) != 0) {
184 component_size++;
185 }
186
187 while (it.current != NULL) {
188 // ignore empty directory entries
189 if (it.current->inode != 0) {
190 name_size = ext2_directory_entry_ll_get_name_length(fs->superblock,
191 it.current);
192
193 if (name_size == component_size && bcmp(component, &it.current->name,
194 name_size) == 0) {
195 // FIXME: this may be done better (give instance as param)
196 rc = ext2fs_node_get(rfn, eparent->instance->devmap_handle,
197 it.current->inode);
198 if (rc != EOK) {
199 ext2_directory_iterator_fini(&it);
200 return rc;
201 }
202 found = true;
203 break;
204 }
205 }
206
207 rc = ext2_directory_iterator_next(&it);
208 if (rc != EOK) {
209 ext2_directory_iterator_fini(&it);
210 return rc;
211 }
212 }
213
214 ext2_directory_iterator_fini(&it);
215
216 if (!found) {
217 return ENOENT;
218 }
219
220 return EOK;
221}
222
223/** Instantiate a EXT2 in-core node. */
224int ext2fs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)
225{
226 EXT2FS_DBG("(-,%u,%u)", devmap_handle, index);
227 int rc;
228 fs_node_t *node = NULL;
229 ext2fs_node_t *enode = NULL;
230 ext2fs_instance_t *inst = NULL;
231 ext2_inode_ref_t *inode_ref = NULL;
232
233 enode = malloc(sizeof(ext2fs_node_t));
234 if (enode == NULL) {
235 return ENOMEM;
236 }
237
238 node = malloc(sizeof(fs_node_t));
239 if (node == NULL) {
240 free(enode);
241 return ENOMEM;
242 }
243
244 fs_node_initialize(node);
245
246 rc = ext2fs_instance_get(devmap_handle, &inst);
247 if (rc != EOK) {
248 free(enode);
249 free(node);
250 return rc;
251 }
252
253 rc = ext2_filesystem_get_inode_ref(inst->filesystem, index, &inode_ref);
254 if (rc != EOK) {
255 free(enode);
256 free(node);
257 return rc;
258 }
259
260 enode->inode_ref = inode_ref;
261 enode->instance = inst;
262 node->data = enode;
263 *rfn = node;
264
265 EXT2FS_DBG("inode: %u", inode_ref->index);
266
267 EXT2FS_DBG("EOK");
268
269 return EOK;
270}
271
272int ext2fs_node_open(fs_node_t *fn)
273{
274 EXT2FS_DBG("");
275 /*
276 * Opening a file is stateless, nothing
277 * to be done here.
278 */
279 return EOK;
280}
281
282int ext2fs_node_put(fs_node_t *fn)
283{
284 EXT2FS_DBG("");
285 int rc;
286 ext2fs_node_t *enode = EXT2FS_NODE(fn);
287 rc = ext2_filesystem_put_inode_ref(enode->inode_ref);
288 if (rc != EOK) {
289 EXT2FS_DBG("ext2_filesystem_put_inode_ref failed");
290 }
291 return rc;
292}
293
294int ext2fs_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)
295{
296 EXT2FS_DBG("");
297 // TODO
298 return ENOTSUP;
299}
300
301int ext2fs_destroy_node(fs_node_t *fn)
302{
303 EXT2FS_DBG("");
304 // TODO
305 return ENOTSUP;
306}
307
308int ext2fs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
309{
310 EXT2FS_DBG("");
311 // TODO
312 return ENOTSUP;
313}
314
315int ext2fs_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm)
316{
317 EXT2FS_DBG("");
318 // TODO
319 return ENOTSUP;
320}
321
322int ext2fs_has_children(bool *has_children, fs_node_t *fn)
323{
324 EXT2FS_DBG("");
325 ext2fs_node_t *enode = EXT2FS_NODE(fn);
326 ext2_directory_iterator_t it;
327 ext2_filesystem_t *fs;
328 int rc;
329 bool found = false;
330
331 fs = enode->instance->filesystem;
332
333 if (!ext2_inode_is_type(fs->superblock, enode->inode_ref->inode,
334 EXT2_INODE_MODE_DIRECTORY)) {
335 *has_children = false;
336 EXT2FS_DBG("EOK - false");
337 return EOK;
338 }
339
340 rc = ext2_directory_iterator_init(&it, fs, enode->inode_ref);
341 if (rc != EOK) {
342 EXT2FS_DBG("error %u", rc);
343 return rc;
344 }
345
346 // Find a non-empty directory entry
347 while (it.current != NULL) {
348 if (it.current->inode != 0) {
349 found = true;
350 break;
351 }
352
353 rc = ext2_directory_iterator_next(&it);
354 if (rc != EOK) {
355 ext2_directory_iterator_fini(&it);
356 EXT2FS_DBG("error %u", rc);
357 return rc;
358 }
359 }
360
361 rc = ext2_directory_iterator_fini(&it);
362 if (rc != EOK) {
363 EXT2FS_DBG("error %u", rc);
364 return rc;
365 }
366
367 *has_children = found;
368 EXT2FS_DBG("EOK");
369
370 return EOK;
371}
372
373
374fs_index_t ext2fs_index_get(fs_node_t *fn)
375{
376 ext2fs_node_t *enode = EXT2FS_NODE(fn);
377 EXT2FS_DBG("%u", enode->inode_ref->index);
378 return enode->inode_ref->index;
379}
380
381aoff64_t ext2fs_size_get(fs_node_t *fn)
382{
383 ext2fs_node_t *enode = EXT2FS_NODE(fn);
384 aoff64_t size = ext2_inode_get_size(enode->instance->filesystem->superblock,
385 enode->inode_ref->inode);
386 EXT2FS_DBG("%" PRIu64, size);
387 return size;
388}
389
390unsigned ext2fs_lnkcnt_get(fs_node_t *fn)
391{
392 ext2fs_node_t *enode = EXT2FS_NODE(fn);
393 unsigned count = ext2_inode_get_usage_count(enode->inode_ref->inode);
394 EXT2FS_DBG("%u", count);
395 return count;
396}
397
398char ext2fs_plb_get_char(unsigned pos)
399{
400 return ext2fs_reg.plb_ro[pos % PLB_SIZE];
401}
402
403bool ext2fs_is_directory(fs_node_t *fn)
404{
405 ext2fs_node_t *enode = EXT2FS_NODE(fn);
406 bool is_dir = ext2_inode_is_type(enode->instance->filesystem->superblock,
407 enode->inode_ref->inode, EXT2_INODE_MODE_DIRECTORY);
408 EXT2FS_DBG("%s", is_dir ? "true" : "false");
409 EXT2FS_DBG("%u", enode->inode_ref->index);
410 return is_dir;
411}
412
413bool ext2fs_is_file(fs_node_t *fn)
414{
415 ext2fs_node_t *enode = EXT2FS_NODE(fn);
416 bool is_file = ext2_inode_is_type(enode->instance->filesystem->superblock,
417 enode->inode_ref->inode, EXT2_INODE_MODE_FILE);
418 EXT2FS_DBG("%s", is_file ? "true" : "false");
419 return is_file;
420}
421
422devmap_handle_t ext2fs_device_get(fs_node_t *fn)
423{
424 EXT2FS_DBG("");
425 ext2fs_node_t *enode = EXT2FS_NODE(fn);
426 return enode->instance->devmap_handle;
427}
428
429/** libfs operations */
430libfs_ops_t ext2fs_libfs_ops = {
431 .root_get = ext2fs_root_get,
432 .match = ext2fs_match,
433 .node_get = ext2fs_node_get,
434 .node_open = ext2fs_node_open,
435 .node_put = ext2fs_node_put,
436 .create = ext2fs_create_node,
437 .destroy = ext2fs_destroy_node,
438 .link = ext2fs_link,
439 .unlink = ext2fs_unlink,
440 .has_children = ext2fs_has_children,
441 .index_get = ext2fs_index_get,
442 .size_get = ext2fs_size_get,
443 .lnkcnt_get = ext2fs_lnkcnt_get,
444 .plb_get_char = ext2fs_plb_get_char,
445 .is_directory = ext2fs_is_directory,
446 .is_file = ext2fs_is_file,
447 .device_get = ext2fs_device_get
448};
449
450/*
451 * VFS operations.
452 */
453
454void ext2fs_mounted(ipc_callid_t rid, ipc_call_t *request)
455{
456 EXT2FS_DBG("");
457 int rc;
458 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
459 ext2_filesystem_t *fs;
460 ext2fs_instance_t *inst;
461
462
463
464 /* Accept the mount options */
465 char *opts;
466 rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
467
468 if (rc != EOK) {
469 async_answer_0(rid, rc);
470 return;
471 }
472
473 free(opts);
474
475 /* Allocate libext2 filesystem structure */
476 fs = (ext2_filesystem_t *) malloc(sizeof(ext2_filesystem_t));
477 if (fs == NULL) {
478 async_answer_0(rid, ENOMEM);
479 return;
480 }
481
482 /* Allocate instance structure */
483 inst = (ext2fs_instance_t *) malloc(sizeof(ext2fs_instance_t));
484 if (inst == NULL) {
485 free(fs);
486 async_answer_0(rid, ENOMEM);
487 return;
488 }
489
490 /* Initialize the filesystem */
491 rc = ext2_filesystem_init(fs, devmap_handle);
492 if (rc != EOK) {
493 free(fs);
494 free(inst);
495 async_answer_0(rid, rc);
496 return;
497 }
498
499 /* Do some sanity checking */
500 rc = ext2_filesystem_check_sanity(fs);
501 if (rc != EOK) {
502 ext2_filesystem_fini(fs);
503 free(fs);
504 free(inst);
505 async_answer_0(rid, rc);
506 return;
507 }
508
509 /* Initialize instance and add to the list */
510 link_initialize(&inst->link);
511 inst->devmap_handle = devmap_handle;
512 inst->filesystem = fs;
513 list_append(&inst->link, &instance_list);
514
515 async_answer_0(rid, EOK);
516}
517
518void ext2fs_mount(ipc_callid_t rid, ipc_call_t *request)
519{
520 EXT2FS_DBG("");
521 libfs_mount(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
522}
523
524void ext2fs_unmounted(ipc_callid_t rid, ipc_call_t *request)
525{
526 EXT2FS_DBG("");
527 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
528 ext2fs_instance_t *inst;
529 int rc;
530
531 rc = ext2fs_instance_get(devmap_handle, &inst);
532
533 if (rc != EOK) {
534 async_answer_0(rid, rc);
535 return;
536 }
537
538 // TODO: check if the fs is busy
539
540 // Remove the instance from list
541 list_remove(&inst->link);
542 ext2_filesystem_fini(inst->filesystem);
543
544 async_answer_0(rid, EOK);
545}
546
547void ext2fs_unmount(ipc_callid_t rid, ipc_call_t *request)
548{
549 EXT2FS_DBG("");
550 libfs_unmount(&ext2fs_libfs_ops, rid, request);
551}
552
553void ext2fs_lookup(ipc_callid_t rid, ipc_call_t *request)
554{
555 EXT2FS_DBG("");
556 libfs_lookup(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
557}
558
559void ext2fs_read(ipc_callid_t rid, ipc_call_t *request)
560{
561 EXT2FS_DBG("");
562 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
563 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
564 aoff64_t pos =
565 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
566
567 ext2fs_instance_t *inst;
568 ext2_inode_ref_t *inode_ref;
569 int rc;
570
571 /*
572 * Receive the read request.
573 */
574 ipc_callid_t callid;
575 size_t size;
576 if (!async_data_read_receive(&callid, &size)) {
577 async_answer_0(callid, EINVAL);
578 async_answer_0(rid, EINVAL);
579 return;
580 }
581
582 rc = ext2fs_instance_get(devmap_handle, &inst);
583 if (rc != EOK) {
584 async_answer_0(callid, rc);
585 async_answer_0(rid, rc);
586 return;
587 }
588
589 rc = ext2_filesystem_get_inode_ref(inst->filesystem, index, &inode_ref);
590 if (rc != EOK) {
591 async_answer_0(callid, rc);
592 async_answer_0(rid, rc);
593 return;
594 }
595
596 if (ext2_inode_is_type(inst->filesystem->superblock, inode_ref->inode,
597 EXT2_INODE_MODE_FILE)) {
598 async_answer_0(callid, ENOTSUP);
599 async_answer_0(rid, ENOTSUP);
600 }
601 else if (ext2_inode_is_type(inst->filesystem->superblock, inode_ref->inode,
602 EXT2_INODE_MODE_DIRECTORY)) {
603 ext2fs_read_directory(rid, callid, pos, size, inst, inode_ref);
604 }
605
606 // Other inode types not supported
607 async_answer_0(callid, ENOTSUP);
608 async_answer_0(rid, ENOTSUP);
609}
610
611void ext2fs_read_directory(ipc_callid_t rid, ipc_callid_t callid, aoff64_t pos,
612 size_t size, ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref)
613{
614 ext2_directory_iterator_t it;
615 aoff64_t cur;
616 uint8_t *buf;
617 size_t name_size;
618 int rc;
619
620 rc = ext2_directory_iterator_init(&it, inst->filesystem, inode_ref);
621 if (rc != EOK) {
622 async_answer_0(callid, rc);
623 async_answer_0(rid, rc);
624 return;
625 }
626
627 cur = 0;
628 while (it.current != NULL) {
629 if (it.current->inode != 0) {
630 if (cur == pos) {
631 // This is the dir entry we want to read
632 name_size = ext2_directory_entry_ll_get_name_length(
633 inst->filesystem->superblock, it.current);
634 // The on-disk entry does not contain \0 at the end
635 // end of entry name, so we copy it to new buffer
636 // and the \0 at the end
637 buf = malloc(name_size+1);
638 if (buf == NULL) {
639 ext2_directory_iterator_fini(&it);
640 async_answer_0(callid, ENOMEM);
641 async_answer_0(rid, ENOMEM);
642 return;
643 }
644 memcpy(buf, &it.current->name, name_size);
645 *(buf+name_size) = 0;
646 (void) async_data_read_finalize(callid, buf, name_size+1);
647 break;
648 }
649 cur++;
650 }
651
652 rc = ext2_directory_iterator_next(&it);
653 if (rc != EOK) {
654 ext2_directory_iterator_fini(&it);
655 async_answer_0(callid, rc);
656 async_answer_0(rid, rc);
657 return;
658 }
659 }
660
661 rc = ext2_directory_iterator_fini(&it);
662 if (rc != EOK) {
663 async_answer_0(rid, ENOMEM);
664 return;
665 }
666
667 async_answer_1(rid, EOK, 1);
668}
669
670void ext2fs_write(ipc_callid_t rid, ipc_call_t *request)
671{
672 EXT2FS_DBG("");
673// devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
674// fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
675// aoff64_t pos =
676// (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
677
678 // TODO
679 async_answer_0(rid, ENOTSUP);
680}
681
682void ext2fs_truncate(ipc_callid_t rid, ipc_call_t *request)
683{
684 EXT2FS_DBG("");
685// devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
686// fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
687// aoff64_t size =
688// (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
689
690 // TODO
691 async_answer_0(rid, ENOTSUP);
692}
693
694void ext2fs_close(ipc_callid_t rid, ipc_call_t *request)
695{
696 EXT2FS_DBG("");
697 async_answer_0(rid, EOK);
698}
699
700void ext2fs_destroy(ipc_callid_t rid, ipc_call_t *request)
701{
702 EXT2FS_DBG("");
703// devmap_handle_t devmap_handle = (devmap_handle_t)IPC_GET_ARG1(*request);
704// fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
705
706 // TODO
707 async_answer_0(rid, ENOTSUP);
708}
709
710void ext2fs_open_node(ipc_callid_t rid, ipc_call_t *request)
711{
712 EXT2FS_DBG("");
713 libfs_open_node(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
714}
715
716void ext2fs_stat(ipc_callid_t rid, ipc_call_t *request)
717{
718 EXT2FS_DBG("");
719 libfs_stat(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
720}
721
722void ext2fs_sync(ipc_callid_t rid, ipc_call_t *request)
723{
724 EXT2FS_DBG("");
725// devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
726// fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
727
728 // TODO
729 async_answer_0(rid, ENOTSUP);
730}
731
732/**
733 * @}
734 */
Note: See TracBrowser for help on using the repository browser.