source: rtems/cpukit/libfs/src/imfs/imfs_initsupp.c @ 0ef748fb

4.104.114.84.95
Last change on this file since 0ef748fb was 0ef748fb, checked in by Joel Sherrill <joel.sherrill@…>, on 12/13/00 at 17:53:55

2000-12-12 Jake Janovetz <janovetz@…>

  • src/imfs/linearfile.c, src/imfs/imfs_load_tar.c: New files.
  • src/imfs/Makefile.am, src/imfs/imfs.h, src/imfs/imfs_creat.c, src/imfs/imfs_debug.c, src/imfs/imfs_eval.c, src/imfs/imfs_handlers_memfile.c, src/imfs/imfs_init.c, src/imfs/imfs_initsupp.c, src/imfs/imfs_stat.c, src/imfs/miniimfs_init.c: Added "tarfs". This is not really a tar filesystem. It is a way to load a tar image into the IMFS but actually leave bulky file contents in the original tar image. It essentially adds the linear file type and associated support and a loader routine.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  IMFS Initialization
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.OARcorp.com/rtems/license.html.
10 *
11 *  $Id$
12 */
13
14#include <sys/types.h>         /* for mkdir */
15#include <fcntl.h>
16#include <unistd.h>
17#include <stdlib.h>
18
19#include <assert.h>
20
21#include "imfs.h"
22#include <rtems/libio_.h>
23
24#if defined(IMFS_DEBUG)
25#include <stdio.h>
26#endif
27
28/*
29 *  IMFS_initialize
30 */
31
32int IMFS_initialize_support(
33  rtems_filesystem_mount_table_entry_t *temp_mt_entry,
34   rtems_filesystem_operations_table    *op_table,
35   rtems_filesystem_file_handlers_r     *linearfile_handlers,
36   rtems_filesystem_file_handlers_r     *memfile_handlers,
37   rtems_filesystem_file_handlers_r     *directory_handlers
38)
39{
40  IMFS_fs_info_t                        *fs_info;
41  IMFS_jnode_t                          *jnode;
42
43  /*
44   *  Create the root node
45   */
46
47  temp_mt_entry->mt_fs_root.node_access = IMFS_create_node(
48    NULL,
49    IMFS_DIRECTORY,
50    "",
51    ( S_IFDIR | S_IRWXO | S_IRWXG| S_IRWXU ),
52    NULL
53  );
54
55  temp_mt_entry->mt_fs_root.handlers         = directory_handlers;
56  temp_mt_entry->mt_fs_root.ops              = op_table;
57  temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
58
59  /*
60   * Create custom file system data.
61   */
62  fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) );
63  if ( !fs_info ){
64    free(temp_mt_entry->mt_fs_root.node_access);
65    return 1;
66  }
67  temp_mt_entry->fs_info = fs_info;
68
69  /*
70   * Set st_ino for the root to 1.
71   */
72
73  fs_info->ino_count             = 1;
74  fs_info->linearfile_handlers   = linearfile_handlers;
75  fs_info->memfile_handlers      = memfile_handlers;
76  fs_info->directory_handlers    = directory_handlers;
77
78  jnode = temp_mt_entry->mt_fs_root.node_access;
79  jnode->st_ino = fs_info->ino_count;
80
81  return 0;
82}
Note: See TracBrowser for help on using the repository browser.