Difference between reading a directory(readdir) and a lookup operation on the directory
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
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.
精彩评论