git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/5] reftable/stack: refactor reloading to use file descriptor

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 16, 2024, 16:44 UTC
Message-ID
<xmqqv87t1b4u.fsf@gitster.g>
In-Reply-To
<20240116151447.GD2119690@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
>> So overall this works as intended, even though I would not consider it
>> to be the cleanest way to handle this. Unless you or others think that
>> this should be refactored I'll leave it as-is for now though.
>
> Thanks for confirming. I think we can leave your patch as-is. If
> anything, I would say that stat_validity_update() should check for "fd <
> 0" itself. Not because I think fstat() is unlikely to behave differently
> on some platform, but simply because it more clearly documents the
> expectation.

Thanks, I agree with your point that we should avoid calling system functions that take a file descriptor with a known-invalid (like negative) one.

Previous: Jeff KingNext: Patrick Steinhardt
Message 19 of 22 in “reftable: optimize I/O patterns”
  1. 0/4 reftable: optimize I/O patternsPatrick Steinhardt, Jan 8, 2024
  2. 1/4 reftable/stack: refactor stack reloading to have common exit pathPatrick Steinhardt, Jan 8, 2024
  3. Junio C HamanoJan 10, 2024
  4. Patrick SteinhardtJan 11, 2024
  5. 2/4 reftable/stack: refactor reloading to use file descriptorPatrick Steinhardt, Jan 8, 2024
  6. Junio C HamanoJan 10, 2024
  7. 3/4 reftable/stack: use stat info to avoid re-reading stack listPatrick Steinhardt, Jan 8, 2024
  8. Junio C HamanoJan 10, 2024
  9. Patrick SteinhardtJan 11, 2024
  10. 4/4 reftable/blocksource: use mmap to read tablesPatrick Steinhardt, Jan 8, 2024
  11. Junio C HamanoJan 10, 2024
  12. Patrick SteinhardtJan 11, 2024
  13. 0/5 reftable: optimize I/O patternsPatrick Steinhardt, Jan 11, 2024
  14. 1/5 reftable/stack: refactor stack reloading to have common exit pathPatrick Steinhardt, Jan 11, 2024
  15. 2/5 reftable/stack: refactor reloading to use file descriptorPatrick Steinhardt, Jan 11, 2024
  16. Jeff KingJan 14, 2024
  17. Patrick SteinhardtJan 15, 2024
  18. Jeff KingJan 16, 2024
  19. Junio C HamanoJan 16, 2024
  20. 3/5 reftable/stack: use stat info to avoid re-reading stack listPatrick Steinhardt, Jan 11, 2024
  21. 4/5 reftable/blocksource: refactor code to match our coding stylePatrick Steinhardt, Jan 11, 2024
  22. 5/5 reftable/blocksource: use mmap to read tablesPatrick Steinhardt, Jan 11, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.