1 #ifndef _LINUX_FS_INCLUDE_
2 #define _LINUX_FS_INCLUDE_
4 #include <linux/types.h>
5 #include <linux/atomic.h>
6 #include <linux/rbtree.h>
14 typedef struct block_device
* kdev_t
;
17 #define MINORMASK ((1U << MINORBITS) - 1)
19 #define MAJOR(dev) ((unsigned int)((int)(dev) >> MINORBITS))
20 #define MINOR(dev) ((unsigned int)((int)(dev) & MINORMASK))
22 static inline unsigned int kdev_t_to_nr(kdev_t dev
) {
23 /*return (unsigned int)(MAJOR(dev)<<8) | MINOR(dev);*/
28 #define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
30 static inline kdev_t
to_kdev_t(int dev
)
40 minor
= (dev
& 0xffff);
45 return (kdev_t
) MKDEV(major
, minor
);
52 // file system specific structures
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.
60 * This should be a per-architecture thing, to allow different
61 * error and pointer decisions.
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
;
84 int xe_value_buf_size
;
85 struct rb_node xe_node
;
88 #define XATTR_FLAG_DIRTY 0x1
89 #define XATTR_FLAG_LOADED 0x2
94 struct rb_root xh_root
;
98 __u32 i_ino
; /* inode number */
99 loff_t i_size
; /* size */
100 __u32 i_atime
; /* Access time */
101 __u32 i_ctime
; /* Creation time */
102 __u32 i_mtime
; /* Modification time */
103 __u32 i_dtime
; /* Deletion Time */
106 umode_t i_mode
; /* mode */
109 atomic_t i_count
; /* ref count */
115 struct super_block
*i_sb
; /* super_block */
116 void *i_priv
; /* EXT2_MCB */
118 __u16 i_extra_isize
; /* extra fields' size */
126 #define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */
127 #define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */
128 #define I_DIRTY_PAGES 4 /* Data-related inode changes pending */
133 #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
142 struct inode
*d_inode
;
143 struct dentry
*d_parent
;
145 struct super_block
*d_sb
;
150 unsigned int f_flags
;
155 struct dentry
*f_dentry
;
162 * NOTE! These match bits 12..15 of stat.st_mode
163 * (ie "(i_mode >> 12) & 15").
175 void iget(struct inode
*inode
);
176 void iput(struct inode
*inode
);
177 ULONGLONG
bmap(struct inode
*i
, ULONGLONG b
);
179 #endif /*_LINUX_FS_INCLUDE_*/