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函数解析的更多相关文章

  1. [转]javascript eval函数解析json数据时为什加上圆括号eval("("+data+")")

    javascript eval函数解析json数据时为什么 加上圆括号?为什么要 eval这里要添加 “("("+data+")");//”呢?   原因在于: ...

  2. PHP json_decode 函数解析 json 结果为 NULL 的解决方法

    在做网站 CMS 模块时,对于模块内容 content 字段,保存的是 json 格式的字符串,所以在后台进行模块内容的编辑操作 ( 取出保存的数据 ) 时,需要用到 json_decode() 函数 ...

  3. Matlab中bsxfun和unique函数解析

    一.问题来源 来自于一份LSH代码,记录下来. 二.函数解析 2.1 bsxfun bsxfun是一个matlab自版本R2007a来就提供的一个函数,作用是”applies an element-b ...

  4. socket使用TCP协议时,send、recv函数解析以及TCP连接关闭的问题

    Tcp协议本身是可靠的,并不等于应用程序用tcp发送数据就一定是可靠的.不管是否阻塞,send发送的大小,并不代表对端recv到多少的数据. 在阻塞模式下, send函数的过程是将应用程序请求发送的数 ...

  5. sigaction函数解析

    http://blog.chinaunix.net/uid-1877180-id-3011232.html sigaction函数解析  sigaction函数的功能是检查或修改与指定信号相关联的处理 ...

  6. driver_register()函数解析

    driver_register()函数解析 /** * driver_register - register driver with bus * @drv: driver to register *  ...

  7. async函数解析

    转载请注明出处:async函数解析 async函数是基于Generator函数实现的,也就是说是Generator函数的语法糖.在之前的文章有介绍过Generator函数语法和异步应用,如果对其不了解 ...

  8. tf.train.shuffle_batch函数解析

    tf.train.shuffle_batch (tensor_list, batch_size, capacity, min_after_dequeue, num_threads=1, seed=No ...

  9. oracle中next_day()、last_day()函数解析

    oracle中next_day()函数解析 Sql代码 当前系统时间的下一星期一的时间select   next_day(sysdate,1) from dual NEXT_DAY(date,char ...

随机推荐

  1. DRF教程1-序列化

    序列化类 要建立web API,要做的第一件事就是对实例进行序列化,比如以json方式显示.我们可以生命序列化,它和django的forms很相似.在app目录下创建serializers.py fr ...

  2. centos 无界面 服务器 安装chrome部署chromedriver

    转:https://blog.csdn.net/u013849486/article/details/79466359 基本 做完了,要弄进docker里面去了的时候,才搜到 docker-chrom ...

  3. fake-useragent

    在编写爬虫进行网页数据的时候,大多数情况下,需要在请求是增加请求头 python下非常好用的伪装请求头的库:fake-useragent,具体使用说明如下: 安装fake-useragent库 pip ...

  4. springMVC-接收数据-参数绑定

    接收数据-参数绑定 #Method Arguments概观 Same in Spring WebFlux The table below shows supported controller meth ...

  5. TDH-kafka

    一.kafka原理:1.broker:一个kafka实例,多个broker组成kafka集群: 2.topic:逻辑概念,同一类数据的集合,可以看做一张表: 3.producer:将数据写入topic ...

  6. linux下php以fastcgi模式运行

    关于PHP以fastcgi方式运行的文章,网络上较多,也许由于转载的原因,有些地方不甚明了,笔者亲自测试,整理成文,供大家参考. 1.linux系统 [root@localhost /]# cat / ...

  7. 小程序 显示Toobar

    要实现的效果 在 下面app.json  中加下列代码   "tabBar": { "color": "#7A7E83", "se ...

  8. webApi Authentication failed because the remote party has closed the transport stream\身份验证失败了,因为远程方关闭了传输流。

    public class CertificateTrust { public static void SetCertificatePolicy() { //当在浏览器中可以正常访问,而code中出现错 ...

  9. 剑指tomcat之多项目部署问题

    部署项目时遇到的问题,tomcat的webapps文件夹中有两个war包,但每次启动Tomcat服务时,只会默认启动一个war包. 解决方案一:在Tomcat主页中进入应用管理页面,手动开启项目.(进 ...

  10. 从零开始利用vue-cli搭建简单音乐网站(七)

    这几天完成了歌曲收藏功能,先看最后效果: 新注册用户:“newuser”,进入“我的音乐界面如下所示” 点击新建歌单,输入:“新歌单”,确认,如下: 目前还没有歌曲,打开音乐界面,点击收藏功能,如下, ...