|
Linux 核心--16.Linux数据结构(5) void *addr); int (*do_ioctl)(struct device *dev, struct ifreq *ifr, int cmd); int (*set_config)(struct device *dev, struct ifmap *map); void (*header_cache_bind)(struct hh_cache **hhp, struct device *dev, unsigned short htype, __u32 daddr); void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char * haddr); int (*change_mtu)(struct device *dev, int new_mtu); struct iw_statistics* (*get_wireless_stats)(struct device *dev); };
device_struct 此结构被块设备和字符设备用来向核心登记(包含设备名称以及可对此设备进行的文件操作)。chrdevs和blkdevs 中的每个有效分别表示一个字符设备和块设备。
struct device_struct { const char * name; struct file_operations * fops; };
file 每个打开的文件、套接口都用此结构表示。
struct file { mode_t f_mode; loff_t f_pos; unsigned short f_flags; unsigned short f_count; unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin; struct file *f_next, *f_prev; int f_owner; /* pid or -pgrp where SIGIO should be sent */ struct inode * f_inode; struct file_operations * f_op; unsigned long f_version; void *private_data; /* needed for tty driver, and maybe others */ };
files_struct 描叙被某进程打开的所有文件。
struct files_struct { int count; fd_set close_on_exec; fd_set open_fds; struct file * fd[NR_OPEN]; };
fs_struct
struct fs_struct {
|