Re: [PATCH] cowlinks v2
From: Eric W. Biederman
Date: Mon Mar 22 2004 - 06:21:40 EST
Davide Libenzi <davidel@xxxxxxxxxxxxxxx> writes:
> On 21 Mar 2004, Eric W. Biederman wrote:
>
> > Davide Libenzi <davidel@xxxxxxxxxxxxxxx> writes:
> >
> > > > Actually there is... You don't do the copy until an actual write occurs.
> > > > Some files are opened read/write when there is simply the chance they
> might
>
> > > > be written to so delaying the copy is generally a win.
> > >
> > > What about open+mmap?
> >
> > The case is nothing really different from having a hole in your file.
> >
> > There are two pieces to implementing this. First you create separate
> > page cache entries for the cow file and it's original, so the
> > laziness of mmapped file writes will not bite you.. Second you make
> > aops -> writepage trigger the actual copy of the file, and have it
> > return -ENOSPC if you can't do the copy.
>
> There has been a misunderstanding. I thought you were talking about a
> userspace solution ala fl-cow. Of course if you are inside the kernel you
> can catch both explicit writes and page syncs.
Right. Although there is nothing prevent the copy to be in user space
even with the trigger hooks down in the write path.
The nice features of having the hook at that point in the kernel are:
1) No new failure modes for user space to worry about.
2) With cow directory support instant fs level check pointing is achieved.
Eric
-
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/