1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-2002. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter Mounting and Unmounting Filesystems |
---|
10 | |
---|
11 | @section Mount Points |
---|
12 | |
---|
13 | The following is the list of the characteristics of a mount point: |
---|
14 | |
---|
15 | @itemize @bullet |
---|
16 | |
---|
17 | @item The mount point must be a directory. It may have files and other |
---|
18 | directories under it. These files and directories will be hidden when the |
---|
19 | filesystem is mounted. |
---|
20 | |
---|
21 | @item The task must have read/write/execute permissions to the mount point |
---|
22 | or the mount attempt will be rejected. |
---|
23 | |
---|
24 | @item Only one filesystem can be mounted to a single mount point. |
---|
25 | |
---|
26 | @item The Root of the mountable filesystem will be referenced by the name |
---|
27 | of the mount point after the mount is complete. |
---|
28 | |
---|
29 | @end itemize |
---|
30 | |
---|
31 | @section Mount Table Chain |
---|
32 | |
---|
33 | The mount table chain is a dynamic list of structures that describe |
---|
34 | mounted filesystems a specific points in the filesystem hierarchy. It is |
---|
35 | initialized to an empty state during the base filesystem initialization. |
---|
36 | The mount operation will add entries to the mount table chain. The |
---|
37 | un-mount operation will remove entries from the mount table chain. |
---|
38 | |
---|
39 | Each entry in the mount table chain is of the following type: |
---|
40 | |
---|
41 | @example |
---|
42 | struct rtems_filesystem_mount_table_entry_tt |
---|
43 | @{ |
---|
44 | Chain_Node Node; |
---|
45 | rtems_filesystem_location_info_t mt_point_node; |
---|
46 | rtems_filesystem_location_info_t mt_fs_root; |
---|
47 | int options; |
---|
48 | void *fs_info; |
---|
49 | |
---|
50 | rtems_filesystem_limits_and_options_t pathconf_limits_and_options; |
---|
51 | |
---|
52 | /* |
---|
53 | * When someone adds a mounted filesystem on a real device, |
---|
54 | * this will need to be used. |
---|
55 | * |
---|
56 | * The best option long term for this is probably an |
---|
57 | * open file descriptor. |
---|
58 | */ |
---|
59 | char *dev; |
---|
60 | @}; |
---|
61 | @end example |
---|
62 | |
---|
63 | @table @b |
---|
64 | @item Node |
---|
65 | The Node is used to produce a linked list of mount table entry nodes. |
---|
66 | |
---|
67 | @item mt_point_node |
---|
68 | The mt_point_node contains all information necessary to access the |
---|
69 | directory where a filesystem is mounted onto. This element may contain |
---|
70 | memory that is allocated during a path evaluation of the filesystem |
---|
71 | containing the mountpoint directory. The generic code allows this |
---|
72 | memory to be returned by unmount when the filesystem identified by |
---|
73 | mt_fs_root is unmounted. |
---|
74 | |
---|
75 | @item mt_fs_root |
---|
76 | The mt_fs_root contains all information necessary to identify the root |
---|
77 | of the mounted filesystem. The user is never allowed access to this |
---|
78 | node by the generic code, but it is used to identify to the mounted |
---|
79 | filesystem where to start evaluation of pathnames at. |
---|
80 | |
---|
81 | @item options |
---|
82 | XXX |
---|
83 | |
---|
84 | @item fs_info |
---|
85 | The fs_info element is a location available for use by the mounted file |
---|
86 | system to identify unique things applicable to this instance of the file |
---|
87 | system. For example the IMFS uses this space to provide node |
---|
88 | identification that is unique for each instance (mounting) of the filesystem. |
---|
89 | |
---|
90 | @item pathconf_limits_and_options |
---|
91 | XXX |
---|
92 | |
---|
93 | @item dev |
---|
94 | This character string represents the device where the filesystem will reside. |
---|
95 | |
---|
96 | @end table |
---|
97 | |
---|
98 | @section Adding entries to the chain during mount |
---|
99 | |
---|
100 | When a filesystem is mounted, its presence and location in the file |
---|
101 | system hierarchy is recorded in a dynamic list structure known as a chain. |
---|
102 | A unique rtems_filesystem_mount_table_entry_tt structure is logged for |
---|
103 | each filesystem that is mounted. This includes the base filesystem. |
---|
104 | |
---|
105 | @section Removing entries from the chain during unmount |
---|
106 | |
---|
107 | When a filesystem is dismounted its entry in the mount table chain is |
---|
108 | extracted and the memory for this entry is freed. |
---|
109 | |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | |
---|
115 | |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | |
---|
120 | |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | |
---|
134 | |
---|
135 | |
---|
136 | |
---|
137 | |
---|
138 | |
---|
139 | |
---|
140 | |
---|
141 | |
---|
142 | |
---|
143 | |
---|
144 | |
---|
145 | |
---|
146 | |
---|
147 | |
---|
148 | |
---|
149 | |
---|
150 | |
---|
151 | |
---|
152 | |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | |
---|
164 | |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | |
---|
169 | |
---|
170 | |
---|
171 | |
---|