struct inode 和 struct file
来源:互联网 发布:百度负面网络公关 编辑:程序博客网 时间:2024/05/23 22:48
1、structinode──字符设备驱动相关的重要结构介绍
内核中用inode结构表示具体的文件,而用file结构表示打开的文件描述符。Linux2.6.27内核中,inode结构体具体定义如下:
struct inode
struct hlist_node
struct list_head
struct list_head
struct list_head
unsigned long
atomic_t
unsigned int
uid_t
gid_t
u64
loff_t
#ifdef __NEED_I_SIZE_ORDERED
seqcount_t
#endif
struct timespec
struct timespec
struct timespec
unsigned int
blkcnt_t
unsignedshort
umode_t
spinlock_t
struct mutex
struct rw_semaphore
const struct inode_operations
const struct file_operations
struct super_block
struct file_lock
struct address_space
struct address_space
#ifdef CONFIG_QUOTA
struct dquot
#endif
struct list_head
union {
struct pipe_inode_info
struct block_device
};
int
__u32
#ifdef CONFIG_DNOTIFY
unsigned long
struct dnotify_struct
#endif
#ifdef CONFIG_INOTIFY
struct list_head
struct mutex
#endif
unsigned long
unsigned long
unsigned int
atomic_t
#ifdef CONFIG_SECURITY
void