source: rtems/cpukit/include/rtems/fs.h @ 7e86e00

5
Last change on this file since 7e86e00 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/**
2 * @file rtems/fs.h
3 *
4 * @brief Basic Filesystem Types
5 *
6 * This file defines basic filesystem types
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2011.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  Modifications to support reference counting in the file system are
14 *  Copyright (c) 2012 embedded brains GmbH.
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef _RTEMS_FS_H
22#define _RTEMS_FS_H
23
24#include <rtems/chain.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/*
31 *  File descriptor Table Information
32 */
33
34/* Forward declarations */
35
36/* FIXME: shouldn't this better not be here? */
37typedef struct rtems_libio_tt rtems_libio_t;
38
39struct rtems_filesystem_mount_table_entry_tt;
40typedef struct rtems_filesystem_mount_table_entry_tt
41    rtems_filesystem_mount_table_entry_t;
42
43typedef struct _rtems_filesystem_file_handlers_r
44    rtems_filesystem_file_handlers_r;
45typedef struct _rtems_filesystem_operations_table
46    rtems_filesystem_operations_table;
47
48/**
49 * @brief File system location.
50 *
51 * @ingroup LibIO
52 */
53typedef struct rtems_filesystem_location_info_tt {
54   rtems_chain_node                         mt_entry_node;
55   void                                    *node_access;
56   void                                    *node_access_2;
57   const rtems_filesystem_file_handlers_r  *handlers;
58   rtems_filesystem_mount_table_entry_t    *mt_entry;
59} rtems_filesystem_location_info_t;
60
61/**
62 * @brief Global file system location.
63 *
64 * @ingroup LibIO
65 *
66 * The global file system locations are used for
67 * - the mount point location in the mount table entry,
68 * - the file system root location in the mount table entry,
69 * - the root directory location in the user environment, and
70 * - the current directory location in the user environment.
71 *
72 * During the path evaluation global start locations are obtained to ensure
73 * that the current file system will be not unmounted in the meantime.
74 *
75 * To support a release within critical sections of the operating system a
76 * deferred release is supported.  This is similar to malloc() and free().
77 *
78 * @see rtems_filesystem_global_location_obtain() and
79 * rtems_filesystem_global_location_release().
80 */
81typedef struct rtems_filesystem_global_location_t {
82  rtems_filesystem_location_info_t location;
83  int reference_count;
84
85  /**
86   * A release within a critical section of the operating system will add this
87   * location to a list of deferred released locations.  This list is processed
88   * in the next rtems_filesystem_global_location_obtain() in FIFO order.
89   */
90  struct rtems_filesystem_global_location_t *deferred_released_next;
91
92  /**
93   * A release within a critical section can happen multiple times.  This field
94   * counts the deferred releases.
95   */
96  int deferred_released_count;
97} rtems_filesystem_global_location_t;
98
99/*
100 * Return the mount table entry for a path location.
101 */
102#define rtems_filesystem_location_mount(_pl) ((_pl)->mt_entry)
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif
109/* end of include file */
Note: See TracBrowser for help on using the repository browser.