赛迪网 > IT技术 Linux > 最新更新
  IT资讯搜索
 
IT产品搜索
[程序开发][网管世界][网络安全][数据库技术]
[操作系统][嘉宾聊天·在线访谈][活动集锦]
[精彩专题][Symantec专区][订阅IT技术周刊]
[开发论坛][网管论坛][安全论坛][数据库论坛]
[操作系统论坛][Sybase专区][IBM dW技术专区]
[病毒求助][病毒与漏洞播报][文档·源码下载]

推荐:Linux操作系统的核心数据结构 (2)

发布时间:2006.12.04 04:52     来源:赛迪网技术社区    作者:tianshan











此结构被块设备和字符设备用来向核心登记(包含设备名称以及可对此设备进行的文件操作)。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 {
  int count;
  unsigned short umask;
  struct inode * root, * pwd;
  };
  gendisk
  

包含关于某个硬盘的信息。用于磁盘初始化与分区检查时。

 

 
  struct hd_struct {
  long start_sect;
  long nr_sects;
  };
  struct gendisk {
  int major; /* major number of driver */
  const char *major_name; /* name of major driver */
  int minor_shift; /* number of times minor is shifted to get real minor */
  int max_p; /* maximum partitions per device */
  int max_nr; /* maximum number of real devices */
  void (*init)(struct gendisk *);
  /* Initialization called before we do our thing */
  struct hd_struct *part; /* partition table */
  int *sizes; /* device size in blocks, copied to blk_size[] */
  int nr_real; /* number of real devices */
  void *real_devices; /* internal use */
  struct gendisk *next;
  };
  inode
  

此VFS inode结构描叙磁盘上一个文件或目录的信息。

  
  struct inode {
  kdev_t i_dev;
  unsigned long i_ino;
  umode_t i_mode;
  nlink_t i_nlink;
  uid_t i_uid;
  gid_t i_gid;
  kdev_t i_rdev;
  off_t i_size;
  time_t i_atime;
  time_t i_mtime;
  time_t i_ctime;
  unsigned long i_blksize;
  unsigned long i_blocks;
  unsigned long i_version;
  unsigned long i_nrpages;
  struct semaphore i_sem;
  struct inode_operations *i_op;
  struct super_block *i_sb;
  struct wait_queue *i_wait;
  struct file_lock *i_flock;
  struct vm_area_struct *i_mmap;
  struct page *i_pages;
  struct dquot *i_dquot[MAXQUOTAS];
  struct inode *i_next, *i_prev;
  struct inode *i_hash_next, *i_hash_prev;
  struct inode *i_bound_to, *i_bound_by;
  struct inode *i_mount;
  unsigned short i_count;
  unsigned short i_flags;
  unsigned char i_lock;
  unsigned char i_dirt;
  unsigned char i_pipe;
  unsigned char i_sock;
  unsigned char i_seek;
  unsigned char i_update;
  unsigned short i_writecount;
  union {
  struct pipe_inode_info pipe_i;
  struct minix_inode_info minix_i;
  struct ext_inode_info ext_i;
  struct ext2_inode_info ext2_i;
  struct hpfs_inode_info hpfs_i;
  struct msdos_inode_info msdos_i;
  struct umsdos_inode_info umsdos_i;
  struct iso_inode_info isofs_i;
  struct nfs_inode_info nfs_i;
  struct xiafs_inode_info xiafs_i;
  struct sysv_inode_info sysv_i;
  struct affs_inode_info affs_i;
  struct ufs_inode_info ufs_i;
  struct socket socket_i;
  void *generic_ip;
  } u;
  };
  ipc_perm
  

此结构描叙对一个系统V IPC对象的存取权限。

  
  struct ipc_perm
  {
  key_t key;
  ushort uid; /* owner euid and egid */
  ushort gid;
  ushort cuid; /* creator euid and egid */
  ushort cgid;
  ushort mode; /* access modes see mode flags below */
  ushort seq; /* sequence number */
  };
  irqaction
  

用来描叙系统的中断处理过程。

  
  struct irqaction {
  void (*handler)(int, void *, struct pt_regs *);
  unsigned long flags;
  unsigned long mask;
  const char *name;
  void *dev_id;
  struct irqaction *next;
  };
  linux_binfmt
  

用来表示可被Linux理解的二进制。

(T115)

<<上一页 1 2


[ 发表评论 ] 字体[  ] [ 打印 ] [ 进入博客 ] [ 进入论坛 ]  [ 推荐给朋友 ]
  相关文章
· 初步分析Linux操作系统的良好特性 (12-01) · Shell基础--Linux的用户和用户组管理 (12-01)
· Linux—Windows两系统互联实战经历 (12-01) · 加挂Linux操作系统中文件系统的小结 (12-01)
· Linux系统国际化、本地化和中文化 (12-01) · Linux管理员秘技:用快捷命令一招制胜 (12-01)
· 详细解读Linux操作系统的激活程序 (12-01) · 移植Linux时Linux Bootloader编写方法 (11-30)
· 用Linux构造嵌入式实时应用系统(一) (11-30) · Linux操作系统的结构和特性深入分析 (11-30)
  客户需求反馈表
* 姓  名:
更多资料  了解方案  认识厂商
* 单位名称:
* 联系电话:
* 电子邮件:
  赛迪推荐  
  手机·资费 ·新品·导购·评测·手机资费·宽带
手机搜索  诺基亚 N73 MOTO Z6
  IT产品 ·笔记本·台式机·服务器·打印·投影
IT产品搜索 
  IT技术 ·开发·网管·安全·数据库·操作系统
  信息化 ·热点·专题·访谈·周刊·方案案例
[政务][电信][金融][农业][制造业][中小企业]
[CIO][ERP][协同][IT管理][中间件][电子商务]
[政策][地方][专家][评估][辞典][博客][社区]
· 专题:一路畅通构想曲——让出行不再遭遇堵车
· CIO工作亲历:企业ERP选型不能忽视"选人关"
· 综述:信息化建设给中国监狱带来的各种变化
· 金融业风险管理和法规遵从有五点需考虑的因素
· 保险业CIO关注:该如何建立统一高效的CRM体系
· 调查显示:多数CIO对IT规划仍存在困惑和误解
  博客·论坛 ·曾剑秋·项立刚·Java学习·网管