没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Linux 虚拟文件系统(内核初始化<一>)
Linux 虚拟文件系统在内核初始化的 start_kernel()函数中主要调用两个函数来实现。
asmlinkage void __init start_kernel(void)
{
……
vfs_caches_init_early();
……
vfs_caches_init(totalram_pages);
……
}
一、早期初始化
虚拟文件系统的早期初始化有函数 vfs_caches_init_early()实现,主要负责 dentry 和 inode 的
hashtable 的初始化工作。
/*在 start_kernel 中调用,用于文件系统中早期的初始化*/
void __init vfs_caches_init_early(void)
{
/*初始化两个 hashtable*/
dcache_init_early();
inode_init_early();
}
1.1 dcache
static void __init dcache_init_early(void)
{
int loop;
/* If hashes are distributed across NUMA nodes, defer
* hash allocation until vmalloc space is available.
*/
if (hashdist)
return;
/*dentry hashtable 的空间分配*/
dentry_hashtable =
alloc_large_system_hash("Dentry cache",
sizeof(struct hlist_head),
dhash_entries,
13,
HASH_EARLY,
&d_hash_shift,
&d_hash_mask,
0);
/*hashtable 的各个链表初始化*/
for (loop = 0; loop < (1 << d_hash_shift); loop++)
INIT_HLIST_HEAD(&dentry_hashtable[loop]);
资源评论
- zhang_i2014-06-12初学者有一定的参考价值
bullbat
- 粉丝: 419
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功