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.OARcorp.com/rtems/license.html. | |
---|
18 | | | |
---|
19 | +-----------------------------------------------------------------+ |
---|
20 | | date history ID | |
---|
21 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
---|
22 | | 02.07.03 creation doe | |
---|
23 | \*===============================================================*/ |
---|
24 | #ifndef _FSMOUNT_H |
---|
25 | #define _FSMOUNT_H |
---|
26 | #include <rtems.h> |
---|
27 | #include <rtems/libio.h> |
---|
28 | #include <rtems/libcsupport.h> |
---|
29 | |
---|
30 | /* |
---|
31 | * bits to define, what errors will cause reporting (via printf) and |
---|
32 | * abort of mount processing |
---|
33 | * Use a combination of these bits |
---|
34 | * for the fields "report_reasons" and "abort_reasons" |
---|
35 | */ |
---|
36 | #define FSMOUNT_MNT_OK 0x0001 /* mounted ok */ |
---|
37 | #define FSMOUNT_MNTPNT_CRTERR 0x0002 /* cannot create mount point */ |
---|
38 | #define FSMOUNT_MNT_FAILED 0x0004 /* mounting failed */ |
---|
39 | |
---|
40 | typedef struct { |
---|
41 | char *dev; |
---|
42 | char *mount_point; |
---|
43 | rtems_filesystem_operations_table *fs_ops; |
---|
44 | rtems_filesystem_options_t mount_options; |
---|
45 | unsigned16 report_reasons; |
---|
46 | unsigned16 abort_reasons; |
---|
47 | } fstab_t; |
---|
48 | |
---|
49 | |
---|
50 | /*=========================================================================*\ |
---|
51 | | Function: | |
---|
52 | \*-------------------------------------------------------------------------*/ |
---|
53 | int rtems_fsmount |
---|
54 | ( |
---|
55 | /*-------------------------------------------------------------------------*\ |
---|
56 | | Purpose: | |
---|
57 | | This function will create the mount points listed and mount the file | |
---|
58 | | systems listed in the calling parameters | |
---|
59 | +---------------------------------------------------------------------------+ |
---|
60 | | Input Parameters: | |
---|
61 | \*-------------------------------------------------------------------------*/ |
---|
62 | const fstab_t *fstab_ptr, /* Ptr to filesystem mount table */ |
---|
63 | int fstab_count, /* number of entries in mount table*/ |
---|
64 | int *fail_idx /* return: index of failed entry */ |
---|
65 | ); |
---|
66 | /*-------------------------------------------------------------------------*\ |
---|
67 | | Return Value: | |
---|
68 | | 0, if success, -1 and errno if failed | |
---|
69 | \*=========================================================================*/ |
---|
70 | |
---|
71 | #endif /* _FSMOUNT_H */ |
---|