5
13
2014
8

pcmfs初始化过程

此文是基于基于minxfs修改的文件系统得到的,不过文件系统大体的流程是大同小异的,故初始化过程其实与ext2,ext3是通用的

inode.c中有模块的入口。即module_init(init_pcmfs_fs).初始化这儿主要分析的pcmfs_fill_super函数。该函数即mount时从磁盘读取数据,填充内存超级块字段信息。该函数主要做了如下三件事情

1.sbi = kzalloc(sizeof(struct pcmfs_sb_info), GFP_KERNEL);申请内存超级快的空间,然后把磁盘超级块的内容拷贝到其中。在此处需要把VFS的 s->s_fs_info = sbi;赋值,即全局有很多文件系统数据结构,如ext2,ext3等。此处即指定当前为该sb代表的文件系统

2.申请bitmap表的空间。然后根据bitmap使用情况算出s_used_inode以及s_used_block

i = (sbi->s_imap_blocks + sbi->s_zmap_blocks) * sizeof(bh);

map = kzalloc(i, GFP_KERNEL);//step2:申请空间2 bitmap位
 
3.获取根目录的信息。即根目录所指向的数据块的dentry信息。root结点的数据信息为第一个数据块中的信息
root_inode = pcmfs_iget(s, PCMFS_ROOT_INO);
Category: 文件系统 | Tags: | Read Count: 652
Avatar_small
Digital Ali 说:
2021年9月04日 22:28

Good website! I truly love how it is easy on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which may do the trick? Have a great day! soap 2 day

Avatar_small
Digital Ali 说:
2021年9月11日 16:26

This article was written by a real thinking writer. I agree many of the with the solid points made by the writer. I’ll be back. https://docs.google.com/spreadsheets/d/1ntiogcbDulo3Vl9Htd7Jl9Xy-2kUp7-F33vbQ4q67Uc/edit#gid=409280497

Avatar_small
Digital Ali 说:
2021年9月12日 19:53 I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. https://circularbladesaw.com/
Avatar_small
Digital Ali 说:
2021年9月21日 23:54

Attractive, post. I just stumbled upon your weblog and wanted to say that I have liked browsing your blog posts. After all, I will surely subscribe to your feed, and I hope you will write again soon! buy youtube subscribers

Avatar_small
Gullam Mohiyoddin 说:
2021年9月29日 00:33

This is focal, paying unessential frontal cortex to it will as a last resort squash with the objective that you can take a gander at the going with site: บาคาร่า 1688

Avatar_small
William 说:
2021年9月30日 22:08

Sees for paper an especially huge association, I reeled close by your blog other than discharge up a bound report. I need your outline of scratching... บาคาร่า ได้เงินจริง

Avatar_small
Dave 说:
2021年10月07日 20:19

I read that Post and got it fine and informative. pg

Avatar_small
link 说:
2021年10月11日 19:50

I really like your writing style, great information, thankyou for posting. North American Bancard ISO Program


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com