public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: dizzy <dizzy@roedu.net>
Cc: xfs@oss.sgi.com
Subject: Re: readdir() ordering guarantees on XFS
Date: Tue, 10 Jun 2008 13:55:47 +1000	[thread overview]
Message-ID: <20080610035547.GZ10720@disturbed> (raw)
In-Reply-To: <200806061634.13990.dizzy@roedu.net>

On Fri, Jun 06, 2008 at 04:34:13PM +0300, dizzy wrote:
> Hello
> 
> POSIX leaves unspecified the order of getting the entries with readdir(). This 
> is normal since different filesystems may implement their own techniques to 
> organize entries in a directory (linear, hash, various search trees, etc).
> 
> But if I can makes sure that several Linux machines will have the same FS (ie 
> XFS), mount options and same kernels can assume that traversing the same file 
> hierarchy structure (that is a file structure with the exact same directories 
> and files as names, structure, attributes, except maybe "ctime" which we 
> can't really control in Linux) can I expect that traversing using readdir() 
> will give me the entries in the exact same order?

No. For speed I suggest sorting the inode stat() calls in ascending
inode number order before issuing them. Also, perhaps you should
look at:

http://oss.oracle.com/~mason/acp/

To see if you can use similar techniques to speed directory
traversal.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2008-06-10  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 13:34 readdir() ordering guarantees on XFS dizzy
2008-06-10  3:55 ` Dave Chinner [this message]
2008-06-10  8:20   ` dizzy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080610035547.GZ10720@disturbed \
    --to=david@fromorbit.com \
    --cc=dizzy@roedu.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox