ReactOS  0.4.14-dev-556-g4c5b21f
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 */
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 
117 struct dentry {
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;
136  struct dentry *f_dentry;
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_t i_count
Definition: fs.h:90
unsigned long long s_maxbytes
Definition: fs.h:68
static unsigned int kdev_t_to_nr(kdev_t dev)
Definition: fs.h:22
__u16 i_extra_isize
Definition: fs.h:99
umode_t f_mode
Definition: fs.h:132
void * d_fsdata
Definition: fs.h:125
#define MKDEV(ma, mi)
Definition: fs.h:28
umode_t i_mode
Definition: fs.h:87
Definition: fs.h:64
unsigned long s_flags
Definition: fs.h:66
struct block_device * kdev_t
Definition: fs.h:14
__u32 i_generation
Definition: fs.h:92
int len
Definition: fs.h:120
__u16 i_nlink
Definition: fs.h:91
void * s_priv
Definition: fs.h:73
__int64 f_size
Definition: fs.h:134
__u32 i_atime
Definition: fs.h:81
unsigned char s_dirt
Definition: fs.h:70
struct super_block * d_sb
Definition: fs.h:126
__u64 i_file_acl
Definition: fs.h:100
void * private_data
Definition: fs.h:137
long uid_t
Definition: various.h:8
__u32 i_mtime
Definition: fs.h:83
Definition: fs.h:78
__u32 i_block[15]
Definition: fs.h:86
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
struct dentry::@691 d_name
UINT gid_t
Definition: types.h:89
atomic_t d_count
Definition: fs.h:118
gid_t i_gid
Definition: fs.h:89
Definition: fs.h:117
struct dentry * d_parent
Definition: fs.h:124
__u64 i_blocks
Definition: fs.h:85
__u32 i_flags
Definition: fs.h:94
char s_id[30]
Definition: fs.h:71
__u32 f_version
Definition: fs.h:133
__u32 i_version
Definition: fs.h:93
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
__u32 i_ctime
Definition: fs.h:82
unsigned int f_flags
Definition: fs.h:131
unsigned short __u16
Definition: compat.h:89
loff_t i_size
Definition: fs.h:80
void * s_fs_info
Definition: fs.h:75
uid_t i_uid
Definition: fs.h:88
uint64_t ULONGLONG
Definition: typedefs.h:65
char * name
Definition: fs.h:121
struct dentry * f_dentry
Definition: fs.h:136
unsigned int __u32
Definition: compat.h:90
unsigned __int64 loff_t
Definition: types.h:80
unsigned char s_blocksize_bits
Definition: fs.h:69
ULONGLONG bmap(struct inode *i, ULONGLONG b)
Definition: linux.c:934
__u32 i_ino
Definition: fs.h:79
kdev_t s_bdev
Definition: fs.h:72
#define major(rdev)
Definition: propsheet.cpp:916
void * i_priv
Definition: fs.h:97
u64 __u64
Definition: btrfs.h:20
void iget(struct inode *inode)
Definition: linux.c:979
unsigned long s_blocksize
Definition: fs.h:67
void iput(struct inode *inode)
Definition: linux.c:984
__u32 i_dtime
Definition: fs.h:84
loff_t f_pos
Definition: fs.h:135
#define minor(rdev)
Definition: propsheet.cpp:917
struct super_block * i_sb
Definition: fs.h:96
unsigned long s_magic
Definition: fs.h:65
struct dentry * s_root
Definition: fs.h:74
static kdev_t to_kdev_t(int dev)
Definition: fs.h:30
#define __int64
Definition: basetyps.h:16
struct inode * d_inode
Definition: fs.h:123
unsigned short umode_t
Definition: types.h:71
Definition: fci.c:126