source: rtems/cpukit/libfs/src/imfs/imfs_init.c @ 24ec25d

4.115
Last change on this file since 24ec25d was 24ec25d, checked in by Sebastian Huber <sebastian.huber@…>, on 02/05/15 at 15:14:59

IMFS: Introduce IMFS_mknod_control

Drop IMFS_node_control::node_size field and add node_size parameter to
IMFS_allocate_node() and IMFS_create_node(). This reduces the size of
generic nodes.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup LibFSIMFS
5 *
6 * @brief IMFS initialization.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19  #include "config.h"
20#endif
21
22#include "imfs.h"
23
24const rtems_filesystem_operations_table IMFS_ops = {
25  .lock_h = rtems_filesystem_default_lock,
26  .unlock_h = rtems_filesystem_default_unlock,
27  .eval_path_h = IMFS_eval_path,
28  .link_h = IMFS_link,
29  .are_nodes_equal_h = rtems_filesystem_default_are_nodes_equal,
30  .mknod_h = IMFS_mknod,
31  .rmnod_h = IMFS_rmnod,
32  .fchmod_h = IMFS_fchmod,
33  .chown_h = IMFS_chown,
34  .clonenod_h = IMFS_node_clone,
35  .freenod_h = IMFS_node_free,
36  .mount_h = IMFS_mount,
37  .unmount_h = IMFS_unmount,
38  .fsunmount_me_h = IMFS_fsunmount,
39  .utime_h = IMFS_utime,
40  .symlink_h = IMFS_symlink,
41  .readlink_h = IMFS_readlink,
42  .rename_h = IMFS_rename,
43  .statvfs_h = rtems_filesystem_default_statvfs
44};
45
46static const IMFS_mknod_control *const
47  IMFS_mknod_controls[ IMFS_TYPE_COUNT ] = {
48  [IMFS_DIRECTORY] = &IMFS_mknod_control_directory,
49  [IMFS_DEVICE] = &IMFS_mknod_control_device,
50  [IMFS_MEMORY_FILE] = &IMFS_mknod_control_memfile,
51  [IMFS_FIFO] = &IMFS_mknod_control_enosys
52};
53
54int IMFS_initialize(
55  rtems_filesystem_mount_table_entry_t *mt_entry,
56  const void                           *data
57)
58{
59  return IMFS_initialize_support(
60    mt_entry,
61    &IMFS_ops,
62    IMFS_mknod_controls
63  );
64}
Note: See TracBrowser for help on using the repository browser.