source: rtems-docs/filesystem/pathname_eval.rst @ 2d1dc3f

4.115
Last change on this file since 2d1dc3f was 2d1dc3f, checked in by Amar Takhar <verm@…>, on 01/16/16 at 15:28:13

Split document into seperate files by section.

  • Property mode set to 100644
File size: 4.1 KB
Line 
1Pathname Evaluation
2###################
3
4This chapter describes the pathname evaluation process for the
5RTEMS Filesystem Infrastructure.
6.. code:: c
7
8    XXX Include graphic of the path evaluation process
9
10Pathname Evaluation Handlers
11============================
12
13There are two pathname evaluation routines.  The handler patheval()
14is called to find, verify privlages on and return information on a node
15that exists.  The handler evalformake() is called to find, verify
16permissions, and return information on a node that is to become a parent.
17Additionally, evalformake() returns a pointer to the start of the name of
18the new node to be created.
19
20Pathname evaluation is specific to a filesystem.
21Each filesystem is required to provide both a patheval() and an evalformake()
22routine.  Both of these routines gets a name to evaluate and a node indicating
23where to start the evaluation.
24
25Crossing a Mount Point During Path Evaluation
26=============================================
27
28If the filesystem supports the mount command, the evaluate routines
29must handle crossing the mountpoint.  The evaluate routine should evaluate
30the name upto the first directory node where the new filesystem is mounted.
31The filesystem may process terminator characters prior to calling the
32evaluate routine for the new filesystem.   A pointer to the portion of the
33name which has not been evaluated along with the root node of the new
34file system ( gotten from the mount table entry ) is passed to the correct
35mounted filesystem evaluate routine.
36
37The rtems_filesystem_location_info_t Structure
38==============================================
39
40The ``rtems_filesystem_location_info_t`` structure contains all information
41necessary for identification of a node.
42
43The generic rtems filesystem code defines two global
44rtems_filesystem_location_info_t structures, the``rtems_filesystem_root`` and the ``rtems_filesystem_current``.
45Both are initially defined to be the root node of the base filesystem.
46Once the chdir command is correctly used the ``rtems_filesystem_current``
47is set to the location specified by the command.
48
49The filesystem generic code peeks at the first character in the name to be
50evaluated.  If this character is a valid seperator, the``rtems_filesystem_root`` is used as the node to start the evaluation
51with.  Otherwise, the ``rtems_filesystem_current`` node is used as the
52node to start evaluating with.  Therefore, a valid
53rtems_filesystem_location_info_t is given to the evaluate routine to start
54evaluation with.  The evaluate routines are then responsible for making
55any changes necessary to this structure to correspond to the name being
56parsed.
57.. code:: c
58
59    struct rtems_filesystem_location_info_tt {
60    void                                     \*node_access;
61    rtems_filesystem_file_handlers_r         \*handlers;
62    rtems_filesystem_operations_table        \*ops;
63    rtems_filesystem_mount_table_entry_t     \*mt_entry;
64    };
65
66*node_access*
67    This element is filesystem specific.  A filesystem can define and store
68    any information necessary to identify a node at this location.  This element
69    is normally filled in by the filesystem’s evaluate routine. For the
70    filesystem’s root node, the filesystem’s initilization routine should
71    fill this in, and it should remain valid until the instance of the
72    filesystem is unmounted.
73
74*handlers*
75    This element is defined as a set of routines that may change within a
76    given filesystem based upon node type.  For example a directory and a
77    memory file may have to completely different read routines.  This element
78    is set to an initialization state defined by the mount table, and may
79    be set to the desired state by the evaluation routines.
80
81*ops*
82    This element is defined as a set of routines that remain static for the
83    filesystem.  This element identifies entry points into the filesystem
84    to the generic code.
85
86*mt_entry*
87    This element identifies the mount table entry for this instance of the
88    filesystem.
89
90.. COMMENT: COPYRIGHT (c) 1988-2002.
91
92.. COMMENT: On-Line Applications Research Corporation (OAR).
93
94.. COMMENT: All rights reserved.
95
Note: See TracBrowser for help on using the repository browser.