读取目录(readdir)和目录查找操作的区别
将非常感激了解操作、读取目录如何使用 readdir() 与解析文件/目录路径时执行的目录查找不同。它们的实现逻辑有何不同?也会非常感谢任何对文学的参考。
我也不知道如何确切地了解如何保证文件系统操作的原子性(如果有的话)。
我这里指的文件系统是 extfs 系列。
谢谢
Would be very gratefull to know about how the operations, reading directory say using readdir() different from a directory lookup performed while resolving a path to a file/directory. How different are they in the logic of their implementation? Will higly appreciate any references to literature too.
I am also not knowing exactly how to find out how atomicity of filesystem operations are guarateed if they are at all.
the file system i refer here is the extfs family.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最权威的资源是内核源代码。对于ext4fs,查找是在 ext4_lookup 中实现的,和 readdir 在 ext4_readdir。
从用户空间的角度来看,最大的区别是查找/遍历需要执行权限位,而readdir需要读取权限位。
The most definitive resource would be the kernel source code. For ext4fs, lookup is implemented in ext4_lookup, and readdir in ext4_readdir.
From a user-space perspective, the biggest difference is that lookup/traversal requires the execute permission bit, while readdir requires the read permission bit.