From: Jeff King Date: Fri, 08 Sep 2017 08:33:06 GMT Subject: Re: [PATCH 02/10] struct ref_transaction: add a place for backends to store data Message-ID: <20170908083305.hjcsa4ejlujwvj4h@sigill.intra.peff.net> In-Reply-To: <6c4cf1eb-7991-1a39-a298-7839872ed3f5@alum.mit.edu> On Fri, Sep 08, 2017 at 10:19:48AM +0200, Michael Haggerty wrote: > > 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