<p dir="ltr"><br>
On Nov 14, 2012 4:55 AM, "Antoine Pitrou" <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br>
><br>
> Le Wed, 14 Nov 2012 22:53:44 +1300,<br>
> Robert Collins<br>
> <<a href="mailto:robertc@robertcollins.net">robertc@robertcollins.net</a>> a écrit :<br>
> ><br>
> > Data from bzr:<br>
> >  you can get a very significant speed up by doing two things:<br>
> >  - use readdir to get the inode numbers of the files in the directory<br>
> > and stat the files in-increasing-number-order. (this gives you<br>
> > monotonically increasing IO).<br>
><br>
> This assumes directory entries are sorted by inode number (in a btree,<br>
> I imagine). Is this assumption specific to some Linux / Ubuntu<br>
> filesystem?</p>
<p dir="ltr">It doesn't assume that, because inodes aren't stored in directories on Posix file systems. Instead, they have names & inode numbers . The inode (which is where the data stat returns lives) is stored elsewhere in the file system, typically in on-disk arrays indexed  by inode number (and that's grossly oversimplified).</p>

<p dir="ltr">I'm not sure how this would work on modern file systems (zfs, btrfs).</p>
<p dir="ltr">     <mike<br>
</p>