[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1176250921.309.94.camel@heimdal.trondhjem.org>
Date: Tue, 10 Apr 2007 20:22:01 -0400
From: Trond Myklebust <trond.myklebust@....uio.no>
To: Neil Brown <neilb@...e.de>
Cc: Bob Copeland <me@...copeland.com>, Theodore Tso <tytso@....edu>,
Jörn Engel <joern@...ybastard.org>,
"H. Peter Anvin" <hpa@...or.com>,
Christoph Hellwig <hch@...radead.org>,
Ulrich Drepper <drepper@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: If not readdir() then what?
On Wed, 2007-04-11 at 08:33 +1000, Neil Brown wrote:
> A READDIR (aka getdents2) should take a directory handle, a cookie,
> and a filename, and should return filenames and cookies. The
> cookies may all be identical or may not. The filename might be used
> by the filesystem, or it might not.
>
> Filesystems that require a cursor in the 'struct file' to support
> (local) getdents cannot be used with NFS.
>
> While it doesn't make it possible to support all conceivable
> filesystems, it should make it easier for some filesystems to support
> the demands of NFS.
In order to be useful, I think you need to add a demand that the READDIR
call cannot loop back on itself for the case of a series of sequential
reads.
IOW: if a client attempts to step sequentially through the directory,
and is supplying valid filenames+cookies from the preceding READDIR
call, then the next READDIR call should be guaranteed never to loop back
to an earlier entry. Alternatively, if there is a danger that it might
due to some sudden and radical change in the directory layout, then it
should notify the client by returning something like a BAD_COOKIE error.
Otherwise, the client would have to cache _all_ previous READDIR results
since the last opendir()/rewinddir() in order to be able to do its own
loop detection and that will obviously never scale for large directories
or for directories that change frequently...
Cheers
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists