[haiku-development] Re: BFS's Lack Of Support For link() - hard links

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 18 Nov 2009 07:56:46 +0100

On 2009-11-18 at 04:05:59 [+0100], Michael Franz <mvfranz@xxxxxxxxx> wrote:
> 
> I was cleaning up my hard drive and found a pdf of 'Practical File System
> Design:The Be File System, Dominic Giampaolo'. [1] On page 174 it discusses
> why BFS does not support hard links or why it does not implement link().
> 
> "The link() function is not implemented by BFS or any of the other file
> systems that currently exist on the BeOS. The primary reason for not im-
> plementing hard links is that at the time BFS was being written, the C++
> user-level file API was not prepared to deal with them. There was no time to
> modify the C++ API to offer support for them, and so we felt that it would
> be better not to implement them in the file system (to avoid confusion for
> programmers). The case is not closed, however, and should the need arise, we
> can extend the C++ API to better support hard links and modify BFS to
> implement them."
> 
> Is this the same reason Haiku's implementation of BFS does not support hard
> links?

Haiku's BFS implementation is on-disk compatible with Be's and to my 
knowledge it's a limitation of the on-disk structure design that prevents 
hard links from being possible.

Not sure what exactly Dominic had in mind with "there was no time to
modify the C++ API to offer support for them". IMO the only thing needed is 
the functionality to create them (e.g. a BDirectory::CreateLink()), which 
would be trivial to implement. The POSIX link() function is implemented (in 
BeOS and Haiku) and works as expected on file systems that support hardlinks.

CU, Ingo

Other related posts: