ReactOS 0.4.15-dev-7897-g78dc504
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
14typedef 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
22static 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
30static 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
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
78struct 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 */
87 umode_t i_mode; /* mode */
90 atomic_t i_count; /* ref count */
95
96 struct super_block *i_sb; /* super_block */
97 void *i_priv; /* EXT2_MCB */
98
99 __u16 i_extra_isize; /* extra fields' size */
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
117struct dentry {
119 struct {
120 int len;
121 char *name;
123 struct inode *d_inode;
125 void *d_fsdata;
127};
128
129struct file {
130
131 unsigned int f_flags;
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
156void iget(struct inode *inode);
157void iput(struct inode *inode);
158ULONGLONG bmap(struct inode *i, ULONGLONG b);
159
160#endif /*_LINUX_FS_INCLUDE_*/
long uid_t
Definition: various.h:8
#define __int64
Definition: basetyps.h:16
u16 __u16
Definition: btrfs.h:18
u32 __u32
Definition: btrfs.h:19
u64 __u64
Definition: btrfs.h:20
UINT gid_t
Definition: types.h:89
void iget(struct inode *inode)
Definition: linux.c:987
void iput(struct inode *inode)
Definition: linux.c:992
static unsigned int kdev_t_to_nr(kdev_t dev)
Definition: fs.h:22
#define MKDEV(ma, mi)
Definition: fs.h:28
struct block_device * kdev_t
Definition: fs.h:14
static kdev_t to_kdev_t(int dev)
Definition: fs.h:30
ULONGLONG bmap(struct inode *i, ULONGLONG b)
Definition: linux.c:942
unsigned short umode_t
Definition: types.h:75
unsigned __int64 loff_t
Definition: types.h:84
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
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
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
Definition: fs.h:117
struct dentry::@709 d_name
int len
Definition: fs.h:120
struct inode * d_inode
Definition: fs.h:123
atomic_t d_count
Definition: fs.h:118
struct super_block * d_sb
Definition: fs.h:126
char * name
Definition: fs.h:121
struct dentry * d_parent
Definition: fs.h:124
void * d_fsdata
Definition: fs.h:125
Definition: fci.c:127
__u32 f_version
Definition: fs.h:133
loff_t f_pos
Definition: fs.h:135
void * private_data
Definition: fs.h:137
umode_t f_mode
Definition: fs.h:132
__int64 f_size
Definition: fs.h:134
unsigned int f_flags
Definition: fs.h:131
struct dentry * f_dentry
Definition: fs.h:136
Definition: fs.h:78
__u64 i_blocks
Definition: fs.h:85
gid_t i_gid
Definition: fs.h:89
__u32 i_version
Definition: fs.h:93
__u32 i_block[15]
Definition: fs.h:86
__u32 i_dtime
Definition: fs.h:84
__u32 i_ino
Definition: fs.h:79
__u32 i_mtime
Definition: fs.h:83
__u16 i_extra_isize
Definition: fs.h:99
loff_t i_size
Definition: fs.h:80
__u32 i_flags
Definition: fs.h:94
umode_t i_mode
Definition: fs.h:87
__u64 i_file_acl
Definition: fs.h:100
struct super_block * i_sb
Definition: fs.h:96
__u16 i_nlink
Definition: fs.h:91
uid_t i_uid
Definition: fs.h:88
__u32 i_atime
Definition: fs.h:81
void * i_priv
Definition: fs.h:97
__u32 i_ctime
Definition: fs.h:82
atomic_t i_count
Definition: fs.h:90
__u32 i_generation
Definition: fs.h:92
Definition: fs.h:64
struct dentry * s_root
Definition: fs.h:74
unsigned long long s_maxbytes
Definition: fs.h:68
kdev_t s_bdev
Definition: fs.h:72
void * s_fs_info
Definition: fs.h:75
unsigned char s_dirt
Definition: fs.h:70
unsigned char s_blocksize_bits
Definition: fs.h:69
unsigned long s_blocksize
Definition: fs.h:67
char s_id[30]
Definition: fs.h:71
unsigned long s_magic
Definition: fs.h:65
unsigned long s_flags
Definition: fs.h:66
void * s_priv
Definition: fs.h:73
uint64_t ULONGLONG
Definition: typedefs.h:67