1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup LibFSIMFS |
---|
5 | * |
---|
6 | * @brief IMFS without fifo support initialization. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2010 |
---|
11 | * embedded brains GmbH |
---|
12 | * Obere Lagerstr. 30 |
---|
13 | * D-82178 Puchheim |
---|
14 | * Germany |
---|
15 | * <rtems@embedded-brains.de> |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #if HAVE_CONFIG_H |
---|
23 | #include "config.h" |
---|
24 | #endif |
---|
25 | |
---|
26 | #include "imfs.h" |
---|
27 | |
---|
28 | #include <stdlib.h> |
---|
29 | |
---|
30 | #include <rtems/seterr.h> |
---|
31 | |
---|
32 | const rtems_filesystem_operations_table fifoIMFS_ops = { |
---|
33 | .lock_h = rtems_filesystem_default_lock, |
---|
34 | .unlock_h = rtems_filesystem_default_unlock, |
---|
35 | .eval_path_h = IMFS_eval_path, |
---|
36 | .link_h = IMFS_link, |
---|
37 | .are_nodes_equal_h = rtems_filesystem_default_are_nodes_equal, |
---|
38 | .mknod_h = IMFS_mknod, |
---|
39 | .rmnod_h = IMFS_rmnod, |
---|
40 | .fchmod_h = IMFS_fchmod, |
---|
41 | .chown_h = IMFS_chown, |
---|
42 | .clonenod_h = IMFS_node_clone, |
---|
43 | .freenod_h = IMFS_node_free, |
---|
44 | .mount_h = IMFS_mount, |
---|
45 | .unmount_h = IMFS_unmount, |
---|
46 | .fsunmount_me_h = IMFS_fsunmount, |
---|
47 | .utime_h = IMFS_utime, |
---|
48 | .symlink_h = IMFS_symlink, |
---|
49 | .readlink_h = IMFS_readlink, |
---|
50 | .rename_h = IMFS_rename, |
---|
51 | .statvfs_h = rtems_filesystem_default_statvfs |
---|
52 | }; |
---|
53 | |
---|
54 | static const IMFS_mknod_controls IMFS_fifo_mknod_controls = { |
---|
55 | .directory = &IMFS_mknod_control_directory, |
---|
56 | .device = &IMFS_mknod_control_device, |
---|
57 | .file = &IMFS_mknod_control_memfile, |
---|
58 | .fifo = &IMFS_mknod_control_fifo |
---|
59 | }; |
---|
60 | |
---|
61 | int fifoIMFS_initialize( |
---|
62 | rtems_filesystem_mount_table_entry_t *mt_entry, |
---|
63 | const void *data |
---|
64 | ) |
---|
65 | { |
---|
66 | IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); |
---|
67 | IMFS_mount_data mount_data = { |
---|
68 | .fs_info = fs_info, |
---|
69 | .ops = &fifoIMFS_ops, |
---|
70 | .mknod_controls = &IMFS_fifo_mknod_controls |
---|
71 | }; |
---|
72 | |
---|
73 | if ( fs_info == NULL ) { |
---|
74 | rtems_set_errno_and_return_minus_one( ENOMEM ); |
---|
75 | } |
---|
76 | |
---|
77 | return IMFS_initialize_support( mt_entry, &mount_data ); |
---|
78 | } |
---|