简体   繁体   English

在ext4文件系统中寻找目标

[英]Finding goal in ext4 file system

The file extents.c (fs/ext4/extents.c) in linux kernel 4.7.2 deals with file allocation methods. linux内核4.7.2中的文件extents.c(fs / ext4 / extents.c)处理文件分配方法。

ar.goal is calculated by a function ext4_ext_find_goal ar.goal由函数ext4_ext_find_goal计算

ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk);

Can anyone please explain how this function works ? 谁能解释一下该功能的工作原理?

ext4_ext_find_goal() is called when we need to allocate new block. 当我们需要分配新块时,将调用ext4_ext_find_goal()

In here , this function is called as you said. 这里 ,正如您所说的那样调用此函数。

ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk);

In this context, path is not NULL. 在这种情况下, path不为NULL。 So, ext4_ext_find_goal() will find block number of that path , and return this block number. 因此, ext4_ext_find_goal()将找到该path块号,并返回该块号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM