ReactOS
0.4.16-dev-197-g92996da
fs.h
Go to the documentation of this file.
1
#ifndef _LINUX_FS_INCLUDE_
2
#define _LINUX_FS_INCLUDE_
3
4
#include <linux/types.h>
5
#include <
linux/atomic.h
>
6
#include <
linux/rbtree.h
>
7
8
//
9
// kdev
10
//
11
12
#define NODEV 0
13
14
typedef
struct
block_device
*
kdev_t
;
15
16
#define MINORBITS 8
17
#define MINORMASK ((1U << MINORBITS) - 1)
18
19
#define MAJOR(dev) ((unsigned int)((int)(dev) >> MINORBITS))
20
#define MINOR(dev) ((unsigned int)((int)(dev) & MINORMASK))
21
22
static
inline
unsigned
int
kdev_t_to_nr
(
kdev_t
dev
) {
23
/*return (unsigned int)(MAJOR(dev)<<8) | MINOR(dev);*/
24
return
0;
25
}
26
27
#define NODEV 0
28
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
29
30
static
inline
kdev_t
to_kdev_t
(
int
dev
)
31
{
32
#if 0
33
int
major
,
minor
;
34
#if 0
35
major
= (
dev
>> 16);
36
if
(!
major
) {
37
major
= (
dev
>> 8);
38
minor
= (
dev
& 0xff);
39
}
else
40
minor
= (
dev
& 0xffff);
41
#else
42
major
= (
dev
>> 8);
43
minor
= (
dev
& 0xff);
44
#endif
45
return
(
kdev_t
)
MKDEV
(
major
,
minor
);
46
#endif
47
return
0;
48
}
49
50
51
//
52
// file system specific structures
53
//
54
55
/*
56
* Kernel pointers have redundant information, so we can use a
57
* scheme where we can return either an error code or a dentry
58
* pointer with the same return value.
59
*
60
* This should be a per-architecture thing, to allow different
61
* error and pointer decisions.
62
*/
63
64
struct
super_block
{
65
unsigned
long
s_magic
;
66
unsigned
long
s_flags
;
67
unsigned
long
s_blocksize
;
/* blocksize */
68
unsigned
long
long
s_maxbytes
;
69
unsigned
char
s_blocksize_bits
;
/* bits of blocksize */
70
unsigned
char
s_dirt
;
/* any thing */
71
char
s_id
[30];
/* id string */
72
kdev_t
s_bdev
;
/* block_device */
73
void
*
s_priv
;
/* EXT2_VCB */
74
struct
dentry
*
s_root
;
75
void
*
s_fs_info
;
76
};
77
78
struct
inode
{
79
__u32
i_ino
;
/* inode number */
80
loff_t
i_size
;
/* size */
81
__u32
i_atime
;
/* Access time */
82
__u32
i_ctime
;
/* Creation time */
83
__u32
i_mtime
;
/* Modification time */
84
__u32
i_dtime
;
/* Deletion Time */
85
__u64
i_blocks
;
86
__u32
i_block
[15];
87
umode_t
i_mode
;
/* mode */
88
uid_t
i_uid
;
89
gid_t
i_gid
;
90
atomic_t
i_count
;
/* ref count */
91
__u16
i_nlink
;
92
__u32
i_generation
;
93
__u32
i_version
;
94
__u32
i_flags
;
95
96
struct
super_block
*
i_sb
;
/* super_block */
97
void
*
i_priv
;
/* EXT2_MCB */
98
99
__u16
i_extra_isize
;
/* extra fields' size */
100
__u64
i_file_acl
;
101
};
102
103
//
104
// Inode state bits
105
//
106
107
#define I_DIRTY_SYNC 1
/* Not dirty enough for O_DATASYNC */
108
#define I_DIRTY_DATASYNC 2
/* Data-related inode changes pending */
109
#define I_DIRTY_PAGES 4
/* Data-related inode changes pending */
110
#define I_LOCK 8
111
#define I_FREEING 16
112
#define I_CLEAR 32
113
114
#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
115
116
117
struct
dentry
{
118
atomic_t
d_count
;
119
struct
{
120
int
len
;
121
char
*
name
;
122
}
d_name
;
123
struct
inode
*
d_inode
;
124
struct
dentry
*
d_parent
;
125
void
*
d_fsdata
;
126
struct
super_block
*
d_sb
;
127
};
128
129
struct
file
{
130
131
unsigned
int
f_flags
;
132
umode_t
f_mode
;
133
__u32
f_version
;
134
__int64
f_size
;
135
loff_t
f_pos
;
136
struct
dentry
*
f_dentry
;
137
void
*
private_data
;
138
};
139
140
/*
141
* File types
142
*
143
* NOTE! These match bits 12..15 of stat.st_mode
144
* (ie "(i_mode >> 12) & 15").
145
*/
146
#define DT_UNKNOWN 0
147
#define DT_FIFO 1
148
#define DT_CHR 2
149
#define DT_DIR 4
150
#define DT_BLK 6
151
#define DT_REG 8
152
#define DT_LNK 10
153
#define DT_SOCK 12
154
#define DT_WHT 14
155
156
void
iget
(
struct
inode
*
inode
);
157
void
iput
(
struct
inode
*
inode
);
158
ULONGLONG
bmap
(
struct
inode
*
i
,
ULONGLONG
b
);
159
160
#endif
/*_LINUX_FS_INCLUDE_*/
atomic.h
uid_t
long uid_t
Definition:
various.h:8
__int64
#define __int64
Definition:
basetyps.h:16
__u16
u16 __u16
Definition:
btrfs.h:18
__u32
u32 __u32
Definition:
btrfs.h:19
__u64
u64 __u64
Definition:
btrfs.h:20
gid_t
UINT gid_t
Definition:
types.h:89
iget
void iget(struct inode *inode)
Definition:
linux.c:987
iput
void iput(struct inode *inode)
Definition:
linux.c:992
kdev_t_to_nr
static unsigned int kdev_t_to_nr(kdev_t dev)
Definition:
fs.h:22
MKDEV
#define MKDEV(ma, mi)
Definition:
fs.h:28
kdev_t
struct block_device * kdev_t
Definition:
fs.h:14
to_kdev_t
static kdev_t to_kdev_t(int dev)
Definition:
fs.h:30
bmap
ULONGLONG bmap(struct inode *i, ULONGLONG b)
Definition:
linux.c:942
rbtree.h
umode_t
unsigned short umode_t
Definition:
types.h:75
loff_t
unsigned __int64 loff_t
Definition:
types.h:84
b
GLboolean GLboolean GLboolean b
Definition:
glext.h:6204
i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition:
glfuncs.h:248
minor
#define minor(rdev)
Definition:
propsheet.cpp:929
major
#define major(rdev)
Definition:
propsheet.cpp:928
atomic_t
Definition:
atomic.h:10
block_device
Definition:
module.h:546
dentry
Definition:
fs.h:117
dentry::d_name
struct dentry::@718 d_name
dentry::len
int len
Definition:
fs.h:120
dentry::d_inode
struct inode * d_inode
Definition:
fs.h:123
dentry::d_count
atomic_t d_count
Definition:
fs.h:118
dentry::d_sb
struct super_block * d_sb
Definition:
fs.h:126
dentry::name
char * name
Definition:
fs.h:121
dentry::d_parent
struct dentry * d_parent
Definition:
fs.h:124
dentry::d_fsdata
void * d_fsdata
Definition:
fs.h:125
dev
Definition:
volpropsheet.cpp:158
file
Definition:
fci.c:127
file::f_version
__u32 f_version
Definition:
fs.h:133
file::f_pos
loff_t f_pos
Definition:
fs.h:135
file::private_data
void * private_data
Definition:
fs.h:137
file::f_mode
umode_t f_mode
Definition:
fs.h:132
file::f_size
__int64 f_size
Definition:
fs.h:134
file::f_flags
unsigned int f_flags
Definition:
fs.h:131
file::f_dentry
struct dentry * f_dentry
Definition:
fs.h:136
inode
Definition:
fs.h:78
inode::i_blocks
__u64 i_blocks
Definition:
fs.h:85
inode::i_gid
gid_t i_gid
Definition:
fs.h:89
inode::i_version
__u32 i_version
Definition:
fs.h:93
inode::i_block
__u32 i_block[15]
Definition:
fs.h:86
inode::i_dtime
__u32 i_dtime
Definition:
fs.h:84
inode::i_ino
__u32 i_ino
Definition:
fs.h:79
inode::i_mtime
__u32 i_mtime
Definition:
fs.h:83
inode::i_extra_isize
__u16 i_extra_isize
Definition:
fs.h:99
inode::i_size
loff_t i_size
Definition:
fs.h:80
inode::i_flags
__u32 i_flags
Definition:
fs.h:94
inode::i_mode
umode_t i_mode
Definition:
fs.h:87
inode::i_file_acl
__u64 i_file_acl
Definition:
fs.h:100
inode::i_sb
struct super_block * i_sb
Definition:
fs.h:96
inode::i_nlink
__u16 i_nlink
Definition:
fs.h:91
inode::i_uid
uid_t i_uid
Definition:
fs.h:88
inode::i_atime
__u32 i_atime
Definition:
fs.h:81
inode::i_priv
void * i_priv
Definition:
fs.h:97
inode::i_ctime
__u32 i_ctime
Definition:
fs.h:82
inode::i_count
atomic_t i_count
Definition:
fs.h:90
inode::i_generation
__u32 i_generation
Definition:
fs.h:92
super_block
Definition:
fs.h:64
super_block::s_root
struct dentry * s_root
Definition:
fs.h:74
super_block::s_maxbytes
unsigned long long s_maxbytes
Definition:
fs.h:68
super_block::s_bdev
kdev_t s_bdev
Definition:
fs.h:72
super_block::s_fs_info
void * s_fs_info
Definition:
fs.h:75
super_block::s_dirt
unsigned char s_dirt
Definition:
fs.h:70
super_block::s_blocksize_bits
unsigned char s_blocksize_bits
Definition:
fs.h:69
super_block::s_blocksize
unsigned long s_blocksize
Definition:
fs.h:67
super_block::s_id
char s_id[30]
Definition:
fs.h:71
super_block::s_magic
unsigned long s_magic
Definition:
fs.h:65
super_block::s_flags
unsigned long s_flags
Definition:
fs.h:66
super_block::s_priv
void * s_priv
Definition:
fs.h:73
ULONGLONG
uint64_t ULONGLONG
Definition:
typedefs.h:67
drivers
filesystems
ext2
inc
linux
fs.h
Generated on Wed Oct 30 2024 06:05:25 for ReactOS by
1.9.6