vfs_caches_init函数解析
vfs_caches_init函数初始化VFS,下面梳理函数调用流程
start_kernel()
-->vfs_caches_init_early();
-->dcache_init_early();
-->static struct hlist_head *dentry_hashtabl = alloc_large_system_hash("Dentry cache",
sizeof(struct hlist_head),
dhash_entries,
,
HASH_EARLY,
&d_hash_shift,
&d_hash_mask,
);
-->inode_init_early();
-->static struct hlist_head *inode_hashtable = alloc_large_system_hash("Inode-cache",
sizeof(struct hlist_head),
ihash_entries,
,
HASH_EARLY,
&i_hash_shift,
&i_hash_mask,
);
-->vfs_caches_init(num_physpages);
/*1.kmem_cache用于名字*/
-->struct kmem_cache *names_cachep = kmem_cache_create("names_cache", PATH_MAX, ,
SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
-->dcache_init();
/*2.kmem_cache用于缓存dentry目录项*/
-->struct kmem_cache *dentry_cache = KMEM_CACHE(dentry,
SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
-->inode_init();
/*3.kmem_cache用于缓存inode*/
-->struct kmem_cache *inode_cachep = kmem_cache_create("inode_cache",
sizeof(struct inode),
,
(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
SLAB_MEM_SPREAD),
init_once);
-->files_init(mempages);
/*4.kmem_cache用于缓存file结构体*/
-->struct kmem_cache *filp_cachep = kmem_cache_create("filp", sizeof(struct file), ,
SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
-->mnt_init();
/*5.kmem_cache用于缓存vfsmount结构体*/
-->struct kmem_cache *mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount),
, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
-->static struct list_head *mount_hashtable =(struct list_head *)__get_free_page(GFP_ATOMIC);
/*注册&挂载sysfs虚拟文件系统*/
-->sysfs_init()
/*6.kmem_cache用于缓存sysfs_dirent结构体*/
-->struct kmem_cache *sysfs_dir_cachep = kmem_cache_create("sysfs_dir_cache",
/*对应的应该就是"/fs/"跟目录*/ sizeof(struct sysfs_dirent),, , NULL);
-->fs_kobj = kobject_create_and_add("fs", NULL);
/*注册rootfs虚拟文件系统*/
-->init_rootfs();
/*挂载rootfs虚拟文件系统*/
-->init_mount_tree();
-->bdev_cache_init();
/*7.kmem_cache用于缓存bdev_inode结构体*/
-->struct kmem_cache *bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_PANIC),init_once);
/*注册的这是啥文件系统啊?*/
-->register_filesystem(&bd_type);
/*挂载*/
-->struct vfsmount *bd_mnt = kern_mount(&bd_type);
-->struct super_block *blockdev_superblock = bd_mnt->mnt_sb; /* For writeback */
/*字符设备相关的初始化*/
-->chrdev_init();
vfs_caches_init函数解析的更多相关文章
- [转]javascript eval函数解析json数据时为什加上圆括号eval("("+data+")")
javascript eval函数解析json数据时为什么 加上圆括号?为什么要 eval这里要添加 “("("+data+")");//”呢? 原因在于: ...
- PHP json_decode 函数解析 json 结果为 NULL 的解决方法
在做网站 CMS 模块时,对于模块内容 content 字段,保存的是 json 格式的字符串,所以在后台进行模块内容的编辑操作 ( 取出保存的数据 ) 时,需要用到 json_decode() 函数 ...
- Matlab中bsxfun和unique函数解析
一.问题来源 来自于一份LSH代码,记录下来. 二.函数解析 2.1 bsxfun bsxfun是一个matlab自版本R2007a来就提供的一个函数,作用是”applies an element-b ...
- socket使用TCP协议时,send、recv函数解析以及TCP连接关闭的问题
Tcp协议本身是可靠的,并不等于应用程序用tcp发送数据就一定是可靠的.不管是否阻塞,send发送的大小,并不代表对端recv到多少的数据. 在阻塞模式下, send函数的过程是将应用程序请求发送的数 ...
- sigaction函数解析
http://blog.chinaunix.net/uid-1877180-id-3011232.html sigaction函数解析 sigaction函数的功能是检查或修改与指定信号相关联的处理 ...
- driver_register()函数解析
driver_register()函数解析 /** * driver_register - register driver with bus * @drv: driver to register * ...
- async函数解析
转载请注明出处:async函数解析 async函数是基于Generator函数实现的,也就是说是Generator函数的语法糖.在之前的文章有介绍过Generator函数语法和异步应用,如果对其不了解 ...
- tf.train.shuffle_batch函数解析
tf.train.shuffle_batch (tensor_list, batch_size, capacity, min_after_dequeue, num_threads=1, seed=No ...
- oracle中next_day()、last_day()函数解析
oracle中next_day()函数解析 Sql代码 当前系统时间的下一星期一的时间select next_day(sysdate,1) from dual NEXT_DAY(date,char ...
随机推荐
- 1-24List三个子类的特点
List的三个子类的特点 因为三个类都实现了List接口,所以里面的方法都差不多,那这三个类都有什么特点呢? ArrayList: 底层数据结构是数组,查询快,增删慢. 线程不安全,效率高. Vect ...
- C语言的面向对象技术
引言:面向过程的C有效率高,代码紧凑的特点,在单片机嵌入式领域是C的主要阵地,while(1)+中断是其主要的开发模式,但是当系统复杂到一定程度,想要添加一个功能需要改动很多地方,耦合性太强:跟别人交 ...
- hdu4419Colourful Rectangle
链接 分别求出7种颜色覆盖的面积. 做法:每种颜色设定一个标号,以二进制表示R:100 G:010 B:001 .这样很明显可以知道RG:110 GB:011 以此类推. 求解时,需要开一个二维标记数 ...
- C#打开office文件,pdf文件和视频文件
打开office文件 1 需要从网站下载dsoframer.ocx文件 2 把dsoframer.ocx文件复制到c:\windows\system32目录下 开始->运行->regsvr ...
- watir-webdriver使用过程中异常
1.在jruby版本1.6.7中,报异常:not such file to load --watir-webdriver 解决方法 :在文件的首行添加:require 'rubygems' ...
- 初始Mybatis,好累,自己感觉自己快坚持不了了
Mybatis1.持久化 持久化,就是内存数据和硬盘数据状态的转换 2.ORM思想Object Relation Mapping 对象关系映射 3.MyBatis入门案例 3.1导入jar包 依赖 & ...
- 定时任务-ScheduledExecutorService
创建定时任务线程池的方式 ScheduledExecutorService executorService = Executors.newScheduledThreadPool(4);// 不推荐// ...
- CF747D Winter Is Coming
题目链接: http://codeforces.com/problemset/problem/747/D 题目大意: 接下来的n天内每天都有一个气温,如果某天的温度为负数,则必须使用冬季轮胎:而温度 ...
- LINUX一网卡多IP设置
方法1:少量IP手动绑定(这里以绑定IP到eth0为例,其它网卡的话修改相应的文件名即可) 1.复制ifcfg-eth0的网卡配置文件并改名为ifcfg-eth0:0 [root@akinlau /] ...
- Java MVC 增删改查 实例
需求:实现增加新部门的功能,对应数据库表示Oracle的dept表 一.Java MVC 增 实现: 1.视图层(V):注册部门 deptAdd.jsp 在注册新部门页面只需输入“部门名称”和“城市” ...