From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anton Altaparmakov Subject: Re: Expected getdents behaviour Date: Thu, 15 Sep 2005 21:28:23 +0100 (BST) Message-ID: References: <1126793268.1676.9.camel@imp.csi.cam.ac.uk> <1126793558.1676.15.camel@imp.csi.cam.ac.uk> <1126797460.1676.23.camel@imp.csi.cam.ac.uk> <20050915164110.GA25573@hasse.suse.de> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: miklos@szeredi.hu, aaranya@cs.sunysb.edu, linux-fsdevel@vger.kernel.org Return-path: Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]:61848 "EHLO ppsw-9.csi.cam.ac.uk") by vger.kernel.org with ESMTP id S1751147AbVIOU2f (ORCPT ); Thu, 15 Sep 2005 16:28:35 -0400 To: Jan Blunck In-Reply-To: <20050915164110.GA25573@hasse.suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 15 Sep 2005, Jan Blunck wrote: > On Thu, Sep 15, Anton Altaparmakov wrote: > > That is completely untrue. It is up to the user. The file position in > > a directory is completely up to the caller and in particular when a > > directory is modified the file position in that directory is not changed > > by the filesystem. Doing this would in fact be impossible since the > > creation/deletion in the kernel has no access to all the "struct file"s > > with which a directory has been opened. > > No, thats not true. The file position in a regular (flat) file is completely > up to the user. "Thanks" to the short-comings of POSIX on not defining the > functions on directories, the file position in a directory is completely up to > the file system. Due to that fact, modern file systems don't need to provide > a "flat" view (in terms of sequential access to a directory file) on We are talking past each other and actually agreeing with each other. Our definitions of "up to the user" and "up to the fs" are at opposites. > them. Although, the file system must guarantee, that readdir's must not fail > because of changes directory contents. AFAIR ext2 is achieving this through > not shrinking directories while the filesystem is online. ntfs uses B trees on disk for directories. The tree must be balanced at all times and each insert/delete will be a balancing tree operation. This can completely change the tree shape and hence the on disk data. Best regards, Anton -- Anton Altaparmakov (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/