易截截图软件、单文件、免安装、纯绿色、仅160KB

linux 0.11 文件系统(二)

超级块描述了整个文件系统的信息,而文件作为存储的对象,它的信息是有inode节点来描述的。i节点位图描述了inode的使用情况。
struct m_inode{
        unsigned short i_mode; //文件类型
        unsigned short i_uid;//文件宿主
        unsigned long i_size;//文件大小
        unsigned long i_mtime;//文件修改时间
        unsigned char i_guid; //文件组id
        unsigned char i_nlinks;        //文件目录项连接数
        unsigned char i_zone[9];//文件所在的设备逻辑块号
//以下的字段在内存中
        struct task_struct *i_wait; //等待该i节点的进程
        unsigned long i_atime,i_ctime;
        unsigned short i_dev; //文件所在的设备号
        unsigned short i_num; //i节点号
        unsigned short i_count;//i节点被使用的次数,0表示空闲
        unsigned char i_lock;
        unsigned char i_dirt;
        unsigned char i_pipe;
        unsigned char i_mount; //该节点是否是某个文件系统的安装节点
        unsigned char i_seek;
        unsigned char i_update;
}
其 中i_zone[9]很重要,它指出了文件使用的设备的逻辑块号。其中0-6为直接块,也就是文件的数据直接在相应的逻辑块上;7位1级块,1级块可以包 含512个逻辑块号;8位2级块,它可以存放512个1级块。所以文件长度在7k以内只使用前7个位指定逻辑块,再大就要使用间接块指定了。
对i节点位图以及i节


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

Linux学习步骤(转)

1、Linux 基础
安装Linux操作系统 Linux文件系统 Linux常用命令 Linux启动过程详解 熟悉Linux服务能够独立安装Linux操作系统 能够熟练使用Linux系统的基本命令 认识Linux系统的常用服务安装Linux操作系统 Linux基本命令实践 设置Linux环境变量 定制Linux的服务 Shell 编程基础使用vi编辑文件 使用Emacs编辑文件 使用其他编 ......

linux shell script 例子1

1. 如何获得脚本参数:
#!/bin/she
#
while [ -n "$1" ]
do
case "$1" in
-a) echo "found the -a option";;
-b) param="$2"
echo "found the -b option";;
-c) echo "found the -c option";;
--) shift
break;;
*) echo "$1 is not an option";;
esac
shift
done
count ......

Linux上获取指定进程的cpu使用情况

这里假定要获取当前登录用户启动的tomcat进程的cpu使用情况
#!/bin/sh
_USER=`whoami`
_PS=`ps -ef | grep $_USER | grep catalina | grep tomcat`
_PID=`echo $_PS | awk '{print $2}'`
_CPUINFO=`top -b -n 1 -p $_PID | sed '$d' | sed -n '$p' | awk '{print $9}'`
echo $_CPUINFO
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号