Re: [PATCH] cowlinks v2

Davide Libenzi
2004-03-21T17:59:41Z

On Sun, 21 Mar 2004, Jörn Engel wrote:

> On Sat, 20 March 2004 08:48:43 -0800, Davide Libenzi wrote:
> >
> > FWIW I did this quite some time ago to speed up copy+diff linux kernel
> > trees:
> >
> > http://www.xmailserver.org/flcow.html
> >
> > It is entirely userspace and uses LD_PRELOAD on my dev shell.
>
> Nice work. I was thinking about something like that as an
> intermediate solution (my goal is libc inclusion), just with slightly
> different checks:
>
> int ret = open(...);
> if (ret == -EMLINK)
> ret = cow_open(...);
> return ret;

When I did that, fumes of an in-kernel implementation invaded my head for
a little while. Then you start thinking that you have to teach apps of new
open(2) semantics, you have to bloat kernel code a little bit and you have
to deal with a new set of errors cases that open(2) is not expected to
deal with. A fully userspace implementation did fit my needs at that time,
even if the LD_PRELOAD trick might break if weak aliases setup for open
functions change inside glibc.

- Davide