1 #ifndef _LINUX_FS_INCLUDE_
2 #define _LINUX_FS_INCLUDE_
4 #include <linux/types.h>
5 #include <linux/atomic.h>
13 typedef struct block_device
* kdev_t
;
16 #define MINORMASK ((1U << MINORBITS) - 1)
18 #define MAJOR(dev) ((unsigned int)((int)(dev) >> MINORBITS))
19 #define MINOR(dev) ((unsigned int)((int)(dev) & MINORMASK))
21 static inline unsigned int kdev_t_to_nr(kdev_t dev
) {
22 /*return (unsigned int)(MAJOR(dev)<<8) | MINOR(dev);*/
27 #define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
29 static inline kdev_t
to_kdev_t(int dev
)
39 minor
= (dev
& 0xffff);
44 return (kdev_t
) MKDEV(major
, minor
);
51 // file system specific structures
55 * Kernel pointers have redundant information, so we can use a
56 * scheme where we can return either an error code or a dentry
57 * pointer with the same return value.
59 * This should be a per-architecture thing, to allow different
60 * error and pointer decisions.
64 unsigned long s_magic
;
65 unsigned long s_flags
;
66 unsigned long s_blocksize
; /* blocksize */
67 unsigned long long s_maxbytes
;
68 unsigned char s_blocksize_bits
; /* bits of blocksize */
69 unsigned char s_dirt
; /* any thing */
70 char s_id
[30]; /* id string */
71 kdev_t s_bdev
; /* block_device */
72 void * s_priv
; /* EXT2_VCB */
73 struct dentry
*s_root
;
78 __u32 i_ino
; /* inode number */
79 loff_t i_size
; /* size */
80 __u32 i_atime
; /* Access time */
81 __u32 i_ctime
; /* Creation time */
82 __u32 i_mtime
; /* Modification time */
83 __u32 i_dtime
; /* Deletion Time */
86 umode_t i_mode
; /* mode */
89 atomic_t i_count
; /* ref count */
95 struct super_block
*i_sb
; /* super_block */
96 void *i_priv
; /* EXT2_MCB */
103 #define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */
104 #define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */
105 #define I_DIRTY_PAGES 4 /* Data-related inode changes pending */
110 #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
119 struct inode
*d_inode
;
120 struct dentry
*d_parent
;
122 struct super_block
*d_sb
;
127 unsigned int f_flags
;
132 struct dentry
*f_dentry
;
139 * NOTE! These match bits 12..15 of stat.st_mode
140 * (ie "(i_mode >> 12) & 15").
152 void iget(struct inode
*inode
);
153 void iput(struct inode
*inode
);
154 ULONGLONG
bmap(struct inode
*i
, ULONGLONG b
);
156 #endif /*_LINUX_FS_INCLUDE_*/