1 | /*===============================================================*\ |
---|
2 | | Project: RTEMS fsmount | |
---|
3 | +-----------------------------------------------------------------+ |
---|
4 | | File: fsmount.h | |
---|
5 | +-----------------------------------------------------------------+ |
---|
6 | | Copyright (c) 2003 IMD | |
---|
7 | | Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | |
---|
8 | | <Thomas.Doerfler@imd-systems.de> | |
---|
9 | | all rights reserved | |
---|
10 | +-----------------------------------------------------------------+ |
---|
11 | | this file contains the fsmount functions. These functions | |
---|
12 | | are used to mount a list of filesystems (and create their mount | |
---|
13 | | points before) | |
---|
14 | | | |
---|
15 | | The license and distribution terms for this file may be | |
---|
16 | | found in the file LICENSE in this distribution or at | |
---|
17 | | http://www.rtems.com/license/LICENSE. | |
---|
18 | | | |
---|
19 | +-----------------------------------------------------------------+ |
---|
20 | | date history ID | |
---|
21 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
---|
22 | | 02.07.03 creation doe | |
---|
23 | \*===============================================================*/ |
---|
24 | |
---|
25 | #ifndef _FSMOUNT_H |
---|
26 | #define _FSMOUNT_H |
---|
27 | |
---|
28 | #include <rtems.h> |
---|
29 | #include <rtems/libio.h> |
---|
30 | #include <rtems/libcsupport.h> |
---|
31 | |
---|
32 | #ifdef __cplusplus |
---|
33 | extern "C" { |
---|
34 | #endif |
---|
35 | |
---|
36 | /* |
---|
37 | * bits to define, what errors will cause reporting (via printf) and |
---|
38 | * abort of mount processing |
---|
39 | * Use a combination of these bits |
---|
40 | * for the fields "report_reasons" and "abort_reasons" |
---|
41 | */ |
---|
42 | #define FSMOUNT_MNT_OK 0x0001 /* mounted ok */ |
---|
43 | #define FSMOUNT_MNTPNT_CRTERR 0x0002 /* cannot create mount point */ |
---|
44 | #define FSMOUNT_MNT_FAILED 0x0004 /* mounting failed */ |
---|
45 | |
---|
46 | typedef struct { |
---|
47 | char *dev; |
---|
48 | char *mount_point; |
---|
49 | rtems_filesystem_operations_table *fs_ops; |
---|
50 | rtems_filesystem_options_t mount_options; |
---|
51 | uint16_t report_reasons; |
---|
52 | uint16_t abort_reasons; |
---|
53 | } fstab_t; |
---|
54 | |
---|
55 | |
---|
56 | /*=========================================================================*\ |
---|
57 | | Function: | |
---|
58 | \*-------------------------------------------------------------------------*/ |
---|
59 | int rtems_fsmount |
---|
60 | ( |
---|
61 | /*-------------------------------------------------------------------------*\ |
---|
62 | | Purpose: | |
---|
63 | | This function will create the mount points listed and mount the file | |
---|
64 | | systems listed in the calling parameters | |
---|
65 | +---------------------------------------------------------------------------+ |
---|
66 | | Input Parameters: | |
---|
67 | \*-------------------------------------------------------------------------*/ |
---|
68 | const fstab_t *fstab_ptr, /* Ptr to filesystem mount table */ |
---|
69 | int fstab_count, /* number of entries in mount table*/ |
---|
70 | int *fail_idx /* return: index of failed entry */ |
---|
71 | ); |
---|
72 | /*-------------------------------------------------------------------------*\ |
---|
73 | | Return Value: | |
---|
74 | | 0, if success, -1 and errno if failed | |
---|
75 | \*=========================================================================*/ |
---|
76 | |
---|
77 | #ifdef __cplusplus |
---|
78 | } |
---|
79 | #endif |
---|
80 | |
---|
81 | #endif /* _FSMOUNT_H */ |
---|