BackupPC-users

Re: [BackupPC-users] why hard links?

2009-06-02 11:03:14
Subject: Re: [BackupPC-users] why hard links?
From: Les Mikesell <lesmikesell AT gmail DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 02 Jun 2009 08:51:38 -0500
Peter Walter wrote:
> Les Mikesell wrote:
>> Josh Rubin wrote:
>>   
>>> I hope this question isn't too dumb, but why does backuppc need to use
>>> hard links?
>>> Of course, nobody wants to change a widely used program in a way that
>>> breaks everything,
>>> so this is really a question about some new, future program.
>>> Isn't the pool just a form of hash table that could be implemented lots
>>> of ways?
>>>     
>> Creating a link is an atomic operation in the fileystem.  With anything 
>> else you would have to add the overhead of some locking mechanism (with 
>> the potential for deadlocks) to be sure that the equivalent to the link 
>> and the count of them stayed in sync.   And, not too surprisingly it 
>> turns out that filesystem operations are actually a pretty good way to 
>> deal with storing files - it might not be impossible to do it better but 
>> it wouldn't be easy.
>>   
> 
> Locking mechanisms aren't always necessary. One of the advantages of 
> hashed database systems, such as linear hash technology, is that 
> collisions are easily managed, and semaphores are usually adequate as 
> simple locking mechanisms if they are needed.

Collisions aren't quite the point - you have to manage that anyway.  The 
hard part is knowing that the final target you link to is the one that 
you wanted, not a something created simultaneously by a different 
process doing the same computations, and knowing that the count of 
existing links always matches the actual copies.  The kernel manages 
this automatically when using links.  If you have to add an extra system 
call to lock/unlock around some other operation you'll triple the overhead.

-- 
   Les Mikesell
    lesmikesell AT gmail DOT com

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/