Re: [PATCH 02/10] struct ref_transaction: add a place for backends to store data
From: Jeff King <hidden>
Date: 2017-09-08 08:33:19
From: Jeff King <hidden>
Date: 2017-09-08 08:33:19
On Fri, Sep 08, 2017 at 10:19:48AM +0200, Michael Haggerty wrote:
quoted
This is just one pointer. Once we start layering ref backends (and already we're moving towards a "files" layer which sits atop loose and packed backends, right?), how do we avoid backends stomping on each other (or worse, dereferencing somebody else's data as their own struct)?My conception is that layered backends would be separated as much as possible, and if the "top" layer needs to modify the "bottom" layer, it would do so via a separate reference transaction on the bottom layer. That transaction would be owned by the bottom layer, which would be able to use the corresponding `backend_data` pointers however it likes. You can see an example of this construct in patch 08.
OK, that makes sense. -Peff