summaryrefslogblamecommitdiffstats
path: root/filesystem/filesystem_old_reference_only.rst
blob: f8c1746d9d3837894a0fefbf714de385e749e6a5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602

                                                





















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                    
























































































































































                                                                                      
 
             
 











                                                  
 

                                                                            
 

                                                                   
 


                                                                         
 


                                                                           
 

                                                                     
 







                                                                             
 
































                                                                            
 





























































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                           
 
                    
 

                                                                                   
 
                      
 





                                                                                   
 
                    
 


                                                                                  
 
                   
 




                                                                                  
 
                 
 





















                                                                               
                                                        








































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                       
.. comment SPDX-License-Identifier: CC-BY-SA-4.0

:orphan:



.. COMMENT: %**end of header

.. COMMENT: COPYRIGHT (c) 1989-2013.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

.. COMMENT: Master file for the Filesystem Design Guide

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

.. COMMENT: The following determines which set of the tables and figures we will use.

.. COMMENT: We default to ASCII but if available TeX or HTML versions will

.. COMMENT: be used instead.

.. COMMENT: @clear use-html

.. COMMENT: @clear use-tex

.. COMMENT: The following variable says to use texinfo or html for the two column

.. COMMENT: texinfo tables.  For somethings the format does not look good in html.

.. COMMENT: With our adjustment to the left column in TeX, it nearly always looks

.. COMMENT: good printed.

.. COMMENT: Custom whitespace adjustments.  We could fiddle a bit more.

.. COMMENT: Title Page Stuff

.. COMMENT: I don't really like having a short title page.  -joel

.. COMMENT: @shorttitlepage RTEMS Filesystem Design Guide

=============================
RTEMS Filesystem Design Guide
=============================

.. COMMENT: COPYRIGHT (c) 1988-2015.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

.. COMMENT: The following puts a space somewhere on an otherwise empty page so we

.. COMMENT: can force the copyright description onto a left hand page.

COPYRIGHT © 1988 - 2015.

On-Line Applications Research Corporation (OAR).

The authors have used their best efforts in preparing
this material.  These efforts include the development, research,
and testing of the theories and programs to determine their
effectiveness.  No warranty of any kind, expressed or implied,
with regard to the software or the material contained in this
document is provided.  No liability arising out of the
application or use of any product described in this document is
assumed.  The authors reserve the right to revise this material
and to make changes from time to time in the content hereof
without obligation to notify anyone of such revision or changes.

The RTEMS Project is hosted at http://www.rtems.org.  Any
inquiries concerning RTEMS, its related support components, or its
documentation should be directed to the Community Project hosted athttp://www.rtems.org.

Any inquiries for commercial services including training, support, custom
development, application development assistance should be directed tohttp://www.rtems.com.

.. COMMENT: This prevents a black box from being printed on "overflow" lines.

.. COMMENT: The alternative is to rework a sentence to avoid this problem.

RTEMS Filesystem Design Guide
#############################

.. COMMENT: COPYRIGHT (c) 1989-2011.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

Preface
#######

This document describes the implementation of the RTEMS filesystem
infrastructure.  This infrastructure supports the following
capabilities:

- Mountable file systems

- Hierarchical file system directory structure

- POSIX compliant set of routines for the manipulation of files and directories

- Individual file and directory support for the following:
  # Permissions for read, write and execute
  # User ID
  # Group ID
  # Access time
  # Modification time
  # Creation time

- Hard links to files and directories

- Symbolic links to files and directories

This has been implemented to provide the framework for a UNIX-like
file system support. POSIX file and directory functions have been
implemented that allow a standard method of accessing file, device and
directory information within file systems. The file system concept that
has been implemented allows for expansion and adaptation of the file
system to a variety of existing and future data storage devices. To this
end, file system mount and unmount capabilities have been included in this
RTEMS framework.

This framework slightly alters the manner in which devices are handled
under RTEMS from that of public release 4.0.0 and earlier.  Devices that
are defined under a given RTEMS configuration will now be registered as
files in a mounted file system.  Access to these device drivers and their
associated devices may now be performed through the traditional file system
open(), read(), write(), lseek(), fstat() and ioctl() functions in addition
to the interface provided by the IO Manager in the RTEMS Classic API.

An In-Memory File System (IMFS) is included which provides full POSIX
filesystem functionality yet is RAM based.  The IMFS maintains a
node structure for each file, device, and directory in each mounted
instantiation of its file system. The node structure is used to
manage ownership, access rights, access time, modification time,
and creation time.  A union of structures within the IMFS nodal
structure provide for manipulation of file data, device selection,
or directory content as required by the nodal type. Manipulation of
these properties is accomplished through the POSIX set of file and
directory functions.  In addition to being useful in its own right,
the IMFS serves as a full featured example filesystem.

The intended audience for this document is those persons implementing
their own filesystem.  Users of the filesystem may find information
on the implementation useful.  But the user interface to the filesystem
is through the ISO/ANSI C Library and POSIX 1003.1b file and directory
APIs.

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

Pathname Evaluation
###################

This chapter describes the pathname evaluation process for the
RTEMS Filesystem Infrastructure.
.. code:: c

    XXX Include graphic of the path evaluation process

Pathname Evaluation Handlers
============================

There are two pathname evaluation routines.  The handler patheval()
is called to find, verify privlages on and return information on a node
that exists.  The handler evalformake() is called to find, verify
permissions, and return information on a node that is to become a parent.
Additionally, evalformake() returns a pointer to the start of the name of
the new node to be created.

Pathname evaluation is specific to a filesystem.
Each filesystem is required to provide both a patheval() and an evalformake()
routine.  Both of these routines gets a name to evaluate and a node indicating
where to start the evaluation.

Crossing a Mount Point During Path Evaluation
=============================================

If the filesystem supports the mount command, the evaluate routines
must handle crossing the mountpoint.  The evaluate routine should evaluate
the name upto the first directory node where the new filesystem is mounted.
The filesystem may process terminator characters prior to calling the
evaluate routine for the new filesystem.   A pointer to the portion of the
name which has not been evaluated along with the root node of the new
file system ( gotten from the mount table entry ) is passed to the correct
mounted filesystem evaluate routine.

The rtems_filesystem_location_info_t Structure
==============================================

The ``rtems_filesystem_location_info_t`` structure contains all information
necessary for identification of a node.

The generic rtems filesystem code defines two global
rtems_filesystem_location_info_t structures, the``rtems_filesystem_root`` and the ``rtems_filesystem_current``.
Both are initially defined to be the root node of the base filesystem.
Once the chdir command is correctly used the ``rtems_filesystem_current``
is set to the location specified by the command.

The filesystem generic code peeks at the first character in the name to be
evaluated.  If this character is a valid seperator, the``rtems_filesystem_root`` is used as the node to start the evaluation
with.  Otherwise, the ``rtems_filesystem_current`` node is used as the
node to start evaluating with.  Therefore, a valid
rtems_filesystem_location_info_t is given to the evaluate routine to start
evaluation with.  The evaluate routines are then responsible for making
any changes necessary to this structure to correspond to the name being
parsed.
.. code:: c

    struct rtems_filesystem_location_info_tt {
    void                                     \*node_access;
    rtems_filesystem_file_handlers_r         \*handlers;
    rtems_filesystem_operations_table        \*ops;
    rtems_filesystem_mount_table_entry_t     \*mt_entry;
    };

*node_access*
    This element is filesystem specific.  A filesystem can define and store
    any information necessary to identify a node at this location.  This element
    is normally filled in by the filesystem’s evaluate routine. For the
    filesystem’s root node, the filesystem’s initilization routine should
    fill this in, and it should remain valid until the instance of the
    filesystem is unmounted.

*handlers*
    This element is defined as a set of routines that may change within a
    given filesystem based upon node type.  For example a directory and a
    memory file may have to completely different read routines.  This element
    is set to an initialization state defined by the mount table, and may
    be set to the desired state by the evaluation routines.

*ops*
    This element is defined as a set of routines that remain static for the
    filesystem.  This element identifies entry points into the filesystem
    to the generic code.

*mt_entry*
    This element identifies the mount table entry for this instance of the
    filesystem.

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

System Initialization
#####################

After the RTEMS initialization is performed, the application’s
initialization will be performed. Part of initialization is a call to
rtems_filesystem_initialize(). This routine will mount the ‘In Memory File
System’ as the base filesystem.  Mounting the base filesystem consists
of the following:

- Initialization of mount table chain control structure

- Allocation of a ``jnode`` structure that will server as the root node
  of the ‘In Memory Filesystem’

- Initialization of the allocated ``jnode`` with the appropriate OPS,
  directory handlers and pathconf limits and options.

- Allocation of a memory region for filesystem specific global
  management variables

- Creation of first mount table entry for the base filesystem

- Initialization of the first mount table chain entry to indicate that
  the mount point is NULL and the mounted filesystem is the base file
  system

After the base filesystem has been mounted, the following operations are
performed under its directory structure:

- Creation of the /dev directory

- Registration of devices under /dev directory

Base Filesystem
===============

RTEMS initially mounts a RAM based file system known as the base file system.
The root directory of this file system tree serves as the logical root of the
directory hierarchy (Figure 3). Under the root directory a ‘/dev’ directory
is created under which all I/O device directories and files are registered as
part of the file system hierarchy.
.. code:: c

    Figure of the tree structure goes here.

A RAM based file system draws its management resources from memory. File and
directory nodes are simply allocated blocks of memory. Data associated with
regular files is stored in collections of memory blocks. When the system is
turned off or restarted all memory-based components of the file system are
lost.

The base file system serves as a starting point for the mounting of file
systems that are resident on semi-permanent storage media. Examples of such
media include non- volatile memory, flash memory and IDE hard disk drives
(Figure 3). File systems of other types will be mounted onto mount points
within the base file system or other file systems that are subordinate to the
base file system. The framework set up under the base file system will allow
for these new file system types and the unique data and functionality that is
required to manage the future file systems.

Base Filesystem Mounting
------------------------

At present, the first file system to be mounted is the ‘In Memory File
System’. It is mounted using a standard MOUNT() command in which the mount
point is NULL.  This flags the mount as the first file system to be
registered under the operating system and appropriate initialization of file
system management information is performed (See figures 4 and 5). If a
different file system type is desired as the base file system, alterations
must be made to base_fs.c. This routine handles the mount of the base file
system.

.. code:: c

    Figure of the mount table chain goes here.

Once the root of the base file system has been established and it has been
recorded as the mount point of the base file system, devices are integrated
into the base file system. For every device that is configured into the
system (See ioman.c) a device registration process is performed. Device
registration produces a unique dev_t handle that consists of a major and
minor device number. In addition, the configuration information for each
device contains a text string that represents the fully qualified pathname to
that device’s place in the base file system’s hierarchy. A file system node
is created for the device along the specified registration path.

.. code:: c

    Figure  of the Mount Table Processing goes here.

Note: Other file systems can be mounted but they are mounted onto points
(directory mount points) in the base file system.

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

Mounting and Unmounting Filesystems
###################################

Mount Points
============

The following is the list of the characteristics of a mount point:

- The mount point must be a directory. It may have files and other
  directories under it. These files and directories will be hidden when the
  filesystem is mounted.

- The task must have read/write/execute permissions to the mount point
  or the mount attempt will be rejected.

- Only one filesystem can be mounted to a single mount point.

- The Root of the mountable filesystem will be referenced by the name
  of the mount point after the mount is complete.

Mount Table Chain
=================

The mount table chain is a dynamic list of structures that describe
mounted filesystems a specific points in the filesystem hierarchy. It is
initialized to an empty state during the base filesystem initialization.
The mount operation will add entries to the mount table chain. The
un-mount operation will remove entries from the mount table chain.

Each entry in the mount table chain is of the following type:
.. code:: c

    struct rtems_filesystem_mount_table_entry_tt
    {
    Chain_Node                             Node;
    rtems_filesystem_location_info_t       mt_point_node;
    rtems_filesystem_location_info_t       mt_fs_root;
    int                                    options;
    void                                  \*fs_info;
    rtems_filesystem_limits_and_options_t  pathconf_limits_and_options;
    /*
    *  When someone adds a mounted filesystem on a real device,
    *  this will need to be used.
    *
    *  The best option long term for this is probably an
    *  open file descriptor.
    \*/
    char                                  \*dev;
    };

*Node*
    The Node is used to produce a linked list of mount table entry nodes.

*mt_point_node*
    The mt_point_node contains all information necessary to access the
    directory where a filesystem is mounted onto.  This element may contain
    memory that is allocated during a path evaluation of the filesystem
    containing the mountpoint directory.  The generic code allows this
    memory to be returned by unmount when the filesystem identified by
    mt_fs_root is unmounted.

*mt_fs_root*
    The mt_fs_root contains all information necessary to identify the root
    of the mounted filesystem. The user is never allowed access to this
    node by the generic code, but it is used to identify to the mounted
    filesystem where to start evaluation of pathnames at.

*options*
    XXX

*fs_info*
    The fs_info element is a location available for use by the mounted file
    system to identify unique things applicable to this instance of the file
    system.  For example the IMFS uses this space to provide node
    identification that is unique for each instance (mounting) of the filesystem.

*pathconf_limits_and_options*
    XXX

*dev*
    This character string represents the device where the filesystem will reside.

Adding entries to the chain during mount
========================================

When a filesystem is mounted, its presence and location in the file
system hierarchy is recorded in a dynamic list structure known as a chain.
A unique rtems_filesystem_mount_table_entry_tt structure is logged for
each filesystem that is mounted. This includes the base filesystem.

Removing entries from the chain during unmount
==============================================

When a filesystem is dismounted its entry in the mount table chain is
extracted and the memory for this entry is freed.

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

System Call Development Notes
#############################

This set of routines represents the application’s interface to files and directories
under the RTEMS filesystem. All routines are compliant with POSIX standards if a
specific interface has been established. The list below represents the routines that have
been included as part of the application’s interface.

# access()

# chdir()

# chmod()

# chown()

# close()

# closedir()

# dup()

# dup2()

# fchmod()

# fcntl()

# fdatasync()

# fpathconf()

# fstat()

# ioctl()

# link()

# lseek()

# mkdir()

# mkfifo()

# mknod()

# mount()

# open()

# opendir()

# pathconf()

# read()

# readdir()

# unmount()

The sections that follow provide developmental information concerning each
of these functions.

.. COMMENT: @page

access
======

**File:**

access.c

**Processing:**

This routine is layered on the stat() function. It acquires the current
status information for the specified file and then determines if the
caller has the ability to access the file for read, write or execute
according to the mode argument to this function.

**Development Comments:**

This routine is layered on top of the stat() function. As long as the
st_mode element in the returned structure follow the standard UNIX
conventions, this function should support other filesystems without
alteration.

.. COMMENT: @page

chdir
=====

**File:**

chdir.c

**Processing:**

This routine will determine if the pathname that we are attempting to make
that current directory exists and is in fact a directory. If these
conditions are met the global indication of the current directory
(rtems_filesystem_current) is set to the rtems_filesystem_location_info_t
structure that is returned by the rtems_filesystem_evaluate_path()
routine.

**Development Comments:**

This routine is layered on the rtems_filesystem_evaluate_path() routine
and the filesystem specific OP table function node_type().

The routine node_type() must be a routine provided for each filesystem
since it must access the filesystems node information to determine which
of the following types the node is:

- RTEMS_FILESYSTEM_DIRECTORY

- RTEMS_FILESYSTEM_DEVICE

- RTEMS_FILESYSTEM_HARD_LINK

- RTEMS_FILESYSTEM_MEMORY_FILE

This acknowledges that the form of the node management information can
vary from one filesystem implementation to another.

RTEMS has a special global structure that maintains the current directory
location. This global variable is of type rtems_filesystem_location_info_t
and is called rtems_filesystem_current. This structure is not always
valid. In order to determine if the structure is valid, you must first
test the node_access element of this structure. If the pointer is NULL,
then the structure does not contain a valid indication of what the current
directory is.

.. COMMENT: @page

chmod
=====

**File:**

chmod.c

**Processing:**

This routine is layered on the open(), fchmod() and close() functions. As
long as the standard interpretation of the mode_t value is maintained,
this routine should not need modification to support other filesystems.

**Development Comments:**

The routine first determines if the selected file can be open with
read/write access.  This is required to allow modification of the mode
associated with the selected path.

The fchmod() function is used to actually change the mode of the path
using the integer file descriptor returned by the open() function.

After mode modification, the open file descriptor is closed.

.. COMMENT: @page

chown
=====

**File:**

chown.c

**Processing:**

This routine is layered on the rtems_filesystem_evaluate_path() and the
file system specific chown() routine that is specified in the OPS table
for the file system.

**Development Comments:**

rtems_filesystem_evaluate_path() is used to determine if the path
specified actually exists. If it does a rtems_filesystem_location_info_t
structure will be obtained that allows the shell function to locate the
OPS table that is to be used for this filesystem.

It is possible that the chown() function that should be in the OPS table
is not defined. A test for a non-NULL OPS table chown() entry is performed
before the function is called.

If the chown() function is defined in the indicated OPS table, the
function is called with the rtems_filesystem_location_info_t structure
returned from the path evaluation routine, the desired owner, and group
information.

.. COMMENT: @page

close
=====

**File:**

close.c

**Processing:**

This routine will allow for the closing of both network connections and
file system devices. If the file descriptor is associated with a network
device, the appropriate network function handler will be selected from a
table of previously registered network functions (rtems_libio_handlers)
and that function will be invoked.

If the file descriptor refers to an entry in the filesystem, the
appropriate handler will be selected using information that has been
placed in the file control block for the device (rtems_libio_t structure).

**Development Comments:**

rtems_file_descriptor_type examines some of the upper bits of the file
descriptor index. If it finds that the upper bits are set in the file
descriptor index, the device referenced is a network device.

Network device handlers are obtained from a special registration table
(rtems_libio_handlers) that is set up during network initialization. The
network handler invoked and the status of the network handler will be
returned to the calling process.

If none of the upper bits are set in the file descriptor index, the file
descriptor refers to an element of the RTEMS filesystem.

The following sequence will be performed for any filesystem file
descriptor:

# Use the rtems_libio_iop() function to obtain the rtems_libio_t
  structure for the file descriptor

# Range check the file descriptor using rtems_libio_check_fd()

# Determine if there is actually a function in the selected handler
  table that processes the close() operation for the filesystem and node
  type selected.  This is generally done to avoid execution attempts on
  functions that have not been implemented.

# If the function has been defined it is invoked with the file control
  block pointer as its argument.

# The file control block that was associated with the open file
  descriptor is marked as free using rtems_libio_free().

# The return code from the close handler is then passed back to the
  calling program.

.. COMMENT: @page

closedir
========

**File:**

closedir.c

**Processing:**

The code was obtained from the BSD group. This routine must clean up the
memory resources that are required to track an open directory. The code is
layered on the close() function and standard memory free() functions. It
should not require alterations to support other filesystems.

**Development Comments:**

The routine alters the file descriptor and the index into the DIR
structure to make it an invalid file descriptor. Apparently the memory
that is about to be freed may still be referenced before it is
reallocated.

The dd_buf structure’s memory is reallocated before the control structure
that contains the pointer to the dd_buf region.

DIR control memory is reallocated.

The close() function is used to free the file descriptor index.

.. COMMENT: @page

dup()      Unimplemented
========================

**File:**

dup.c

**Processing:**

**Development Comments:**

.. COMMENT: @page

dup2()      Unimplemented
=========================

**File:**

dup2.c

**Processing:**

**Development Comments:**

.. COMMENT: @page

fchmod
======

**File:**

fchmod.c

**Processing:**

This routine will alter the permissions of a node in a filesystem. It is
layered on the following functions and macros:

- rtems_file_descriptor_type()

- rtems_libio_iop()

- rtems_libio_check_fd()

- rtems_libio_check_permissions()

- fchmod() function that is referenced by the handler table in the
  file control block associated with this file descriptor

**Development Comments:**

The routine will test to see if the file descriptor index is associated
with a network connection. If it is, an error is returned from this
routine.

The file descriptor index is used to obtain the associated file control
block.

The file descriptor value is range checked.

The file control block is examined to determine if it has write
permissions to allow us to alter the mode of the file.

A test is made to determine if the handler table that is referenced in the
file control block contains an entry for the fchmod() handler function. If
it does not, an error is returned to the calling routine.

If the fchmod() handler function exists, it is called with the file
control block and the desired mode as parameters.

.. COMMENT: @page

fcntl()
=======

**File:**

fcntl.c

**Processing:**

This routine currently only interacts with the file control block. If the
structure of the file control block and the associated meanings do not
change, the partial implementation of fcntl() should remain unaltered for
other filesystem implementations.

**Development Comments:**

The only commands that have been implemented are the F_GETFD and F_SETFD.
The commands manipulate the LIBIO_FLAGS_CLOSE_ON_EXEC bit in the``flags`` element of the file control block associated with the file
descriptor index.

The current implementation of the function performs the sequence of
operations below:

# Test to see if we are trying to operate on a file descriptor
  associated with a network connection

# Obtain the file control block that is associated with the file
  descriptor index

# Perform a range check on the file descriptor index.

.. COMMENT: @page

fdatasync
=========

**File:**

fdatasync.c

**Processing:**

This routine is a template in the in memory filesystem that will route us to the
appropriate handler function to carry out the fdatasync() processing. In the in
memory filesystem this function is not necessary. Its function in a disk based file
system that employs a memory cache is to flush all memory based data buffers to
disk. It is layered on the following functions and macros:

- rtems_file_descriptor_type()

- rtems_libio_iop()

- rtems_libio_check_fd()

- rtems_libio_check_permissions()

- fdatasync() function that is referenced by the handler table in the
  file control block associated with this file descriptor

**Development Comments:**

The routine will test to see if the file descriptor index is associated
with a network connection. If it is, an error is returned from this
routine.

The file descriptor index is used to obtain the associated file control
block.

The file descriptor value is range checked.

The file control block is examined to determine if it has write
permissions to the file.

A test is made to determine if the handler table that is referenced in the
file control block contains an entry for the fdatasync() handler function.
If it does not an error is returned to the calling routine.

If the fdatasync() handler function exists, it is called with the file
control block as its parameter.

.. COMMENT: @page

fpathconf
=========

**File:**

fpathconf.c

**Processing:**

This routine is layered on the following functions and macros:

- rtems_file_descriptor_type()

- rtems_libio_iop()

- rtems_libio_check_fd()

- rtems_libio_check_permissions()

When a filesystem is mounted, a set of constants is specified for the
filesystem.  These constants are stored with the mount table entry for the
filesystem. These constants appear in the POSIX standard and are listed
below.

- PCLINKMAX

- PCMAXCANON

- PCMAXINPUT

- PCNAMEMAX

- PCPATHMAX

- PCPIPEBUF

- PCCHOWNRESTRICTED

- PCNOTRUNC

- PCVDISABLE

- PCASYNCIO

- PCPRIOIO

- PCSYNCIO

This routine will find the mount table information associated the file
control block for the specified file descriptor parameter. The mount table
entry structure contains a set of filesystem specific constants that can
be accessed by individual identifiers.

**Development Comments:**

The routine will test to see if the file descriptor index is associated
with a network connection. If it is, an error is returned from this
routine.

The file descriptor index is used to obtain the associated file control
block.

The file descriptor value is range checked.

The file control block is examined to determine if it has read permissions
to the file.

Pathinfo in the file control block is used to locate the mount table entry
for the filesystem associated with the file descriptor.

The mount table entry contains the pathconf_limits_and_options element.
This element is a table of constants that is associated with the
filesystem.

The name argument is used to reference the desired constant from the
pathconf_limits_and_options table.

.. COMMENT: @page

fstat
=====

**File:**

fstat.c

**Processing:**

This routine will return information concerning a file or network
connection. If the file descriptor is associated with a network
connection, the current implementation of ``fstat()`` will return a
mode set to ``S_IFSOCK``. In a later version, this routine will map the
status of a network connection to an external handler routine.

If the file descriptor is associated with a node under a filesystem, the
fstat()  routine will map to the fstat() function taken from the node
handler table.

**Development Comments:**

This routine validates that the struct stat pointer is not NULL so that
the return location is valid.

The struct stat is then initialized to all zeros.

rtems_file_descriptor_type() is then used to determine if the file
descriptor is associated with a network connection. If it is, network
status processing is performed. In the current implementation, the file
descriptor type processing needs to be improved. It currently just drops
into the normal processing for file system nodes.

If the file descriptor is associated with a node under a filesystem, the
following steps are performed:

# Obtain the file control block that is associated with the file descriptor
  index.

# Range check the file descriptor index.

# Test to see if there is a non-NULL function pointer in the handler
  table for the fstat() function. If there is, invoke the function with the
  file control block and the pointer to the stat structure.

.. COMMENT: @page

ioctl
=====

**File:**

ioctl.c

**Processing:**

Not defined in the POSIX 1003.1b standard but commonly supported in most
UNIX and POSIX system. Ioctl() is a catchall for I/O operations. Routine
is layered on external network handlers and filesystem specific handlers.
The development of new filesystems should not alter the basic processing
performed by this routine.

**Development Comments:**

The file descriptor is examined to determine if it is associated with a
network device. If it is processing is mapped to an external network
handler. The value returned by this handler is then returned to the
calling program.

File descriptors that are associated with a filesystem undergo the
following processing:

# The file descriptor index is used to obtain the associated file
  control block.

# The file descriptor value is range checked.

# A test is made to determine if the handler table that is referenced
  in the file control block contains an entry for the ioctl() handler
  function. If it does not, an error is returned to the calling routine.

# If the ioctl() handler function exists, it is called with the file
  control block, the command and buffer as its parameters.

# The return code from this function is then sent to the calling
  routine.

.. COMMENT: @page

link
====

**File:**

link.c

**Processing:**

This routine will establish a hard link to a file, directory or a device.
The target of the hard link must be in the same filesystem as the new link
being created. A link to an existing link is also permitted but the
existing link is evaluated before the new link is made. This implies that
links to links are reduced to links to files, directories or devices
before they are made.

**Development Comments:**

Calling parameters:
const char   \*existing
const char   \*new

link() will determine if the target of the link actually exists using
rtems_filesystem_evaluate_path()

rtems_filesystem_get_start_loc() is used to determine where to start the
path evaluation of the new name. This macro examines the first characters
of the name to see if the name of the new link starts with a
rtems_filesystem_is_separator. If it does the search starts from the root
of the RTEMS filesystem; otherwise the search will start from the current
directory.

The OPS table evalformake() function for the parent’s filesystem is used
to locate the node that will be the parent of the new link. It will also
locate the start of the new path’s name. This name will be used to define
a child under the parent directory.

If the parent is found, the routine will determine if the hard link that
we are trying to create will cross a filesystem boundary. This is not
permitted for hard-links.

If the hard-link does not cross a filesystem boundary, a check is
performed to determine if the OPS table contains an entry for the link()
function.

If a link() function is defined, the OPS table link() function will be
called to establish the actual link within the filesystem.

The return code from the OPS table link() function is returned to the
calling program.

.. COMMENT: @page

lseek
=====

**File:**

lseek.c

**Processing:**

This routine is layered on both external handlers and filesystem / node
type specific handlers. This routine should allow for the support of new
filesystems without modification.

**Development Comments:**

This routine will determine if the file descriptor is associated with a
network device. If it is lseek will map to an external network handler.
The handler will be called with the file descriptor, offset and whence as
its calling parameters. The return code from the external handler will be
returned to the calling routine.

If the file descriptor is not associated with a network connection, it is
associated with a node in a filesystem. The following steps will be
performed for filesystem nodes:

# The file descriptor is used to obtain the file control block for the
  node.

# The file descriptor is range checked.

# The offset element of the file control block is altered as indicated
  by the offset and whence calling parameters

# The handler table in the file control block is examined to determine
  if it contains an entry for the lseek() function. If it does not an error
  is returned to the calling program.

# The lseek() function from the designated handler table is called
  with the file control block, offset and whence as calling arguments

# The return code from the lseek() handler function is returned to the
  calling program

.. COMMENT: @page

mkdir
=====

**File:**

mkdir.c

**Processing:**

This routine attempts to create a directory node under the filesystem. The
routine is layered the mknod() function.

**Development Comments:**

See mknod() for developmental comments.

.. COMMENT: @page

mkfifo
======

**File:**

mkfifo.c

**Processing:**

This routine attempts to create a FIFO node under the filesystem. The
routine is layered the mknod() function.

**Development Comments:**

See mknod() for developmental comments

.. COMMENT: @page

mknod
=====

**File:**

mknod.c

**Processing:**

This function will allow for the creation of the following types of nodes
under the filesystem:

- directories

- regular files

- character devices

- block devices

- fifos

At the present time, an attempt to create a FIFO will result in an ENOTSUP
error to the calling function. This routine is layered the filesystem
specific routines evalformake and mknod. The introduction of a new
filesystem must include its own evalformake and mknod function to support
the generic mknod() function.  Under this condition the generic mknod()
function should accommodate other filesystem types without alteration.

**Development Comments:**

Test for nodal types - I thought that this test should look like the
following code:
.. code:: c

    if ( (mode & S_IFDIR) = = S_IFDIR) \||
    (mode & S_IFREG) = = S_IFREG) \||
    (mode & S_IFCHR) = = S_IFCHR) \||
    (mode & S_IFBLK) = = S_IFBLK) \||
    (mode & S_IFIFO) = = S_IFIFO))
    Set_errno_and_return_minus_one (EINVAL);

Where:

- S_IFREG (0100000) - Creation of a regular file

- S_IFCHR (0020000) - Creation of a character device

- S_IFBLK (0060000) - Creation of a block device

- S_IFIFO (0010000) - Creation of a FIFO

Determine if the pathname that we are trying to create starts at the root
directory or is relative to the current directory using the
rtems_filesystem_get_start_loc()  function.

Determine if the pathname leads to a valid directory that can be accessed
for the creation of a node.

If the pathname is a valid location to create a node, verify that a
filesystem specific mknod() function exists.

If the mknod() function exists, call the filesystem specific mknod()
function.  Pass the name, mode, device type and the location information
associated with the directory under which the node will be created.

.. COMMENT: @page

mount
=====

**File:**

mount.c

Arguments (Not a standard POSIX call):

rtems_filesystem_mount_table_entry_t   \**mt_entry,

If the mount operation is successful, this pointer to a pointer will be
set to reference the mount table chain entry that has been allocated for
this file system mount.

rtems_filesystem_operations_table   \*fs_ops,

This is a pointer to a table of functions that are associated with the
file system that we are about to mount. This is the mechanism to selected
file system type without keeping a dynamic database of all possible file
system types that are valid for the mount operation. Using this method, it
is only necessary to configure the filesystems that we wish to use into
the RTEMS build. Unused filesystems types will not be drawn into the
build.

char                      \*fsoptions,

This argument points to a string that selects mounting for read only
access or read/write access. Valid states are "RO" and "RW"

char                      \*device,

This argument is reserved for the name of a device that will be used to
access the filesystem information. Current filesystem implementations are
memory based and do not require a device to access filesystem information.

char                      \*mount_point

This is a pathname to a directory in a currently mounted filesystem that
allows read, write and execute permissions.  If successful, the node found
by evaluating this name, is stored in the mt_entry.

**Processing:**

This routine will handle the mounting of a filesystem on a mount point. If
the operation is successful, a pointer to the mount table chain entry
associated with the mounted filesystem will be returned to the calling
function. The specifics about the processing required at the mount point
and within the filesystem being mounted is isolated in the filesystem
specific mount() and fsmount_me()  functions. This allows the generic
mount() function to remain unaltered even if new filesystem types are
introduced.

**Development Comments:**

This routine will use get_file_system_options() to determine if the mount
options are valid ("RO" or "RW").

It confirms that a filesystem ops-table has been selected.

Space is allocated for a mount table entry and selective elements of the
temporary mount table entry are initialized.

If a mount point is specified: The mount point is examined to determine
that it is a directory and also has the appropriate permissions to allow a
filesystem to be mounted.

The current mount table chain is searched to determine that there is not
another filesystem mounted at the mount point we are trying to mount onto.

If a mount function is defined in the ops table for the filesystem
containing the mount point, it is called at this time.

If no mount point is specified: Processing if performed to set up the
mount table chain entry as the base filesystem.

If the fsmount_me() function is specified for ops-table of the filesystem
being mounted, that function is called to initialize for the new
filesystem.

On successful completion, the temporary mount table entry will be placed
on the mount table chain to record the presence of the mounted filesystem.

.. COMMENT: @page

open
====

**File:**

open.c

**Processing:**

This routine is layered on both RTEMS calls and filesystem specific
implementations of the open() function. These functional interfaces should
not change for new filesystems and therefore this code should be stable as
new file systems are introduced.

**Development Comments:**

This routine will allocate a file control block for the file or device
that we are about to open.

It will then test to see if the pathname exists. If it does a
rtems_filesystem_location_info_t data structure will be filled out. This
structure contains information that associates node information,
filesystem specific functions and mount table chain information with the
pathname.

If the create option has been it will attempt to create a node for a
regular file along the specified path. If a file already exists along this
path, an error will be generated; otherwise, a node will be allocated for
the file under the filesystem that contains the pathname. When a new node
is created, it is also evaluated so that an appropriate
rtems_filesystem_location_info_t data structure can be filled out for the
newly created node.

If the file exists or the new file was created successfully, the file
control block structure will be initialized with handler table
information, node information and the rtems_filesystem_location_info_t
data structure that describes the node and filesystem data in detail.

If an open() function exists in the filesystem specific handlers table for
the node that we are trying to open, it will be called at this time.

If any error is detected in the process, cleanup is performed. It consists
of freeing the file control block structure that was allocated at the
beginning of the generic open() routine.

On a successful open(), the index into the file descriptor table will be
calculated and returned to the calling routine.

.. COMMENT: @page

opendir
=======

**File:**

opendir.c

**Processing:**

This routine will attempt to open a directory for read access. It will
setup a DIR control structure that will be used to access directory
information. This routine is layered on the generic open() routine and
filesystem specific directory processing routines.

**Development Comments:**

The BSD group provided this routine.

.. COMMENT: @page

pathconf
========

**File:**

pathconf.c

**Processing:**

This routine will obtain the value of one of the path configuration
parameters and return it to the calling routine. It is layered on the
generic open() and fpathconf()  functions. These interfaces should not
change with the addition of new filesystem types.

**Development Comments:**

This routine will try to open the file indicated by path.

If successful, the file descriptor will be used to access the pathconf
value specified by ``name`` using the fpathconf() function.

The file that was accessed is then closed.

.. COMMENT: @page

read
====

**File:**

deviceio.c

**Processing:**

This routine is layered on a set of RTEMS calls and filesystem specific
read operations. The functions are layered in such a way as to isolate
them from change as new filesystems are introduced.

**Development Comments:**

This routine will examine the type of file descriptor it is sent.

If the file descriptor is associated with a network device, the read
function will be mapped to a special network handler. The return code from
the network handler will then be sent as the return code from generic
read() function.

For file descriptors that are associated with the filesystem the following
sequence will be performed:

# Obtain the file control block associated with the file descriptor

# Range check the file descriptor

# Determine that the buffer pointer is not invalid

# Check that the count is not zero

# Check the file control block to see if we have permissions to read

# If there is a read function in the handler table, invoke the handler
  table read() function

# Use the return code from the handler table read function(number of
  bytes read) to increment the offset element of the file control block

# Return the number of bytes read to the calling program

.. COMMENT: @page

readdir
=======

**File:**

readdir.c

**Processing:**

This routine was acquired from the BSD group. It has not been altered from
its original form.

**Development Comments:**

The routine calls a customized getdents() function that is provided by the
user.  This routine provides the filesystem specific aspects of reading a
directory.

It is layered on the read() function in the directory handler table. This
function has been mapped to the Imfs_dir_read() function.

.. COMMENT: @page

unmount
=======

**File:**

unmount.c

**Processing:**

This routine will attempt to dismount a mounted filesystem and then free
all resources that were allocated for the management of that filesystem.

**Development Comments:**

- This routine will determine if there are any filesystems currently
  mounted under the filesystem that we are trying to dismount. This would
  prevent the dismount of the filesystem.

- It will test to see if the current directory is in the filesystem
  that we are attempting to dismount. This would prevent the dismount of the
  filesystem.

- It will scan all the currently open file descriptors to determine is
  there is an open file descriptor to a file in the filesystem that we are
  attempting to unmount().

If the above preconditions are met then the following sequence is
performed:

# Call the filesystem specific unmount() function for the filesystem
  that contains the mount point. This routine should indicate that the mount
  point no longer has a filesystem mounted below it.

# Call the filesystem specific fsunmount_me() function for the mounted
  filesystem that we are trying to unmount(). This routine should clean up
  any resources that are no longer needed for the management of the file
  system being un-mounted.

# Extract the mount table entry for the filesystem that was just
  dismounted from the mount table chain.

# Free the memory associated with the extracted mount table entry.

.. COMMENT: @page

eval
====

**File:**

XXX

**Processing:**

XXX

**Development Comments:**

XXX

.. COMMENT: @page

getdentsc
=========

**File:**

XXX

**Processing:**

XXX

**Development Comments:**

XXX

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

Filesystem Implementation Requirements
######################################

This chapter details the behavioral requirements that all filesystem
implementations must adhere to.

General
=======

The RTEMS filesystem framework was intended to be compliant with the
POSIX Files and Directories interface standard. The following filesystem
characteristics resulted in a functional switching layer.
.. code:: c

    Figure of the Filesystem Functional Layering goes here.
    This figure includes networking and disk caching layering.

# Application programs are presented with a standard set of POSIX
  compliant functions that allow them to interface with the files, devices
  and directories in the filesystem. The interfaces to these routines do
  not reflect the type of subordinate filesystem implementation in which
  the file will be found.

# The filesystem framework developed under RTEMS allows for mounting
  filesystem of different types under the base filesystem.

# The mechanics of locating file information may be quite different
  between filesystem types.

# The process of locating a file may require crossing filesystem
  boundaries.

# The transitions between filesystem and the processing required to
  access information in different filesystem is not visible at the level
  of the POSIX function call.

# The POSIX interface standard provides file access by character
  pathname to the file in some functions and through an integer file
  descriptor in other functions.

# The nature of the integer file descriptor and its associated
  processing is operating system and filesystem specific.

# Directory and device information must be processed with some of the
  same routines that apply to files.

# The form and content of directory and device information differs
  greatly from that of a regular file.

# Files, directories and devices represent elements (nodes) of a tree
  hierarchy.

# The rules for processing each of the node types that exist under the
  filesystem are node specific but are still not reflected in the POSIX
  interface routines.

.. code:: c

    Figure of the Filesystem Functional Layering goes here.
    This figure focuses on the Base Filesystem and IMFS.

.. code:: c

    Figure of the IMFS Memfile control blocks


File and Directory Removal Constraints
======================================

The following POSIX constraints must be honored by all filesystems.

- If a node is a directory with children it cannot be removed.

- The root node of any filesystem, whether the base filesystem or a
  mounted filesystem, cannot be removed.

- A node that is a directory that is acting as the mount point of a file
  system cannot be removed.

- On filesystems supporting hard links, a link count is maintained.
  Prior to node removal, the node’s link count is decremented by one.  The
  link count must be less than one to allow for removal of the node.

API Layering
============

Mapping of Generic System Calls to Filesystem Specific Functions
----------------------------------------------------------------

The list of generic system calls includes the routines open(), read(),
write(), close(), etc..

The Files and Directories section of the POSIX Application Programs
Interface specifies a set of functions with calling arguments that are
used to gain access to the information in a filesystem. To the
application program, these functions allow access to information in any
mounted filesystem without explicit knowledge of the filesystem type or
the filesystem mount configuration. The following are functions that are
provided to the application:

# access()

# chdir()

# chmod()

# chown()

# close()

# closedir()

# fchmod()

# fcntl()

# fdatasync()

# fpathconf()

# fstat()

# fsync()

# ftruncate()

# link()

# lseek()

# mkdir()

# mknod()

# mount()

# open()

# opendir()

# pathconf()

# read()

# readdir()

# rewinddir()

# rmdir()

# rmnod()

# scandir()

# seekdir()

# stat()

# telldir()

# umask()

# unlink()

# unmount()

# utime()

# write()

The filesystem’s type as well as the node type within the filesystem
determine the nature of the processing that must be performed for each of
the functions above. The RTEMS filesystem provides a framework that
allows new filesystem to be developed and integrated without alteration
to the basic framework.

To provide the functional switching that is required, each of the POSIX
file and directory functions have been implemented as a shell function.
The shell function adheres to the POSIX interface standard. Within this
functional shell, filesystem and node type information is accessed which
is then used to invoke the appropriate filesystem and node type specific
routine to process the POSIX function call.

File/Device/Directory function access via file control block - rtems_libio_t structure
--------------------------------------------------------------------------------------

The POSIX open() function returns an integer file descriptor that is used
as a reference to file control block information for a specific file. The
file control block contains information that is used to locate node, file
system, mount table and functional handler information. The diagram in
Figure 8 depicts the relationship between and among the following
components.

# File Descriptor Table
  This is an internal RTEMS structure that tracks all currently defined file
  descriptors in the system. The index that is returned by the file open()
  operation references a slot in this table. The slot contains a pointer to
  the file descriptor table entry for this file. The rtems_libio_t structure
  represents the file control block.

# Allocation of entry in the File Descriptor Table
  Access to the file descriptor table is controlled through a semaphore that
  is implemented using the rtems_libio_allocate() function. This routine
  will grab a semaphore and then scan the file control blocks to determine
  which slot is free for use. The first free slot is marked as used and the
  index to this slot is returned as the file descriptor for the open()
  request. After the alterations have been made to the file control block
  table, the semaphore is released to allow further operations on the table.

# Maximum number of entries in the file descriptor table is
  configurable through the src/exec/sapi/headers/confdefs.h file. If the
  CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS constant is defined its value
  will represent the maximum number of file descriptors that are allowed.
  If CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS is not specified a default
  value of 20 will be used as the maximum number of file descriptors
  allowed.

# File control block - rtems_libio_t structure

  .. code:: c

      struct rtems_libio_tt {
      rtems_driver_name_t              \*driver;
      off_t                             size;
      off_t                             offset;
      unsigned32                        flags;
      rtems_filesystem_location_info_t  pathinfo;
      Objects_Id                        sem;
      unsigned32                        data0;
      void                              data1;
      void                              file_info;
      rtems_filesystem_file_handlers_r  handlers;
      };

  A file control block can exist for regular files, devices and directories.
  The following fields are important for regular file and directory access:

  - Size - For a file this represents the number of bytes currently
    stored in a file. For a directory this field is not filled in.

  - Offset - For a file this is the byte file position index relative to
    the start of the file. For a directory this is the byte offset into a
    sequence of dirent structures.

  - Pathinfo - This is a structure that provides a pointer to node
    information, OPS table functions, Handler functions and the mount table
    entry associated with this node.

  - file_info - A pointer to node information that is used by Handler
    functions

  - handlers - A pointer to a table of handler functions that operate on
    a file, device or directory through a file descriptor index

File/Directory function access via rtems_filesystem_location_info_t structure
-----------------------------------------------------------------------------

The rtems_filesystem_location_info_tt structure below provides sufficient
information to process nodes under a mounted filesystem.

.. code:: c

    struct rtems_filesystem_location_info_tt {
    void                                     \*node_access;
    rtems_filesystem_file_handlers_r         \*handlers;
    rtems_filesystem_operations_table        \*ops;
    rtems_filesystem_mount_table_entry_t     \*mt_entry;
    };

It contains a void pointer to filesystem specific nodal structure,
pointers to the OPS table for the filesystem that contains the node, the
node type specific handlers for the node and a reference pointer to the
mount table entry associated with the filesystem containing the node

Operation Tables
================

Filesystem specific operations are invoked indirectly.  The set of
routines that implement the filesystem are configured into two tables.
The Filesystem Handler Table has routines that are specific to a
filesystem but remain constant regardless of the actual file type.
The File Handler Table has routines that are both filesystem and file type
specific.

Filesystem Handler Table Functions
----------------------------------

OPS table functions are defined in a ``rtems_filesystem_operations_table``
structure.  It defines functions that are specific to a given filesystem.
One table exists for each filesystem that is supported in the RTEMS
configuration. The structure definition appears below and is followed by
general developmental information on each of the functions contained in this
function management structure.

.. code:: c

    typedef struct {
    rtems_filesystem_evalpath_t        evalpath;
    rtems_filesystem_evalmake_t        evalformake;
    rtems_filesystem_link_t            link;
    rtems_filesystem_unlink_t          unlink;
    rtems_filesystem_node_type_t       node_type;
    rtems_filesystem_mknod_t           mknod;
    rtems_filesystem_rmnod_t           rmnod;
    rtems_filesystem_chown_t           chown;
    rtems_filesystem_freenode_t        freenod;
    rtems_filesystem_mount_t           mount;
    rtems_filesystem_fsmount_me_t      fsmount_me;
    rtems_filesystem_unmount_t         unmount;
    rtems_filesystem_fsunmount_me_t    fsunmount_me;
    rtems_filesystem_utime_t           utime;
    rtems_filesystem_evaluate_link_t   eval_link;
    rtems_filesystem_symlink_t         symlink;
    } rtems_filesystem_operations_table;

.. COMMENT: @page

evalpath Handler
~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

evalpath

**Arguments:**

.. code:: c

    const char                        \*pathname,      /* IN     \*/
    int                                flags,         /* IN     \*/
    rtems_filesystem_location_info_t  \*pathloc        /* IN/OUT \*/

**Description:**

This routine is responsible for evaluating the pathname passed in
based upon the flags and the valid ``rthems_filesystem_location_info_t``.
Additionally, it must make any changes to pathloc necessary to identify
the pathname node.  This should include calling the evalpath for a mounted
filesystem, if the given filesystem supports the mount command.

This routine returns a 0 if the evaluation was successful.
Otherwise, it returns a -1 and sets errno to the correct error.

This routine is required and should NOT be set to NULL.

.. COMMENT: @page

evalformake Handler
~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

evalformake

**Arguments:**

.. code:: c

    const char                       \*path,       /* IN \*/
    rtems_filesystem_location_info_t \*pathloc,    /* IN/OUT \*/
    const char                      \**name        /* OUT    \*/

**Description:**

This method is given a path to evaluate and a valid start location.  It
is responsible for finding the parent node for a requested make command,
setting pathloc information to identify the parent node, and setting
the name pointer to the first character of the name of the new node.
Additionally, if the filesystem supports the mount command, this method
should call the evalformake routine for the mounted filesystem.

This routine returns a 0 if the evaluation was successful.  Otherwise, it
returns a -1 and sets errno to the correct error.

This routine is required and should NOT be set to NULL.  However, if
the filesystem does not support user creation of a new node, it may
set errno to ENOSYS and return -1.

.. COMMENT: @page

link Handler
~~~~~~~~~~~~

**Corresponding Structure Element:**

link

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t    \*to_loc,      /* IN \*/
    rtems_filesystem_location_info_t    \*parent_loc,  /* IN \*/
    const char                          \*token        /* IN \*/

**Description:**

This routine is used to create a hard-link.

It will first examine the st_nlink count of the node that we are trying to.
If the link count exceeds LINK_MAX an error will be returned.

The name of the link will be normalized to remove extraneous separators from
the end of the name.

This routine is not required and may be set to NULL.

.. COMMENT: @page

unlink Handler
~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

.. COMMENT: @page

node_type Handler
~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

node_type()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t    \*pathloc        /* IN \*/

**Description:**

XXX

.. COMMENT: @page

mknod Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

mknod()

**Arguments:**

.. code:: c

    const char                          \*token,        /* IN \*/
    mode_t                               mode,         /* IN \*/
    dev_t                                dev,          /* IN \*/
    rtems_filesystem_location_info_t    \*pathloc       /* IN/OUT \*/

**Description:**

XXX

.. COMMENT: @page

rmnod Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

.. COMMENT: @page

chown Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

chown()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t    \*pathloc        /* IN \*/
    uid_t                                owner          /* IN \*/
    gid_t                                group          /* IN \*/

**Description:**

XXX

.. COMMENT: @page

freenod Handler
~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

freenod()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t      \*pathloc       /* IN \*/

**Description:**

This routine is used by the generic code to allow memory to be allocated
during the evaluate routines, and set free when the generic code is finished
accessing a node.  If the evaluate routines allocate memory to identify
a node this routine should be utilized to free that memory.

This routine is not required and may be set to NULL.

.. COMMENT: @page

mount Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

mount()

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**Description:**

XXX

.. COMMENT: @page

fsmount_me Handler
~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**Description:**

This function is provided with a filesystem to take care of the internal
filesystem management details associated with mounting that filesystem
under the RTEMS environment.

It is not responsible for the mounting details associated the filesystem
containing the mount point.

The rtems_filesystem_mount_table_entry_t structure contains the key elements
below:

rtems_filesystem_location_info_t         \*mt_point_node,

This structure contains information about the mount point. This
allows us to find the ops-table and the handling functions
associated with the filesystem containing the mount point.

rtems_filesystem_location_info_t         \*fs_root_node,

This structure contains information about the root node in the file
system to be mounted. It allows us to find the ops-table and the
handling functions associated with the filesystem to be mounted.

rtems_filesystem_options_t                 options,

Read only or read/write access

void                                         \*fs_info,

This points to an allocated block of memory the will be used to
hold any filesystem specific information of a global nature. This
allocated region if important because it allows us to mount the
same filesystem type more than once under the RTEMS system.
Each instance of the mounted filesystem has its own set of global
management information that is separate from the global
management information associated with the other instances of the
mounted filesystem type.

rtems_filesystem_limits_and_options_t    pathconf_info,

The table contains the following set of values associated with the
mounted filesystem:

- link_max

- max_canon

- max_input

- name_max

- path_max

- pipe_buf

- posix_async_io

- posix_chown_restrictions

- posix_no_trunc

- posix_prio_io

- posix_sync_io

- posix_vdisable

These values are accessed with the pathconf() and the fpathconf ()
functions.

const char                                   \*dev

The is intended to contain a string that identifies the device that contains
the filesystem information. The filesystems that are currently implemented
are memory based and don’t require a device specification.

If the mt_point_node.node_access is NULL then we are mounting the base file
system.

The routine will create a directory node for the root of the IMFS file
system.

The node will have read, write and execute permissions for owner, group and
others.

The node’s name will be a null string.

A filesystem information structure(fs_info) will be allocated and
initialized for the IMFS filesystem. The fs_info pointer in the mount table
entry will be set to point the filesystem information structure.

The pathconf_info element of the mount table will be set to the appropriate
table of path configuration constants (LIMITS_AND_OPTIONS).

The fs_root_node structure will be filled in with the following:

- pointer to the allocated root node of the filesystem

- directory handlers for a directory node under the IMFS filesystem

- OPS table functions for the IMFS

A 0 will be returned to the calling routine if the process succeeded,
otherwise a 1 will be returned.

.. COMMENT: @page

unmount Handler
~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

.. COMMENT: @page

fsunmount_me Handler
~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_fsunmount_me()

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**Description:**

XXX

.. COMMENT: @page

utime Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

.. COMMENT: @page

eval_link Handler
~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

.. COMMENT: @page

symlink Handler
~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

.. COMMENT: @page

File Handler Table Functions
----------------------------

Handler table functions are defined in a ``rtems_filesystem_file_handlers_r``
structure. It defines functions that are specific to a node type in a given
filesystem. One table exists for each of the filesystem’s node types. The
structure definition appears below. It is followed by general developmental
information on each of the functions associated with regular files contained
in this function management structure.
.. code:: c

    typedef struct {
    rtems_filesystem_open_t           open;
    rtems_filesystem_close_t          close;
    rtems_filesystem_read_t           read;
    rtems_filesystem_write_t          write;
    rtems_filesystem_ioctl_t          ioctl;
    rtems_filesystem_lseek_t          lseek;
    rtems_filesystem_fstat_t          fstat;
    rtems_filesystem_fchmod_t         fchmod;
    rtems_filesystem_ftruncate_t      ftruncate;
    rtems_filesystem_fpathconf_t      fpathconf;
    rtems_filesystem_fsync_t          fsync;
    rtems_filesystem_fdatasync_t      fdatasync;
    rtems_filesystem_fcntl_t          fcntl;
    } rtems_filesystem_file_handlers_r;

.. COMMENT: @page

open Handler
~~~~~~~~~~~~

**Corresponding Structure Element:**

open()

**Arguments:**

.. code:: c

    rtems_libio_t   \*iop,
    const char      \*pathname,
    unsigned32       flag,
    unsigned32       mode

**Description:**

XXX

.. COMMENT: @page

close Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

close()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

read Handler
~~~~~~~~~~~~

**Corresponding Structure Element:**

read()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    void              \*buffer,
    unsigned32         count

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

write Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

ioctl Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    unsigned32       command,
    void              \*buffer

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

lseek Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

lseek()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    off_t              offset,
    int                whence

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

fstat Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

fstat()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t   \*loc,
    struct stat                        \*buf

**Description:**

The following information is extracted from the filesystem
specific node and placed in the ``stat`` structure:

- st_mode

- st_nlink

- st_ino

- st_uid

- st_gid

- st_atime

- st_mtime

- st_ctime

**NOTES:**

Both the ``stat()`` and ``lstat()`` services are
implemented directly using the ``fstat()`` handler.  The
difference in behavior is determined by how the path is evaluated
prior to this handler being called on a particular
file entity.

The ``fstat()`` system call is implemented directly
on top of this filesystem handler.

.. COMMENT: @page

fchmod Handler
~~~~~~~~~~~~~~

**Corresponding Structure Element:**

fchmod()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop
    mode_t              mode

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

ftruncate Handler
~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

**NOTES:**

XXX

fpathconf Handler
~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

fsync Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

fdatasync Handler
~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: @page

fcntl Handler
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**Description:**

XXX

**NOTES:**

XXX

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

In-Memory Filesystem
####################

This chapter describes the In-Memory FileSystem (IMFS).  The IMFS is a
full featured POSIX filesystem that keeps all information in memory.

IMFS Per Node Data Structure
============================

Each regular file, device, hard link, and directory is represented by a data
structure called a ``jnode``. The ``jnode`` is formally represented by the
structure:
.. code:: c

    struct IMFS_jnode_tt {
    Chain_Node          Node;             /* for chaining them together \*/
    IMFS_jnode_t       \*Parent;           /* Parent node \*/
    char                name[NAME_MAX+1]; /* "basename" \*/
    mode_t              st_mode;          /* File mode \*/
    nlink_t             st_nlink;         /* Link count \*/
    ino_t               st_ino;           /* inode \*/
    uid_t               st_uid;           /* User ID of owner \*/
    gid_t               st_gid;           /* Group ID of owner \*/
    time_t              st_atime;         /* Time of last access \*/
    time_t              st_mtime;         /* Time of last modification \*/
    time_t              st_ctime;         /* Time of last status change \*/
    IMFS_jnode_types_t  type;             /* Type of this entry \*/
    IMFS_typs_union     info;
    };

The key elements of this structure are listed below together with a brief
explanation of their role in the filesystem.

*Node*
    exists to allow the entire ``jnode`` structure to be included in a chain.

*Parent*
    is a pointer to another ``jnode`` structure that is the logical parent of the
    node in which it appears.  This field may be NULL if the file associated with
    this node is deleted but there are open file descriptors on this file or
    there are still hard links to this node.

*name*
    is the name of this node within the filesystem hierarchical tree. Example:  If
    the fully qualified pathname to the ``jnode`` was ``/a/b/c``, the``jnode`` name field would contain the null terminated string ``"c"``.

*st_mode*
    is the standard Unix access permissions for the file or directory.

*st_nlink*
    is the number of hard links to this file. When a ``jnode`` is first created
    its link count is set to 1. A ``jnode`` and its associated resources
    cannot be deleted unless its link count is less than 1.

*st_ino*
    is a unique node identification number

*st_uid*
    is the user ID of the file’s owner

*st_gid*
    is the group ID of the file’s owner

*st_atime*
    is the time of the last access to this file

*st_mtime*
    is the time of the last modification of this file

*st_ctime*
    is the time of the last status change to the file

*type*
    is the indication of node type must be one of the following states:
    - IMFS_DIRECTORY
    - IMFS_MEMORY_FILE
    - IMFS_HARD_LINK
    - IMFS_SYM_LINK
    - IMFS_DEVICE

*info*
    is this contains a structure that is unique to file type (See IMFS_typs_union
    in imfs.h).

    - IMFS_DIRECTORY

      An IMFS directory contains a dynamic chain structure that
      records all files and directories that are subordinate to the directory node.

    - IMFS_MEMORY_FILE

      Under the in memory filesystem regular files hold data. Data is dynamically
      allocated to the file in 128 byte chunks of memory.  The individual chunks of
      memory are tracked by arrays of pointers that record the address of the
      allocated chunk of memory. Single, double, and triple indirection pointers
      are used to record the locations of all segments of the file.  The
      memory organization of an IMFS file are discussed elsewhere in this manual.

    - IMFS_HARD_LINK

      The IMFS filesystem supports the concept of hard links to other nodes in the
      IMFS filesystem.  These hard links are actual pointers to other nodes in the
      same filesystem. This type of link cannot cross-filesystem boundaries.

    - IMFS_SYM_LINK

      The IMFS filesystem supports the concept of symbolic links to other nodes in
      any filesystem. A symbolic link consists of a pointer to a character string
      that represents the pathname to the target node. This type of link can
      cross-filesystem boundaries.  Just as with most versions of UNIX supporting
      symbolic links, a symbolic link can point to a non-existent file.

    - IMFS_DEVICE

      All RTEMS devices now appear as files under the in memory filesystem. On
      system initialization, all devices are registered as nodes under the file
      system.

Miscellaneous IMFS Information
==============================

Memory associated with the IMFS
===============================

A memory based filesystem draws its resources for files and directories
from the memory resources of the system. When it is time to un-mount the
filesystem, the memory resources that supported filesystem are set free.
In order to free these resources, a recursive walk of the filesystems
tree structure will be performed. As the leaf nodes under the filesystem
are encountered their resources are freed. When directories are made empty
by this process, their resources are freed.

Node removal constraints for the IMFS
-------------------------------------

The IMFS conforms to the general filesystem requirements for node
removal.  See `File and Directory Removal Constraints`_.

IMFS General Housekeeping Notes
-------------------------------

The following is a list of odd housekeeping notes for the IMFS.

- If the global variable rtems_filesystem_current refers to the node that
  we are trying to remove, the node_access element of this structure must be
  set to NULL to invalidate it.

- If the node was of IMFS_MEMORY_FILE type, free the memory associated
  with the memory file before freeing the node. Use the IMFS_memfile_remove()
  function.

IMFS Operation Tables
=====================

IMFS Filesystem Handler Table Functions
---------------------------------------

OPS table functions are defined in a rtems_filesystem_operations_table
structure.  It defines functions that are specific to a given filesystem.
One table exists for each filesystem that is supported in the RTEMS
configuration. The structure definition appears below and is followed by
general developmental information on each of the functions contained in this
function management structure.
.. code:: c

    rtems_filesystem_operations_table  IMFS_ops = {
    IMFS_eval_path,
    IMFS_evaluate_for_make,
    IMFS_link,
    IMFS_unlink,
    IMFS_node_type,
    IMFS_mknod,
    IMFS_rmnod,
    IMFS_chown,
    IMFS_freenodinfo,
    IMFS_mount,
    IMFS_initialize,
    IMFS_unmount,
    IMFS_fsunmount,
    IMFS_utime,
    IMFS_evaluate_link,
    IMFS_symlink,
    IMFS_readlink
    };

.. COMMENT: @page

IMFS_evalpath()
~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_evalformake()
~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_link()
~~~~~~~~~~~

**Corresponding Structure Element:**

link

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t    \*to_loc,      /* IN \*/
    rtems_filesystem_location_info_t    \*parent_loc,  /* IN \*/
    const char                          \*token        /* IN \*/

**File:**

imfs_link.c

**Description:**

This routine is used in the IMFS filesystem to create a hard-link.

It will first examine the st_nlink count of the node that we are trying to.
If the link count exceeds LINK_MAX an error will be returned.

The name of the link will be normalized to remove extraneous separators from
the end of the name.

IMFS_create_node will be used to create a filesystem node that will have the
following characteristics:

- parent that was determined in the link() function in file link.c

- Type will be set to IMFS_HARD_LINK

- name will be set to the normalized name

- mode of the hard-link will be set to the mode of the target node

If there was trouble allocating memory for the new node an error will be
returned.

The st_nlink count of the target node will be incremented to reflect the new
link.

The time fields of the link will be set to reflect the creation time of the
hard-link.

.. COMMENT: @page

IMFS_unlink()
~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_node_type()
~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_node_type()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t    \*pathloc        /* IN \*/

**File:**

imfs_ntype.c

**Description:**

This routine will locate the IMFS_jnode_t structure that holds ownership
information for the selected node in the filesystem.

This structure is pointed to by pathloc->node_access.

The IMFS_jnode_t type element indicates one of the node types listed below:

- RTEMS_FILESYSTEM_DIRECTORY

- RTEMS_FILESYSTEM_DEVICE

- RTEMS_FILESYSTEM_HARD_LINK

- RTEMS_FILESYSTEM_MEMORY_FILE

.. COMMENT: @page

IMFS_mknod()
~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_mknod()

**Arguments:**

.. code:: c

    const char                          \*token,        /* IN \*/
    mode_t                               mode,         /* IN \*/
    dev_t                                dev,          /* IN \*/
    rtems_filesystem_location_info_t    \*pathloc       /* IN/OUT \*/

**File:**

imfs_mknod.c

**Description:**

This routine will examine the mode argument to determine is we are trying to
create a directory, regular file and a device node. The creation of other
node types is not permitted and will cause an assert.

Memory space will be allocated for a ``jnode`` and the node will be set up
according to the nodal type that was specified. The IMFS_create_node()
function performs the allocation and setup of the node.

The only problem that is currently reported is the lack of memory when we
attempt to allocate space for the ``jnode`` (ENOMEN).

.. COMMENT: @page

IMFS_rmnod()
~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_chown()
~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_chown()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t    \*pathloc        /* IN \*/
    uid_t                                owner          /* IN \*/
    gid_t                                group          /* IN \*/

**File:**

imfs_chown.c

**Description:**

This routine will locate the IMFS_jnode_t structure that holds ownership
information for the selected node in the filesystem.

This structure is pointed to by pathloc->node_access.

The st_uid and st_gid fields of the node are then modified. Since this is a
memory based filesystem, no further action is required to alter the
ownership of the IMFS_jnode_t structure.

.. COMMENT: @page

IMFS_freenod()
~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_freenod()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t      \*pathloc       /* IN \*/

**File:**

imfs_free.c

**Description:**

This method is a private function to the IMFS.  It is called by IMFS routines
to free nodes that have been allocated.  Examples of where this routine
may be called from are unlink and rmnod.

Note:  This routine should not be confused with the filesystem callback
freenod.  The IMFS allocates memory until the node no longer exists.

.. COMMENT: @page

IMFS_freenodinfo()
~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_freenodinfo()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t      \*pathloc       /* IN \*/

**File:**

imfs_free.c

**Description:**

The In-Memory File System does not need to allocate memory during the
evaluate routines. Therefore, this routine simply routines PASS.

.. COMMENT: @page

IMFS_mount()
~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_mount()

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**File:**

imfs_mount.c

**Description:**

This routine provides the filesystem specific processing required to mount a
filesystem for the system that contains the mount point. It will determine
if the point that we are trying to mount onto is a node of IMFS_DIRECTORY
type.

If it is the node’s info element is altered so that the info.directory.mt_fs
element points to the mount table chain entry that is associated with the
mounted filesystem at this point. The info.directory.mt_fs element can be
examined to determine if a filesystem is mounted at a directory. If it is
NULL, the directory does not serve as a mount point. A non-NULL entry
indicates that the directory does serve as a mount point and the value of
info.directory.mt_fs can be used to locate the mount table chain entry that
describes the filesystem mounted at this point.

.. COMMENT: @page

IMFS_fsmount_me()
~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_initialize()

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**File:**

imfs_init.c

**Description:**

This function is provided with a filesystem to take care of the internal
filesystem management details associated with mounting that filesystem
under the RTEMS environment.

It is not responsible for the mounting details associated the filesystem
containing the mount point.

The rtems_filesystem_mount_table_entry_t structure contains the key elements
below:

rtems_filesystem_location_info_t         \*mt_point_node,

This structure contains information about the mount point. This
allows us to find the ops-table and the handling functions
associated with the filesystem containing the mount point.

rtems_filesystem_location_info_t         \*fs_root_node,

This structure contains information about the root node in the file
system to be mounted. It allows us to find the ops-table and the
handling functions associated with the filesystem to be mounted.

rtems_filesystem_options_t                 options,

Read only or read/write access

void                                         \*fs_info,

This points to an allocated block of memory the will be used to
hold any filesystem specific information of a global nature. This
allocated region if important because it allows us to mount the
same filesystem type more than once under the RTEMS system.
Each instance of the mounted filesystem has its own set of global
management information that is separate from the global
management information associated with the other instances of the
mounted filesystem type.

rtems_filesystem_limits_and_options_t    pathconf_info,

The table contains the following set of values associated with the
mounted filesystem:

- link_max

- max_canon

- max_input

- name_max

- path_max

- pipe_buf

- posix_async_io

- posix_chown_restrictions

- posix_no_trunc

- posix_prio_io

- posix_sync_io

- posix_vdisable

These values are accessed with the pathconf() and the fpathconf ()
functions.

const char                                   \*dev

The is intended to contain a string that identifies the device that contains
the filesystem information. The filesystems that are currently implemented
are memory based and don’t require a device specification.

If the mt_point_node.node_access is NULL then we are mounting the base file
system.

The routine will create a directory node for the root of the IMFS file
system.

The node will have read, write and execute permissions for owner, group and
others.

The node’s name will be a null string.

A filesystem information structure(fs_info) will be allocated and
initialized for the IMFS filesystem. The fs_info pointer in the mount table
entry will be set to point the filesystem information structure.

The pathconf_info element of the mount table will be set to the appropriate
table of path configuration constants ( IMFS_LIMITS_AND_OPTIONS ).

The fs_root_node structure will be filled in with the following:

- pointer to the allocated root node of the filesystem

- directory handlers for a directory node under the IMFS filesystem

- OPS table functions for the IMFS

A 0 will be returned to the calling routine if the process succeeded,
otherwise a 1 will be returned.

.. COMMENT: @page

IMFS_unmount()
~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_unmount()

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**File:**

imfs_unmount.c

**Description:**

This routine allows the IMFS to unmount a filesystem that has been
mounted onto a IMFS directory.

The mount entry mount point node access is verified to be a mounted
directory.  It’s mt_fs is set to NULL.  This identifies to future
calles into the IMFS that this directory node is no longer a mount
point.  Additionally, it will allow any directories that were hidden
by the mounted system to again become visible.

.. COMMENT: @page

IMFS_fsunmount()
~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_fsunmount()

**Arguments:**

.. code:: c

    rtems_filesystem_mount_table_entry_t   \*mt_entry

**File:**

imfs_init.c

**Description:**

This method unmounts this instance of the IMFS file system.  It is the
counterpart to the IMFS_initialize routine.  It is called by the generic
code under the fsunmount_me callback.

All method loops finding the first encountered node with no children and
removing the node from the tree, thus returning allocated resources.  This
is done until all allocated nodes are returned.

.. COMMENT: @page

IMFS_utime()
~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_eval_link()
~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

Regular File Handler Table Functions
------------------------------------

Handler table functions are defined in a rtems_filesystem_file_handlers_r
structure. It defines functions that are specific to a node type in a given
filesystem. One table exists for each of the filesystem’s node types. The
structure definition appears below. It is followed by general developmental
information on each of the functions associated with regular files contained
in this function management structure.
.. code:: c

    rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
    memfile_open,
    memfile_close,
    memfile_read,
    memfile_write,
    memfile_ioctl,
    memfile_lseek,
    IMFS_stat,
    IMFS_fchmod,
    memfile_ftruncate,
    NULL,                /* fpathconf \*/
    NULL,                /* fsync \*/
    IMFS_fdatasync,
    IMFS_fcntl
    };

.. COMMENT: @page

memfile_open() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

memfile_open()

**Arguments:**

.. code:: c

    rtems_libio_t   \*iop,
    const char      \*pathname,
    unsigned32       flag,
    unsigned32       mode

**File:**

memfile.c

**Description:**

Currently this function is a shell. No meaningful processing is performed and
a success code is always returned.

.. COMMENT: @page

memfile_close() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

memfile_close()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop

**File:**

memfile.c

**Description:**

This routine is a dummy for regular files under the base filesystem. It
performs a capture of the IMFS_jnode_t pointer from the file control block
and then immediately returns a success status.

.. COMMENT: @page

memfile_read() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

memfile_read()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    void              \*buffer,
    unsigned32         count

**File:**

memfile.c

**Description:**

This routine will determine the ``jnode`` that is associated with this file.

It will then call IMFS_memfile_read() with the ``jnode``, file position index,
buffer and transfer count as arguments.

IMFS_memfile_read() will do the following:

- Verify that the ``jnode`` is associated with a memory file

- Verify that the destination of the read is valid

- Adjust the length of the read if it is too long

- Acquire data from the memory blocks associated with the file

- Update the access time for the data in the file

.. COMMENT: @page

memfile_write() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

memfile_ioctl() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    unsigned32       command,
    void              \*buffer

**File:**

memfile.c

**Description:**

The current code is a placeholder for future development. The routine returns
a successful completion status.

.. COMMENT: @page

memfile_lseek() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

Memfile_lseek()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    off_t              offset,
    int                whence

**File:**

memfile.c

**Description:**

This routine make sure that the memory based file is sufficiently large to
allow for the new file position index.

The IMFS_memfile_extend() function is used to evaluate the current size of
the memory file and allocate additional memory blocks if required by the new
file position index. A success code is always returned from this routine.

.. COMMENT: @page

IMFS_stat() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_stat()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t   \*loc,
    struct stat                        \*buf

**File:**

imfs_stat.c

**Description:**

This routine actually performs status processing for both devices and regular
files.

The IMFS_jnode_t structure is referenced to determine the type of node under
the filesystem.

If the node is associated with a device, node information is extracted and
transformed to set the st_dev element of the stat structure.

If the node is a regular file, the size of the regular file is extracted from
the node.

This routine rejects other node types.

The following information is extracted from the node and placed in the stat
structure:

- st_mode

- st_nlink

- st_ino

- st_uid

- st_gid

- st_atime

- st_mtime

- st_ctime

.. COMMENT: @page

IMFS_fchmod() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_fchmod()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop
    mode_t              mode

**File:**

imfs_fchmod.c

**Description:**

This routine will obtain the pointer to the IMFS_jnode_t structure from the
information currently in the file control block.

Based on configuration the routine will acquire the user ID from a call to
getuid()  or from the IMFS_jnode_t structure.

It then checks to see if we have the ownership rights to alter the mode of
the file.  If the caller does not, an error code is returned.

An additional test is performed to verify that the caller is not trying to
alter the nature of the node. If the caller is attempting to alter more than
the permissions associated with user group and other, an error is returned.

If all the preconditions are met, the user, group and other fields are set
based on the mode calling parameter.

.. COMMENT: @page

memfile_ftruncate() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

No pathconf() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

NULL

**Arguments:**

Not Implemented

**File:**

Not Implemented

**Description:**

Not Implemented

.. COMMENT: @page

No fsync() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_fdatasync() for Regular Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

Directory Handler Table Functions
---------------------------------

Handler table functions are defined in a rtems_filesystem_file_handlers_r
structure. It defines functions that are specific to a node type in a given
filesystem. One table exists for each of the filesystem’s node types. The
structure definition appears below. It is followed by general developmental
information on each of the functions associated with directories contained in
this function management structure.
.. code:: c

    rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
    IMFS_dir_open,
    IMFS_dir_close,
    IMFS_dir_read,
    NULL,             /* write \*/
    NULL,             /* ioctl \*/
    IMFS_dir_lseek,
    IMFS_dir_fstat,
    IMFS_fchmod,
    NULL,             /* ftruncate \*/
    NULL,             /* fpathconf \*/
    NULL,             /* fsync \*/
    IMFS_fdatasync,
    IMFS_fcntl
    };

.. COMMENT: @page

IMFS_dir_open() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_dir_open()

**Arguments:**

.. code:: c

    rtems_libio_t  \*iop,
    const char     \*pathname,
    unsigned32      flag,
    unsigned32      mode

**File:**

imfs_directory.c

**Description:**

This routine will look into the file control block to find the ``jnode`` that
is associated with the directory.

The routine will verify that the node is a directory. If its not a directory
an error code will be returned.

If it is a directory, the offset in the file control block will be set to 0.
This allows us to start reading at the beginning of the directory.

.. COMMENT: @page

IMFS_dir_close() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_dir_close()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop

**File:**

imfs_directory.c

**Description:**

This routine is a dummy for directories under the base filesystem. It
immediately returns a success status.

.. COMMENT: @page

IMFS_dir_read() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_dir_read

**Arguments:**

.. code:: c

    rtems_libio_t  \*iop,
    void           \*buffer,
    unsigned32      count

**File:**

imfs_directory.c

**Description:**

This routine will read a fixed number of directory entries from the current
directory offset. The number of directory bytes read will be returned from
this routine.

.. COMMENT: @page

No write() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

No ioctl() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

ioctl

**Arguments:**

**File:**

Not supported

**Description:**

XXX

.. COMMENT: @page

IMFS_dir_lseek() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_dir_lseek()

**Arguments:**

.. code:: c

    rtems_libio_t      \*iop,
    off_t               offset,
    int                 whence

**File:**

imfs_directory.c

**Description:**

This routine alters the offset in the file control block.

No test is performed on the number of children under the current open
directory.  The imfs_dir_read() function protects against reads beyond the
current size to the directory by returning a 0 bytes transfered to the
calling programs whenever the file position index exceeds the last entry in
the open directory.

.. COMMENT: @page

IMFS_dir_fstat() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

imfs_dir_fstat()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t   \*loc,
    struct stat                        \*buf

**File:**

imfs_directory.c

**Description:**

The node access information in the rtems_filesystem_location_info_t structure
is used to locate the appropriate IMFS_jnode_t structure. The following
information is taken from the IMFS_jnode_t structure and placed in the stat
structure:

- st_ino

- st_mode

- st_nlink

- st_uid

- st_gid

- st_atime

- st_mtime

- st_ctime

The st_size field is obtained by running through the chain of directory
entries and summing the sizes of the dirent structures associated with each
of the children of the directory.

.. COMMENT: @page

IMFS_fchmod() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_fchmod()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop
    mode_t             mode

**File:**

imfs_fchmod.c

**Description:**

This routine will obtain the pointer to the IMFS_jnode_t structure from the
information currently in the file control block.

Based on configuration the routine will acquire the user ID from a call to
getuid()  or from the IMFS_jnode_t structure.

It then checks to see if we have the ownership rights to alter the mode of
the file.  If the caller does not, an error code is returned.

An additional test is performed to verify that the caller is not trying to
alter the nature of the node. If the caller is attempting to alter more than
the permissions associated with user group and other, an error is returned.

If all the preconditions are met, the user, group and other fields are set
based on the mode calling parameter.

.. COMMENT: @page

No ftruncate() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

No fpathconf() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

fpathconf

**Arguments:**

Not Implemented

**File:**

Not Implemented

**Description:**

Not Implemented

.. COMMENT: @page

No fsync() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

IMFS_fdatasync() for Directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

Device Handler Table Functions
------------------------------

Handler table functions are defined in a rtems_filesystem_file_handlers_r
structure. It defines functions that are specific to a node type in a given
filesystem. One table exists for each of the filesystem’s node types. The
structure definition appears below. It is followed by general developmental
information on each of the functions associated with devices contained in
this function management structure.
.. code:: c

    typedef struct {
    rtems_filesystem_open_t           open;
    rtems_filesystem_close_t          close;
    rtems_filesystem_read_t           read;
    rtems_filesystem_write_t          write;
    rtems_filesystem_ioctl_t          ioctl;
    rtems_filesystem_lseek_t          lseek;
    rtems_filesystem_fstat_t          fstat;
    rtems_filesystem_fchmod_t         fchmod;
    rtems_filesystem_ftruncate_t      ftruncate;
    rtems_filesystem_fpathconf_t      fpathconf;
    rtems_filesystem_fsync_t          fsync;
    rtems_filesystem_fdatasync_t      fdatasync;
    } rtems_filesystem_file_handlers_r;

.. COMMENT: @page

device_open() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

device_open()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    const char        \*pathname,
    unsigned32         flag,
    unsigned32         mode

**File:**

deviceio.c

**Description:**

This routine will use the file control block to locate the node structure for
the device.

It will extract the major and minor device numbers from the ``jnode``.

The major and minor device numbers will be used to make a rtems_io_open()
function call to open the device driver. An argument list is sent to the
driver that contains the file control block, flags and mode information.

.. COMMENT: @page

device_close() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

device_close()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop

**File:**

deviceio.c

**Description:**

This routine extracts the major and minor device driver numbers from the
IMFS_jnode_t that is referenced in the file control block.

It also forms an argument list that contains the file control block.

A rtems_io_close() function call is made to close the device specified by the
major and minor device numbers.

.. COMMENT: @page

device_read() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

device_read()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    void              \*buffer,
    unsigned32         count

**File:**

deviceio.c

**Description:**

This routine will extract the major and minor numbers for the device from the -
jnode- associated with the file descriptor.

A rtems_io_read() call will be made to the device driver associated with the file
descriptor. The major and minor device number will be sent as arguments as well
as an argument list consisting of:

- file control block

- file position index

- buffer pointer where the data read is to be placed

- count indicating the number of bytes that the program wishes to read
  from the device

- flags from the file control block

On return from the rtems_io_read() the number of bytes that were actually
read will be returned to the calling program.

.. COMMENT: @page

device_write() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

device_ioctl() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

ioctl

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    unsigned32         command,
    void              \*buffer

**File:**

deviceio.c

**Description:**

This handler will obtain status information about a device.

The form of status is device dependent.

The rtems_io_control() function uses the major and minor number of the device
to obtain the status information.

rtems_io_control() requires an rtems_libio_ioctl_args_t argument list which
contains the file control block, device specific command and a buffer pointer
to return the device status information.

The device specific command should indicate the nature of the information
that is desired from the device.

After the rtems_io_control() is processed, the buffer should contain the
requested device information.

If the device information is not obtained properly a -1 will be returned to
the calling program, otherwise the ioctl_return value is returned.

.. COMMENT: @page

device_lseek() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

device_lseek()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop,
    off_t              offset,
    int                whence

**File:**

deviceio.c

**Description:**

At the present time this is a placeholder function. It always returns a
successful status.

.. COMMENT: @page

IMFS_stat() for Devices
~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_stat()

**Arguments:**

.. code:: c

    rtems_filesystem_location_info_t   \*loc,
    struct stat                        \*buf

**File:**

imfs_stat.c

**Description:**

This routine actually performs status processing for both devices and regular files.

The IMFS_jnode_t structure is referenced to determine the type of node under the
filesystem.

If the node is associated with a device, node information is extracted and
transformed to set the st_dev element of the stat structure.

If the node is a regular file, the size of the regular file is extracted from the node.

This routine rejects other node types.

The following information is extracted from the node and placed in the stat
structure:

- st_mode

- st_nlink

- st_ino

- st_uid

- st_gid

- st_atime

- st_mtime

- st_ctime

.. COMMENT: @page

IMFS_fchmod() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

IMFS_fchmod()

**Arguments:**

.. code:: c

    rtems_libio_t     \*iop
    mode_t             mode

**File:**

imfs_fchmod.c

**Description:**

This routine will obtain the pointer to the IMFS_jnode_t structure from the
information currently in the file control block.

Based on configuration the routine will acquire the user ID from a call to
getuid()  or from the IMFS_jnode_t structure.

It then checks to see if we have the ownership rights to alter the mode of
the file.  If the caller does not, an error code is returned.

An additional test is performed to verify that the caller is not trying to
alter the nature of the node. If the caller is attempting to alter more than
the permissions associated with user group and other, an error is returned.

If all the preconditions are met, the user, group and other fields are set
based on the mode calling parameter.

.. COMMENT: @page

No ftruncate() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

No fpathconf() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

fpathconf

**Arguments:**

Not Implemented

**File:**

Not Implemented

**Description:**

Not Implemented

.. COMMENT: @page

No fsync() for Devices
~~~~~~~~~~~~~~~~~~~~~~

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: @page

No fdatasync() for Devices
~~~~~~~~~~~~~~~~~~~~~~~~~~

Not Implemented

**Corresponding Structure Element:**

XXX

**Arguments:**

XXX

**File:**

XXX

**Description:**

XXX

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

Miniature In-Memory Filesystem
##############################

This chapter describes the Miniature In-Memory FileSystem (miniIMFS).
The miniIMFS is a reduced feature version of the IMFS designed to
provide minimal functionality and have a low memory footprint.

This chapter should be written after the IMFS chapter is completed
and describe the implementation of the mini-IMFS.

.. COMMENT: COPYRIGHT (c) 1988-2002.

.. COMMENT: On-Line Applications Research Corporation (OAR).

.. COMMENT: All rights reserved.

Trivial FTP Client Filesystem
#############################

This chapter describes the Trivial FTP (TFTP) Client Filesystem.

This chapter should be written after the IMFS chapter is completed
and describe the implementation of the TFTP.

Command and Variable Index
##########################

There are currently no Command and Variable Index entries.

.. COMMENT: @printindex fn

Concept Index
#############

There are currently no Concept Index entries.

.. COMMENT: @printindex cp