linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: Btree directories (Re: Status of HFS+ support)
@ 2000-08-30 12:06 Steve Lord
  2000-08-30 15:07 ` Andi Kleen
  0 siblings, 1 reply; 28+ messages in thread
From: Steve Lord @ 2000-08-30 12:06 UTC (permalink / raw)
  To: Andi Kleen
  Cc: flar, Matthew Wilcox, Halfmann Klaus, Roman Zippel, linuxppc-dev,
	linux-fsdevel


> In theory you could put as much state as you want into a private field
> of the file structure of the directory. This just ignores two ugly things:
> NFS and telldir. Both basically require you to generate stateless 32bit
> cookies that safely walk your directory.

Can't we at least pass the cookie generation and intepretation down to
the filesystem layer, since at least NFS V3 allows bigger handles.

> The only good solution I know is a stable namespace that never shrinks unless
> the last entry is removed (basically what ext2 directories do). Then you can
> just have an offset into that namespace. Namespace could be hash + collision
> counter.
>
> [XFS uses some trick of assuming that buffer sizes are big enough for one
> of their hash buckets, but it'll surely break in a lot of cases]

Not strictly true - the version 1 format of directories in XFS will have
problems with this - they return a 64 bit hash value, it can survive
with half of it - unless a single hash bucket gets too big. This problem
also shows up if you NFS mount an XFS filesystem from Irix onto Linux as
most existing Irix filesystems use V1 directories.

For this reason version 2 directories were introduced, the directory offset
returned here is actually a real offset - into an address space which is
the leaf blocks of the directory btree. In this case we only get into
problems with directories bigger than 2 Tbytes.... I cannot remember how
holes in the leaf blocks are handled, but it does do some tricks there too.

Steve

> Without stable name space probably your only option is to add dummy entries
> into the btree holes instead of rebalancing the tree, and removing all holes
> when the last entry goes away.
>
> -Andi

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: Btree directories (Re: Status of HFS+ support)
@ 2000-09-01 17:05 Halfmann, Klaus
  2000-09-01 17:40 ` flar
  0 siblings, 1 reply; 28+ messages in thread
From: Halfmann, Klaus @ 2000-09-01 17:05 UTC (permalink / raw)
  To: 'flar@allandria.com ', 'viro@math.psu.edu '
  Cc: 'dgatwood@deepspace.mklinux.org ', 'ak@suse.de ',
	'lord@sgi.com ', 'matthew@wil.cx ',
	Halfmann, Klaus, 'roman@augan.com ',
	'linuxppc-dev@lists.linuxppc.org ',
	'linux-fsdevel@vger.kernel.org '


...
> OK. Are they [the CNISs] preserved by rename()?

> There isn't anything preventing it. A rename() is messy enough
> because of the headache of moving around entries in the btree
> and updating all the implicit usage of the catalog key which
> depends on the filename. I don't think the
> MacOS actually preserves the CNID on a rename, tho. It's something that
> I think would be about the same complexity either way. The only thing you
> save by keeping the same CNID is changes to the extents overflow tree,
> which is usually empty anyway. (My code doesn't do rename() yet...)

Brad, Im sure you are wrong on this one, try the following in MacOS:
create an alias to a folder and then renam it, the alias will stiil work
So Im sure the CNIDs will not change ..

Klaus

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Status of HFS+ support (was hfs support for blocksize != 512)
@ 2000-08-29 16:40 Halfmann, Klaus
  2000-08-29 17:18 ` Btree directories (Re: Status of HFS+ support) Matthew Wilcox
  0 siblings, 1 reply; 28+ messages in thread
From: Halfmann, Klaus @ 2000-08-29 16:40 UTC (permalink / raw)
  To: 'Matthew Wilcox', Roman Zippel; +Cc: linuxppc-dev


Im currently working on HFS+ support. Im assisted by Brad Boyer
(flar@pants.edu) . I currently target a remake of the hfsutils
originally created by rob@mars.org.

The current status is, that the library for readonly acces looks
fine. I currently work on providing commands like hpmount and
hpls. Since this is a userland project I dont care about race
conditions right now. (Im aware that a kernel module must care ...)
I think I got a good undertstanding of the BTrees by now (it took some
time ...). Updating the btree in a multithreaded environemnt is
a real challenge. One must adopt database like mechanisms like
optimistic locking to update a btree concurrently. (Well databases
_use_ Btrees internally :-).

On the other hand: The hfs acces is normally not needed for heavy
concurrent acces. (Mhh, there might be AFP Servers publishing HFS
partions) For now it should be enough to have a global update
lock on the root of the node. Im not firm with kernel code yet, dont
ask me about the details :-)

I plan to progress on the userland side until most of the the Details
work (almost :) correctly. This way it is at least possible to copy
a kernel to the HFS+ "Side" of the mac to yaboot from it etc.
_After_ that Ill go ahead and write a kernel module. Of course any help
on the modules is welcome. We have a CVS repostiory at Suse and perhaps
(Olaf do you her me ?) there is an rsync acces, too.

I'd really like to know how the concurrency of the kernel filesystem
should work, can anybody feed me with documentations about that ?

Greeting,
	Klaus Halfmann (aka Hasi)

P.S. for HFS+ I dont assume any fixed block size :)

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2000-09-02  4:04 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-30 12:06 Btree directories (Re: Status of HFS+ support) Steve Lord
2000-08-30 15:07 ` Andi Kleen
2000-08-30 16:07   ` flar
2000-08-30 20:49     ` David A. Gatwood
2000-08-30 20:45       ` Steve Lord
2000-08-30 21:05       ` Alexander Viro
2000-08-30 21:51         ` David A. Gatwood
2000-08-30 21:49           ` Alexander Viro
2000-08-30 22:13             ` David A. Gatwood
2000-08-30 22:17               ` Alexander Viro
2000-08-30 23:11                 ` David A. Gatwood
2000-08-31  0:10                   ` Alexander Viro
2000-08-31  5:49       ` flar
2000-08-31 10:33         ` Alexander Viro
2000-08-31 17:48           ` flar
2000-08-31 19:54             ` Alexander Viro
2000-08-31 22:09               ` flar
2000-09-01  2:40                 ` Alexander Viro
2000-09-01  3:52                   ` flar
2000-09-02  4:04                     ` Tony Mantler
  -- strict thread matches above, loose matches on Subject: below --
2000-09-01 17:05 Halfmann, Klaus
2000-09-01 17:40 ` flar
2000-08-29 16:40 Status of HFS+ support (was hfs support for blocksize != 512) Halfmann, Klaus
2000-08-29 17:18 ` Btree directories (Re: Status of HFS+ support) Matthew Wilcox
2000-08-29 18:45   ` Steve Lord
2000-08-29 21:25     ` Matthew Wilcox
2000-08-30  2:22   ` flar
2000-08-30  8:35     ` Andi Kleen
2000-08-30 14:25   ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).