摘要: /** linux/fs/file_dev.c** (C) 1991 Linus Torvalds*/#include <errno.h>#include <fcntl.h>#include <linux/sched.h>#include <linux/kernel.h>#include <asm/segment.h>#define MIN(a,b) (((a)<(b))?(a):(b))#define MAX(a,b) (((a)& 阅读全文
posted @ 2010-02-08 11:16 qiang.xu 阅读(615) 评论(0) 推荐(0) 编辑
摘要: /** 该文件中的两个函数read_pipe和write_pipe是上层函数* read和write的底层实现*//** linux/fs/pipe.c** (C) 1991 Linus Torvalds*/#include <signal.h>#include <linux/sched.h>// 内存管理头文件。含有页面大小定义和一些页面释放函数原型#include <linux/mm.h> /* for get_free_page */#include <asm/segment.h&g 阅读全文
posted @ 2010-02-08 11:13 qiang.xu 阅读(1470) 评论(0) 推荐(0) 编辑
摘要: /** buffer.c 程序用于对高速缓冲区(池)进行操作和管理。高速缓冲* 区位于内核代码和主内存区之间。** |---|---|------------------|---------------------|-------------------|* | | | * * * | buffer | |* |---|---|------------------|---------------------|-------------------|* | /|\* |------------------------------------|* \|/* buffer_head 阅读全文
posted @ 2010-02-08 11:10 qiang.xu 阅读(1519) 评论(0) 推荐(0) 编辑
摘要: /** linux/fs/char_dev.c** (C) 1991 Linus Torvalds*/#include <errno.h>#include <sys/types.h> // 定义了基本的系统数据类型#include <linux/sched.h>#include <linux/kernel.h> // 含有一些内核常用函数的原形定义#include <asm/segment.h>#include <asm/io.h&g 阅读全文
posted @ 2010-02-08 11:08 qiang.xu 阅读(685) 评论(0) 推荐(0) 编辑
摘要: /** 该文件实现系统调用read,write和lseek。*//** linux/fs/read_write.c** (C) 1991 Linus Torvalds*/#include <sys/stat.h>#include <errno.h>#include <sys/types.h>#include <linux/kernel.h>#include <linux/sched.h>#include <asm/segment.h& 阅读全文
posted @ 2010-02-08 11:07 qiang.xu 阅读(1453) 评论(0) 推荐(0) 编辑
摘要: /** 该文件主要实现的是truncate函数,该函数是释放指定i* 节点在设备上占用的所有逻辑块,包括直接块、一次间* 接块和二次间接块*//** linux/fs/truncate.c** (C) 1991 Linus Torvalds*/#include <linux/sched.h>#include <sys/stat.h>/* 释放一次间接块,参数int dev, int block指明一次间接块的设备号 */static void free_ind(int dev,int block){ struct buffer_head 阅读全文
posted @ 2010-02-08 11:05 qiang.xu 阅读(1051) 评论(0) 推荐(0) 编辑