Re: [ANNOUNCEMENT PATCH COW] proof of concept impementation of cowlinks
From: Jörn Engel
Date: Tue May 11 2004 - 05:04:26 EST
On Mon, 10 May 2004 15:26:02 -0400, Jan Harkes wrote:
> On Mon, May 10, 2004 at 05:53:59PM +0200, Jörn Engel wrote:
> > A real problem is that copyfile() has all errno's from create(),
> > sendfile() and unlink() combined, which doesn't make error handling in
> > userspace easy. "It could be this, that or another error" is the kind
> > of mess I always hated about Windows, so I should try to do a little
> > better.
>
> Well, if you leave the create and unlink up to the application and
> simply pass open filedescriptors to copyfile... But then it would be
> equivalent to your new sendfile.
>
> Copyfile can trivially be implemented in libc. I don't see why it would
> have to be a system call. If a network filesystem wants to optimize the
> file copying it could do this based on the sendfile data. If source and
> destination are within the same filesystem and we're copying the whole
> file starting at offset 0, send a copyfile RPC.
Can you explain this to Steve? I'm still quite clueless about network
filesystems, but it sounded as if such an optimization was impossible
to do in cifs without a combined create/copy/unlink_on_error system
call.
If your suggestion works and the network filesystems can be changed to
work independently of a struct file*, I agree with you that copyfile()
is a stupid idea and should be forgotten.
Jörn
--
Courage is not the absence of fear, but rather the judgement that
something else is more important than fear.
-- Ambrose Redmoon
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/