UbixOS
2.0
mount.h
Go to the documentation of this file.
1
/*-
2
* Copyright (c) 2002-2018 The UbixOS Project.
3
* All rights reserved.
4
*
5
* This was developed by Christopher W. Olsen for the UbixOS Project.
6
*
7
* Redistribution and use in source and binary forms, with or without modification, are permitted
8
* provided that the following conditions are met:
9
*
10
* 1) Redistributions of source code must retain the above copyright notice, this list of
11
* conditions, the following disclaimer and the list of authors.
12
* 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13
* conditions, the following disclaimer and the list of authors in the documentation and/or
14
* other materials provided with the distribution.
15
* 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16
* endorse or promote products derived from this software without specific prior written
17
* permission.
18
*
19
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
#ifndef _MOUNT_H
30
#define _MOUNT_H
31
32
#include <
sys/types.h
>
33
34
#define MFSNAMELEN 16
/* length of type name including null */
35
#define MNAMELEN 88
/* size of on/from name bufs */
36
37
typedef
struct
fsid
{
38
int32_t
val
[2];
39
}
fsid_t
;
/* filesystem id type */
40
41
struct
statfs
{
42
uint32_t
f_version
;
/* structure version number */
43
uint32_t
f_type
;
/* type of filesystem */
44
u_int64_t
f_flags
;
/* copy of mount exported flags */
45
u_int64_t
f_bsize
;
/* filesystem fragment size */
46
u_int64_t
f_iosize
;
/* optimal transfer block size */
47
u_int64_t
f_blocks
;
/* total data blocks in filesystem */
48
u_int64_t
f_bfree
;
/* free blocks in filesystem */
49
int64_t
f_bavail
;
/* free blocks avail to non-superuser */
50
u_int64_t
f_files
;
/* total file nodes in filesystem */
51
int64_t
f_ffree
;
/* free nodes avail to non-superuser */
52
u_int64_t
f_syncwrites
;
/* count of sync writes since mount */
53
u_int64_t
f_asyncwrites
;
/* count of async writes since mount */
54
u_int64_t
f_syncreads
;
/* count of sync reads since mount */
55
u_int64_t
f_asyncreads
;
/* count of async reads since mount */
56
u_int64_t
f_spare
[10];
/* unused spare */
57
uint32_t
f_namemax
;
/* maximum filename length */
58
uid_t
f_owner
;
/* user that mounted the filesystem */
59
fsid_t
f_fsid
;
/* filesystem id */
60
char
f_charspare
[80];
/* spare string space */
61
char
f_fstypename
[
MFSNAMELEN
];
/* filesystem type name */
62
char
f_mntfromname
[
MNAMELEN
];
/* mounted filesystem */
63
char
f_mntonname
[
MNAMELEN
];
/* directory on which mounted */
64
};
65
66
struct
vfs_mountPoint
{
67
struct
vfs_mountPoint
*
prev
;
68
struct
vfs_mountPoint
*
next
;
69
struct
fileSystem
*
fs
;
70
struct
device_node
*
device
;
71
struct
ubixDiskLabel
*
diskLabel
;
72
void
*
fsInfo
;
73
int
partition
;
74
char
mountPoint
[1024];
75
char
perms
;
76
};
77
78
int
vfs_mount
(
int
major,
int
minor,
int
partition,
int
fsType,
char
*mountPoint,
char
*perms);
79
int
vfs_addMount
(
struct
vfs_mountPoint
*mp);
80
struct
vfs_mountPoint
*
vfs_findMount
(
char
*
mountPoint
);
81
82
#endif
83
84
/***
85
END
86
***/
statfs::f_asyncreads
u_int64_t f_asyncreads
Definition:
mount.h:55
statfs::f_spare
u_int64_t f_spare[10]
Definition:
mount.h:56
fsid::val
int32_t val[2]
Definition:
mount.h:38
statfs::f_blocks
u_int64_t f_blocks
Definition:
mount.h:47
vfs_mountPoint::prev
struct vfs_mountPoint * prev
Definition:
mount.h:67
statfs::f_namemax
uint32_t f_namemax
Definition:
mount.h:57
statfs::f_fstypename
char f_fstypename[16]
Definition:
mount.h:61
vfs_mount
int vfs_mount(int major, int minor, int partition, int fsType, char *mountPoint, char *perms)
Definition:
mount.c:45
statfs::f_mntfromname
char f_mntfromname[88]
Definition:
mount.h:62
fsid_t
struct fsid fsid_t
vfs_addMount
int vfs_addMount(struct vfs_mountPoint *mp)
Definition:
mount.c:102
statfs::f_bavail
int64_t f_bavail
Definition:
mount.h:49
u_int64_t
__uint64_t u_int64_t
Definition:
types.h:54
fsid
Definition:
mount.h:37
statfs::f_bsize
u_int64_t f_bsize
Definition:
mount.h:45
statfs::f_syncreads
u_int64_t f_syncreads
Definition:
mount.h:54
fileSystem
filesSystem Structure
Definition:
vfs.h:59
vfs_mountPoint::diskLabel
struct ubixDiskLabel * diskLabel
Definition:
mount.h:71
vfs_mountPoint::next
struct vfs_mountPoint * next
Definition:
mount.h:68
types.h
statfs::f_bfree
u_int64_t f_bfree
Definition:
mount.h:48
statfs::f_flags
u_int64_t f_flags
Definition:
mount.h:44
statfs::f_fsid
fsid_t f_fsid
Definition:
mount.h:59
vfs_mountPoint
Definition:
mount.h:66
statfs::f_files
u_int64_t f_files
Definition:
mount.h:50
statfs::f_owner
uid_t f_owner
Definition:
mount.h:58
device_node
Definition:
device.h:34
statfs::f_iosize
u_int64_t f_iosize
Definition:
mount.h:46
vfs_mountPoint::mountPoint
char mountPoint[1024]
Definition:
mount.h:74
vfs_mountPoint::fs
struct fileSystem * fs
Definition:
mount.h:69
uint32_t
__uint32_t uint32_t
Definition:
types.h:46
vfs_mountPoint::partition
int partition
Definition:
mount.h:73
int32_t
__int32_t int32_t
Definition:
types.h:108
vfs_mountPoint::perms
char perms
Definition:
mount.h:75
statfs::f_syncwrites
u_int64_t f_syncwrites
Definition:
mount.h:52
int64_t
__int64_t int64_t
Definition:
types.h:113
ubixDiskLabel
Definition:
ubixfs.h:67
vfs_findMount
struct vfs_mountPoint * vfs_findMount(char *mountPoint)
Definition:
mount.c:128
statfs::f_asyncwrites
u_int64_t f_asyncwrites
Definition:
mount.h:53
statfs::f_version
uint32_t f_version
Definition:
mount.h:42
vfs_mountPoint::fsInfo
void * fsInfo
Definition:
mount.h:72
statfs
Definition:
mount.h:41
MFSNAMELEN
#define MFSNAMELEN
Definition:
mount.h:34
statfs::f_mntonname
char f_mntonname[88]
Definition:
mount.h:63
vfs_mountPoint::device
struct device_node * device
Definition:
mount.h:70
uid_t
__uid_t uid_t
Definition:
types.h:122
statfs::f_type
uint32_t f_type
Definition:
mount.h:43
MNAMELEN
#define MNAMELEN
Definition:
mount.h:35
statfs::f_charspare
char f_charspare[80]
Definition:
mount.h:60
statfs::f_ffree
int64_t f_ffree
Definition:
mount.h:51
include
vfs
mount.h
Generated by
1.8.16