LWN.net Logo

Widening ext4's readdir() cookie

Widening ext4's readdir() cookie

Posted Apr 4, 2013 1:56 UTC (Thu) by vasi (guest, #83946)
In reply to: Widening ext4's readdir() cookie by dark
Parent article: Widening ext4's readdir() cookie

HFS+ could do this. Each directory entry has a unique ID (the "catalog node ID"), which fits in a long. You can lookup the CNID to get the file name, and then use that name as your position in the directory.

This is still imperfect. Because each CNID is associated with a file name, hard links require an extra level of indirection. And obviously if the file at the current position is deleted, or renamed, things won't work as expected.

This is all moot, since Linux's HFS+ driver just uses the offset as f_pos, I'm not sure why. Maybe the f_pos values are required to be increasing? CNIDs are not.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds