From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Masover Subject: Re: COW files Date: Sat, 29 Oct 2005 14:30:40 +0000 Message-ID: <43638790.9000500@slaphack.com> References: <43636C13.5040307@slaphack.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: list-help: list-unsubscribe: list-post: Errors-To: flx@namesys.com In-Reply-To: List-Id: Content-Type: text/plain; charset="us-ascii" To: Lexington Luthor Cc: reiserfs-list@namesys.com Lexington Luthor wrote: > David Masover wrote: > >> Gregory Maxwell wrote: >> >>> Files could be COWed by a flag on the cp command (or really, perhaps >>> that should be the default behavior) or with a utility (perhaps run as >>> a periodic script to locate duplicates and COW them. This would >>> greatly speed up the process of copying files. >> >> >> Should be on the cp command, but you have to change the cp source for >> that, and everything implementing "copy", including desktop managers. >> There's currently no "copy" system call. So it's more than just a >> plugin. >> > > I would love something like this for entire directory trees. Perhaps > with a reiser4 specific tool that does a COW cp -al. Ok, are you talking about making all the files COW, or the directory structure itself somehow COW? Because if someone patched "cp" to do COW files, I'm sure it would also work for "cp -a", which would be about as fast as "cp -al". I'm not sure how it'd work to make entire directories COW -- that is, "cp -a" is as fast as "ln" of a single file. And before anyone from LKML gets any funny ideas, there's no reason why COW should be Reiser4 specific. We've been due a "copy" system call for at least a decade. Why not just add that, with the realization that POSIX would be brain-dead not to add support for it later, then make it COW for FS-es that support it, and a simple copy for FS-es that don't. With any luck, not a line of any non-COW FS need be changed to support the copy system call, unless they want to add COW support as well. And if you think it's bad copying a couple of gigs around on a local hard disk, wishing it could copy-on-write, try an NFS mount over a (very) long-distance VPN. Why should cp send a couple of gigs across a network and back, when the machine running the "cp" command never needs to see it?