[Gluster-devel] [Gluster-users] Performant partial directory listing through FUSE

Anand Avati anand.avati at gmail.com
Sat Apr 27 21:03:02 UTC 2013


(moving to gluster-devel)

To write a safe and generically portable program, it would be good to not
depend on telldir/seekdir cookie stability. However gluster takes special
pain to provide cookies with safe transformation to keep telldir/seekdir
cookies stable across closedir/opendir and even across server and client
reboots. Most disk filesystems provide stable seekdir/telldir (maybe not
all). I don't think NFS client gives stable cookies to applications (though
it expects stable cookies from the server). However in the case of FUSE
glusterfs + backend XFS or ext4, you do get stable cookies.

Avati


On Sat, Apr 27, 2013 at 1:47 PM, Brian Candler <B.Candler at pobox.com> wrote:

> On Fri, Apr 26, 2013 at 03:10:03PM -0700, Anand Avati wrote:
> >    You can do it just like any other filesystem (not specific to either
> >    FUSE or gluster) - getdents()/readdir() a small bunch, either retain
> >    the open file descriptor or remember the output of telldir()
>
>     "Values returned by telldir() are good only for
>      the lifetime of the DIR pointer (e.g., dirp) from which they are
> derived.
>      If the directory is closed and then reopened, prior values returned by
>      telldir() will no longer be valid."
>
> (OSX/BSD manpage)
>
> So you have to keep the open file descriptor anyway.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20130427/4b212899/attachment-0001.html>


More information about the Gluster-devel mailing list