![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
flashcache
在hust快乐的学习
希望通过CSDN这个平台认识更多志同道合的朋友!
实现共同进步!
展开
-
dm_io_async_bvec()函数分析
int dm_io_async_bvec(unsigned int num_regions, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) struct dm_io_region *where, #else struct io_region *where, #endif int rw,原创 2013-03-04 11:10:55 · 4283 阅读 · 3 评论 -
ubuntu12.04上安装flashcahce
os:ubuntu12.04 LTS kernel:3.5.0.26-generic 1、下载flashcache https://github.com/facebook/flashcache/ 2、unzip flaschache-master.zip 3、cd ./flashcache-master 4、make(在当前运行的内核中编译flashcache模块) 5、make i原创 2013-03-28 15:04:02 · 2076 阅读 · 0 评论 -
分析命令行参数——getopt
分析命令行参数——getopt 头文件 #include 函数定义 int getopt(int argc,char * const argv[ ],const char * optstring); extern char *optarg; extern int optind, opterr, optopt; 函数说明: getopt()用来分析命令行参数。参数argc转载 2013-06-27 17:20:31 · 821 阅读 · 0 评论 -
system函数介绍
system函数介绍 表头文件 #i nclude 定义函数 int system(const char * string); 这个函数是用fork,exec,waitpid这三个系统函数实现的,返回值相对比较复杂。 函数说明 system()会调用fork()产生子进程,由子进程来调用/bin/sh-c string来执行参数string字符串所代表的命令,此命令执转载 2013-06-27 20:58:03 · 992 阅读 · 0 评论 -
ioctl函数
1、ioctl函数的作用 ioctl用于向设备发控制和配置命令 ,有些命令也需要读写一些数据,但这些数据是不能用read/write读写的,称为Out-of-band数据。也就是说,read/write读写的数据是in-band数据,是I/O操作的主体,而ioctl命令传送的是控制信息 ,其中的数据是辅助的数据。 ioctl是设备驱动程序中对设备的I/O通道进行转载 2013-06-27 21:24:47 · 1029 阅读 · 0 评论 -
linux下错误的捕获:errno和strerror的使用
经常在调用linux 系统api 的时候会出现一些错误,比方说使用open() write() creat()之类的函数有些时候会返回-1,也就是调用失败,这个时候往往需要知道失败的原因。这个时候使用errno这个全局变量就相当有用了。 在程序代码中包含 #include ,然后每次程序调用失败的时候,系统会自动用用错误代码填充errno这个全局变量,这样你只需要读errno这个全局变量转载 2013-06-30 15:33:58 · 947 阅读 · 0 评论 -
flashcache中应用device mapper机制
Device Mapper(DM)是Linux 2.6全面引入的块设备新构架,通过DM可以灵活地管理系统中所有的真实或虚拟的块设备。 DM以块设备的形式注册到Linux内核中,凡是挂载(或者说“映射”)于DM结构下的块设备,不管他们是如何组织,如何通讯,在Linux看来都是一个完整的DM块设备。因此DM让不同组织形式的块设备或者块设备集群在Linux内核面前有一个完整统一的DM表示。 一、原创 2013-08-30 21:20:29 · 4357 阅读 · 4 评论