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. JMETER通过java代码通过代码/ JMETER API实现示例进行负载测试

    本教程试图解释Jmeter的基本设计,功能和用法,Jmeter是用于在应用程序上执行负载测试的优秀工具.通过使用jmeter GUI,我们可以根据我们的要求为请求创建测试样本并执行具有多个用户负载的样 ...

  2. [hdu1686] Oulipo【KMP】

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1686 保存KMP模版,代码里P是模版串,next[]就是为它建立的.T是文本串,就是一般比较长的.nex ...

  3. GYM 101673G(dp)

    dp[i][j][0/1]:第i天处于第j状态要不要吃. const int maxn = 1e2 + 5; int n, a[maxn], b[maxn]; int dp[maxn][maxn][2 ...

  4. cucumber 文件目录结构和执行顺序

    引用链接:http://www.cnblogs.com/timsheng/archive/2012/12/10/2812164.html Cucumber是Ruby世界的BDD框架,开发人员主要与两类 ...

  5. 開玩樹莓派(一):安裝Raspbian系統

    目錄: 開玩樹莓派(一):安裝Raspbian系統 開玩樹莓派(二):配置IP,實現無顯示器局域網內Putty連接和RDP遠程 開玩樹莓派(三):Python編程 開玩樹莓派(四):GPIO控制和遠程 ...

  6. kafka-->storm-->mongodb

    目的: 通过Spout发射kafka的数据,到bolt统计每一个单词的个数,将这些记录更新到mongodb中. Spout的nextTuple方法会一直处于一个while循环这中,每一条数据发送给bo ...

  7. 批处理文件 bat

    删除D盘的所有文件:del /a /f /q d:\*.* 删除指定目录的指定扩展名的文件:del /a /f /q 目录:\*.jpg 删除当前目录下的指定扩展名的文件(指定扩展名为jpg):del ...

  8. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 长时间没连接mysql断开了, ...

  9. vue cli的安装与使用

    一.简介 vue作为前端开发的热门工具,受到前端开发人员的喜爱.为了简化项目的构建,采用vue cli来简化开发. vue cli是一个全局安装的npm包,提供了终端使用的命令.vue create可 ...

  10. js 返回上一页并刷新页面

    js 方法 代码如下 self.location=document.referrer;