li
  当前位置:主页 > 操作系统Redhat Linux > 文章内容
li
Linux核心数据结构
来源: www.ixdba.net  作者: IXDBA.NET技术社区    时间:2008-02-23   阅读:4  
本文章共4975字,分4页,当前第1页,快速翻页:
 
本章列出了Linux实用的主要数据结构。
  
  block_dev_struct
  
    此结构用于向核心登记块设备,它还被buffer cache实用。所有此类结构都位于blk_dev数组中。
  
  struct blk_dev_struct {
  void (*request_fn)(void);
  struct request * current_request;
  struct request plug;
  struct tq_struct plug_tq;
  };
  buffer_head
  
    此结构包含关于buffer cache中一块缓存的信息。
  
  /* bh state bits */
  #define BH_Uptodate 0 /* 1 if the buffer contains valid data */
  #define BH_Dirty 1 /* 1 if the buffer is dirty */
  #define BH_Lock 2 /* 1 if the buffer is locked */
  #define BH_Req 3 /* 0 if the buffer has been invalidated */
  #define BH_Touched 4 /* 1 if the buffer has been touched (aging) */
  #define BH_Has_aged 5 /* 1 if the buffer has been aged (aging) */
  #define BH_Protected 6 /* 1 if the buffer is protected */
  #define BH_FreeOnIO 7 /* 1 to discard the buffer_head after IO */
  struct buffer_head {
  /* First cache line: */
  unsigned long b_blocknr; /* block number */
  kdev_t b_dev; /* device (B_FREE = free) */
  kdev_t b_rdev; /* Real device */
  unsigned long b_rsector; /* Real buffer location on disk */
  struct buffer_head *b_next; /* Hash queue list */
  struct buffer_head *b_this_page; /* circular list of buffers in one
  page */
  /* Second cache line: */
  unsigned long b_state; /* buffer state bitmap (above) */
  struct buffer_head *b_next_free;
  unsigned int b_count; /* users using this block */
  unsigned long b_size; /* block size */
  /* Non-performance-critical data follows. */
  char *b_data; /* pointer to data block */
  unsigned int b_list; /* List that this buffer appears */
  unsigned long b_flushtime; /* Time when this (dirty) buffer
  * should be written */
  unsigned long b_lru_time; /* Time when this buffer was
  * last used. */
  struct wait_queue *b_wait;
  struct buffer_head *b_prev; /* doubly linked hash list */
  struct buffer_head *b_prev_free; /* doubly linked list of buffers */
  struct buffer_head *b_reqnext; /* request queue */
  };
  device
  
    系统中每个网络设备都用一个设备数据结构来表示。
  
  struct device
  {
  /*
  * This is the first field of the visible part of this structure
  * (i.e. as seen by users in the Space.c file). It is the name
  * the interface.
  */
  char *name;
  /* I/O specific fields */
  unsigned long rmem_end; /* shmem recv end */
  unsigned long rmem_start; /* shmem recv start */
  unsigned long mem_end; /* shared mem end */
  unsigned long mem_start; /* shared mem start */
  unsigned long base_addr; /* device I/O address */
  unsigned char irq; /* device IRQ number */
  /* Low-level status flags. */
  volatile unsigned char start, /* start an operation */
  interrupt; /* interrupt arrived */
  unsigned long tbusy; /* transmitter busy */
  struct device *next;
  /* The device initialization function. Called only once. */
  int (*init)(struct device *dev);
  /* Some hardware also needs these fields, but they are not part of
  the usual set specified in Space.c. */
  unsigned char if_port; /* Selectable AUI,TP, */


阅读更多内容1 · 2 · 3 · 4 · 下一页>>


  上一篇: 使用Linux的8个经典技巧   下一篇: RedHat Linux下防火墙配置入门必...
li
 §相关评论  
 热点文章

·使用pam_abl防止SSH遭暴力破解
·redhat linux 5上telnet的开启
·linux命令行下如何更换使用的s
·xhost unable to open display
·文件系统出现不一直的原因和基
·linux系统下磁带机的简单操作命
·tar与磁带机操作命令
·linux系统建立终端和登录系统
·如何配置/etc/fstab或autofs让
·如何安装和升级一个RPM软件包?
·如何在新添加的磁盘上创建EXT3
li
 编辑推荐
·使用pam_abl防止SSH遭暴力破解
·redhat linux 5上telnet的开启
·linux命令行下如何更换使用的s
·xhost unable to open display
·文件系统出现不一直的原因和基
·linux系统下磁带机的简单操作命
·tar与磁带机操作命令
·linux系统建立终端和登录系统
·如何配置/etc/fstab或autofs让
·如何安装和升级一个RPM软件包?
·如何在新添加的磁盘上创建EXT3
li
 相关篇章
·使用Linux的8个经典技巧
·Linux下XFConfig的有效使用
·Linux 文件访问原语
·加固Linux服务器
·Linux集群的安装与并行计算
·简述 Linux 文件系统的目录结构
·Linux上glibc的man手册关于timev...
·Linux下多线程编程与信号处理易疏...
·为 Linux 手动下载和安装 Java R...
·Linux多线程编程和Linux 2.6下的...
·RedHat Linux下防火墙配置入门必...
·Solaris到Linux应用的移植
·怎样才能提高Linux系统安全性能
·如何在Slackware/Linux里面使用L...
·网络OS显神威 认识Linux远程桌面...
·Linux内核2.6简介
·新手搭建网站服务器(Ubuntu LAMP...
·Linux 2.6.x内核是如何改进而来的
·Linux系统在存储技术中的几项应用
·使用U盘安装Linux(Debian/Ubuntu...
 
li
设为首页 | 关于我们 | 技术服务 | 收藏本站 | 网站地图 | 联系方式 | 本站友情连接