1 | Mounting the base file system consists of the following: |
---|
2 | |
---|
3 | ? Initialization of mount table chain control structure |
---|
4 | ? Allocation of a -jnode- structure that will server as the root node of the `In Memory |
---|
5 | File System' |
---|
6 | ? Initialization of the allocated -jnode- with the appropriate OPS, directory handlers |
---|
7 | and pathconf limits and options. |
---|
8 | ? Allocation of a memory region for file system specific global management variables |
---|
9 | ? Creation of first mount table entry for the base file system |
---|
10 | ? Initialization of the first mount table chain entry to indicate that the mount point is |
---|
11 | NULL and the mounted file system is the base file system |
---|
12 | |
---|
13 | |
---|
14 | After the base file system has been mounted, the following operations are performed |
---|
15 | under its directory structure: |
---|
16 | |
---|
17 | ? Creation of the /dev directory |
---|
18 | ? Registration of devices under /dev directory |
---|
19 | |
---|
20 | Mounting and Unmounting File Systems |
---|
21 | |
---|
22 | ? Characteristics of a Mount Point |
---|
23 | ? The mount point must be a directory. It may have files and other directories under |
---|
24 | it. These files and directories will be hidden when the file system is mounted. |
---|
25 | ? The task must have read/write/execute permissions to the mount point or the |
---|
26 | mount attempt will be rejected. |
---|
27 | ? Only one file system can be mounted to a single mount point. |
---|
28 | ? The Root of the mountable file system will be referenced by the name of the mount |
---|
29 | point after the mount is complete. |
---|
30 | ? Mount table chain |
---|
31 | ? Content of the mount table chain entry |
---|
32 | |
---|
33 | struct rtems_filesystem_mount_table_entry_tt |
---|
34 | { |
---|
35 | Chain_Node Node; |
---|
36 | rtems_filesystem_location_info_t mt_point_node; |
---|
37 | rtems_filesystem_location_info_t mt_fs_root; |
---|
38 | int options; |
---|
39 | void *fs_info; |
---|
40 | |
---|
41 | rtems_filesystem_limits_and_options_t pathconf_limits_and_options; |
---|
42 | |
---|
43 | /* |
---|
44 | * When someone adds a mounted filesystem on a real device, |
---|
45 | * this will need to be used. |
---|
46 | * |
---|
47 | * The best option long term for this is probably an open file descriptor. |
---|
48 | */ |
---|
49 | char *dev; |
---|
50 | }; |
---|
51 | |
---|
52 | ? Adding entries to the chain during mount() |
---|
53 | When a file system is mounted, its presence and location in the file system |
---|
54 | hierarchy is recorded in a dynamic list structure known as a chain. A unique |
---|
55 | rtems_filesystem_mount_table_entry_tt structure is logged for each file system that is |
---|
56 | mounted. This includes the base file system. |
---|
57 | |
---|
58 | ? Removing entries from the chain during unmount() |
---|
59 | When a file system is dismounted its entry in the mount table chain is extracted |
---|
60 | and the memory for this entry is freed. |
---|
61 | |
---|
62 | |
---|
63 | |
---|