Thread (22 messages) flat view 22 messages, 3 authors, 2016-06-15

Re: [PATCH 04/12] refs: implement simple transactions for the packed-refs file

From: Jeff King <hidden>
Date: 2016-06-15 22:57:42

On Tue, Jun 11, 2013 at 11:48:24PM +0200, Michael Haggerty wrote:
The API docs are not clear about whether it is kosher to read
lock_file::fd directly.  It is only done in one file outside of
lockfile.c.  So this patch stores the fd of the lockfile separately in
struct packed_ref_cache, even though the same struct also has a
pointer to the struct lock_file.

So please let me know if it is OK to read lock_file::fd directly.  If
so, then I will drop the fd member of struct packed_ref_cache, as well
as the local variable "fd" in lock_packed_refs().
I think it's fine; the fact that you have such an fd is a public part of
the interface, so you are only relying on the struct member being there.
And since the lock_file must hold the fd itself somewhere, I don't think
that's unreasonable.

I'm not sure how you got your "in one file" list, but it appears to
happen in credential-store.c, bundle.c, fast-import.c, and read-cache.c.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help