]> Sergey Matveev's repositories - bfs.git/log
bfs.git
7 months agobftw: Make sure we don't close a directory while we unwrap it
Tavian Barnes [Thu, 12 Oct 2023 19:50:59 +0000 (15:50 -0400)]
bftw: Make sure we don't close a directory while we unwrap it

bftw_cache_reserve() can lead to bftw_cache_pop(), which could close the
directory we're trying to unwrap!  If that happened, we would try
dup_cloexec(-1), which would fail with EBADF, so there was no observable
bug.  But it's better to avoid the whole situation.

7 months agobftw: Fix to_close list corruption with !BFS_USE_UNWRAPDIR
Tavian Barnes [Thu, 12 Oct 2023 19:13:02 +0000 (15:13 -0400)]
bftw: Fix to_close list corruption with !BFS_USE_UNWRAPDIR

It's possible for pincount to drop to zero, then get incremented and
drop back to zero again.  If this happens, we shouldn't add it to the
to_close list twice.

This should fix the intermittent hang on the macOS CI.

Fixes: 815798e1eea7fc8dacd5acab40202ec4d251d517
7 months agolist: Assert that we're not inserting already-attached nodes
Tavian Barnes [Thu, 12 Oct 2023 17:18:00 +0000 (13:18 -0400)]
list: Assert that we're not inserting already-attached nodes

7 months agodiag: Move enum debug_flags out of ctx.h
Tavian Barnes [Thu, 12 Oct 2023 17:09:11 +0000 (13:09 -0400)]
diag: Move enum debug_flags out of ctx.h

7 months agobftw: Don't force buffering for parallel dfs
Tavian Barnes [Thu, 12 Oct 2023 14:41:04 +0000 (10:41 -0400)]
bftw: Don't force buffering for parallel dfs

7 months agobftw: Fix unbuffered depth-first searches
Tavian Barnes [Thu, 12 Oct 2023 15:24:49 +0000 (11:24 -0400)]
bftw: Fix unbuffered depth-first searches

bftw() implements depth-first search by appending files to a batch, then
prepending the batch to the queue.  When we switched to separate file/
directory queues, this was only implemented for the file queue.
Unbuffered searches don't use the file queue, so they were all breadth-
first in practice.

This meant that iterative deepening (-S ids) was actually "iterative
deepening *breadth*-first search," a horrible strategy with no advantage
over regular breadth-first search.  Now it performs iterative deepening
*depth*-first search, which at least limits its memory consumption.

Fixes: c1b16b49988ecff17ae30978ea14798d95b80018
7 months agobftw: Let iterative deepening work depth-first when sorting
Tavian Barnes [Thu, 12 Oct 2023 13:44:27 +0000 (09:44 -0400)]
bftw: Let iterative deepening work depth-first when sorting

7 months agobench: Default to --strategies=rust
Tavian Barnes [Tue, 10 Oct 2023 15:51:34 +0000 (11:51 -0400)]
bench: Default to --strategies=rust

7 months agobench: New --jobs benchmark
Tavian Barnes [Tue, 10 Oct 2023 15:37:40 +0000 (11:37 -0400)]
bench: New --jobs benchmark

7 months agobench: Group by strategy in comparison mode
Tavian Barnes [Tue, 10 Oct 2023 15:34:26 +0000 (11:34 -0400)]
bench: Group by strategy in comparison mode

7 months agobench: Don't print paths in the --strategies benchmark
Tavian Barnes [Tue, 10 Oct 2023 15:21:38 +0000 (11:21 -0400)]
bench: Don't print paths in the --strategies benchmark

7 months agobench: Allow format specifiers in (sub)group headers
Tavian Barnes [Tue, 10 Oct 2023 15:14:18 +0000 (11:14 -0400)]
bench: Allow format specifiers in (sub)group headers

8 months agobar: Replace volatile sig_atomic_t with actual atomics
Tavian Barnes [Fri, 6 Oct 2023 23:08:33 +0000 (19:08 -0400)]
bar: Replace volatile sig_atomic_t with actual atomics

8 months agoalloc: Test allocation size overflows
Tavian Barnes [Fri, 6 Oct 2023 16:37:01 +0000 (12:37 -0400)]
alloc: Test allocation size overflows

8 months agotests/bfs/status: Try to test SIGWINCH
Tavian Barnes [Fri, 6 Oct 2023 16:00:02 +0000 (12:00 -0400)]
tests/bfs/status: Try to test SIGWINCH

8 months agotests: Check for expect_unbuffer too
Tavian Barnes [Fri, 6 Oct 2023 15:56:31 +0000 (11:56 -0400)]
tests: Check for expect_unbuffer too

That's where FreeBSD installs it.

8 months agotests: New bfs_pty wrapper for unbuffer
Tavian Barnes [Fri, 6 Oct 2023 15:42:06 +0000 (11:42 -0400)]
tests: New bfs_pty wrapper for unbuffer

8 months agoci: Install expect for unbuffer
Tavian Barnes [Thu, 5 Oct 2023 21:29:52 +0000 (17:29 -0400)]
ci: Install expect for unbuffer

8 months agotests/bfs: Add a test that runs -status
Tavian Barnes [Thu, 5 Oct 2023 21:18:40 +0000 (17:18 -0400)]
tests/bfs: Add a test that runs -status

8 months agotests/bfs: Add tests for color autodetection
Tavian Barnes [Thu, 5 Oct 2023 20:25:56 +0000 (16:25 -0400)]
tests/bfs: Add tests for color autodetection

8 months agotests: Respect $NO_COLOR
Tavian Barnes [Thu, 5 Oct 2023 20:25:21 +0000 (16:25 -0400)]
tests: Respect $NO_COLOR

8 months agoREADME: Realign badges
Tavian Barnes [Thu, 5 Oct 2023 18:44:55 +0000 (14:44 -0400)]
README: Realign badges

A recent GitHub change broke the nice alignment of the badges to the top
heading, so just put the badges underneath it for now.

8 months agobfstd: Add a thread-safe wrapper for strerror()
Tavian Barnes [Thu, 5 Oct 2023 16:56:36 +0000 (12:56 -0400)]
bfstd: Add a thread-safe wrapper for strerror()

8 months agothread: Define thread_local
Tavian Barnes [Thu, 5 Oct 2023 16:55:56 +0000 (12:55 -0400)]
thread: Define thread_local

8 months agoconfig: Fold !__FreeBSD__ into BFS_USE_SYS_CAPABILITY_H
Tavian Barnes [Thu, 5 Oct 2023 16:47:31 +0000 (12:47 -0400)]
config: Fold !__FreeBSD__ into BFS_USE_SYS_CAPABILITY_H

8 months agodstring: Limit the special dchar typedef to lint builds
Tavian Barnes [Tue, 3 Oct 2023 20:26:05 +0000 (16:26 -0400)]
dstring: Limit the special dchar typedef to lint builds

Clang still thinks that alignof(dstr[1]) == 2, so out of an abundance of
caution, don't mess with dchar alignment in normal builds.

8 months agobuild: New lint flag
Tavian Barnes [Tue, 3 Oct 2023 20:25:56 +0000 (16:25 -0400)]
build: New lint flag

8 months agothread: s/call_once/invoke_once/
Tavian Barnes [Tue, 3 Oct 2023 17:07:21 +0000 (13:07 -0400)]
thread: s/call_once/invoke_once/

call_once() is a reserved identifier from C11.

8 months agoci/freebsd: Use tailscale ssh
Tavian Barnes [Tue, 3 Oct 2023 14:17:12 +0000 (10:17 -0400)]
ci/freebsd: Use tailscale ssh

8 months agoci/macos: Don't install coreutils
Tavian Barnes [Tue, 3 Oct 2023 14:11:42 +0000 (10:11 -0400)]
ci/macos: Don't install coreutils

Since we build our own touch(1) implementation, we no longer need to
work around the macOS bug.

8 months agotests: Fix make_deep() on FreeBSD
Tavian Barnes [Mon, 2 Oct 2023 18:13:49 +0000 (14:13 -0400)]
tests: Fix make_deep() on FreeBSD

I keep forgetting that PATH_MAX is only 1024 there.

8 months agoMerge branch 'io-uring'
Tavian Barnes [Mon, 2 Oct 2023 17:09:41 +0000 (13:09 -0400)]
Merge branch 'io-uring'

8 months agoMerge branch 'benchmarks'
Tavian Barnes [Mon, 2 Oct 2023 17:09:36 +0000 (13:09 -0400)]
Merge branch 'benchmarks'

8 months agotests: Don't cd into paths longer than PATH_MAX
Tavian Barnes [Mon, 2 Oct 2023 16:57:26 +0000 (12:57 -0400)]
tests: Don't cd into paths longer than PATH_MAX

This fixes a warning on at least Alpine Linux that looks like

    cd: error retrieving current directory: getcwd: cannot access parent directories: Filename too long

8 months agoioq: Use io_uring
Tavian Barnes [Tue, 11 Jul 2023 18:04:40 +0000 (14:04 -0400)]
ioq: Use io_uring

Closes #65.

8 months agobuild: Add liburing on Linux
Tavian Barnes [Tue, 11 Jul 2023 18:30:52 +0000 (14:30 -0400)]
build: Add liburing on Linux

8 months agobench: Add a README
Tavian Barnes [Mon, 2 Oct 2023 14:49:41 +0000 (10:49 -0400)]
bench: Add a README

8 months agobench: Add benchmarking script
Tavian Barnes [Fri, 29 Sep 2023 18:13:06 +0000 (14:13 -0400)]
bench: Add benchmarking script

8 months agobench: New script to clone a git repo without file contents
Tavian Barnes [Thu, 28 Sep 2023 21:39:34 +0000 (17:39 -0400)]
bench: New script to clone a git repo without file contents

8 months agotests/xtouch: Try creating the immediate parent first
Tavian Barnes [Fri, 29 Sep 2023 19:13:41 +0000 (15:13 -0400)]
tests/xtouch: Try creating the immediate parent first

8 months agoFormatting fixes
Tavian Barnes [Wed, 27 Sep 2023 16:11:15 +0000 (12:11 -0400)]
Formatting fixes

8 months agobit: Fix UINTPTR_WIDTH typo
Tavian Barnes [Tue, 26 Sep 2023 19:42:35 +0000 (15:42 -0400)]
bit: Fix UINTPTR_WIDTH typo

8 months agobit: Use predefined __*_WIDTH__ macros if we can
Tavian Barnes [Tue, 26 Sep 2023 19:05:43 +0000 (15:05 -0400)]
bit: Use predefined __*_WIDTH__ macros if we can

8 months agodstring: New dchar typedef for dynamic strings
Tavian Barnes [Tue, 26 Sep 2023 16:48:21 +0000 (12:48 -0400)]
dstring: New dchar typedef for dynamic strings

8 months agoci/freebsd: Switch to Tailscale OAuth
Tavian Barnes [Mon, 25 Sep 2023 19:26:52 +0000 (15:26 -0400)]
ci/freebsd: Switch to Tailscale OAuth

8 months agoUse the new list macros
Tavian Barnes [Mon, 25 Sep 2023 17:58:19 +0000 (13:58 -0400)]
Use the new list macros

8 months agolist: New for_[s]list() macros
Tavian Barnes [Mon, 25 Sep 2023 17:53:15 +0000 (13:53 -0400)]
list: New for_[s]list() macros

8 months agolist: Unify formatting
Tavian Barnes [Mon, 25 Sep 2023 17:34:17 +0000 (13:34 -0400)]
list: Unify formatting

8 months agolist: New [S]LIST_EMPTY() macros
Tavian Barnes [Mon, 25 Sep 2023 17:29:03 +0000 (13:29 -0400)]
list: New [S]LIST_EMPTY() macros

8 months agolist: New [S]LIST_ITEM_INIT() macros
Tavian Barnes [Mon, 25 Sep 2023 17:16:35 +0000 (13:16 -0400)]
list: New [S]LIST_ITEM_INIT() macros

8 months agolist: Use (void)(...) rather than do { ... } while (0)
Tavian Barnes [Mon, 25 Sep 2023 17:03:51 +0000 (13:03 -0400)]
list: Use (void)(...) rather than do { ... } while (0)

This makes everything usable in expression contexts.

8 months agoREADME: Add Guix and OpenBSD packages
Tavian Barnes [Thu, 14 Sep 2023 16:14:26 +0000 (12:14 -0400)]
README: Add Guix and OpenBSD packages

8 months agobftw: Share the bftw_state between iterations of ids/eds
Tavian Barnes [Wed, 13 Sep 2023 15:39:50 +0000 (11:39 -0400)]
bftw: Share the bftw_state between iterations of ids/eds

8 months agoparse: Give more ephemeral_fds to -no{user,group}
Tavian Barnes [Tue, 12 Sep 2023 19:04:30 +0000 (15:04 -0400)]
parse: Give more ephemeral_fds to -no{user,group}

Fewer than 3 can lead to

    Assertion failed: (retval->write_queue != -1), function __open_cached_connection, file /usr/src/lib/libc/net/nscachedcli.c, line 224.

on a FreeBSD system with LDAP accounts.

9 months agoRelease 3.0.2
Tavian Barnes [Thu, 7 Sep 2023 01:15:50 +0000 (21:15 -0400)]
Release 3.0.2

9 months agobfstd: Work around a FreeBSD-specific msan issue
Tavian Barnes [Wed, 6 Sep 2023 21:13:04 +0000 (17:13 -0400)]
bfstd: Work around a FreeBSD-specific msan issue

Link: https://github.com/llvm/llvm-project/issues/65532
9 months agobfstd: Skip a whole loop in dollar_quote() if possible
Tavian Barnes [Wed, 6 Sep 2023 20:28:12 +0000 (16:28 -0400)]
bfstd: Skip a whole loop in dollar_quote() if possible

9 months agobfstd: Fix printable_len() off-by-one
Tavian Barnes [Wed, 6 Sep 2023 20:23:10 +0000 (16:23 -0400)]
bfstd: Fix printable_len() off-by-one

If xmbrtowc() fails, or if xiswprint() is false, then we shouldn't
include that wide char in the printable length.

Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
9 months agobfstd: Fix an OOB string index in xmbrtowc()
Tavian Barnes [Wed, 6 Sep 2023 18:59:59 +0000 (14:59 -0400)]
bfstd: Fix an OOB string index in xmbrtowc()

This bug could be reproduced with something like

    $ bfs -samefile $'\xFA\xFA'
    bfs: error: bfs: dstrnescat@src/dstring.c:252: wordesc() result truncated

or worse, with -DNDEBUG,

    $ bfs -samefile $'.....................\xFA\xFA'
    bfs: error: bfs -samefile $'.....................\xFA\xFA\x00\x55\x53\x45\x52\x3D\x74\x61\x76\x69\x61\x6E\x61\x74\x6F\x72
    bfs: error:               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    bfs: error: No such file or directory.

which prints the memory after the end of the string (in this case, the
environment variable USER=tavianator).

The bug was caused by the line `*i += len`, which was intended to be
`*i = len`.  But actually, the right behaviour seems to be `*i += 1`.

Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
9 months agobftw: Enforce the dirlimit strictly
Tavian Barnes [Wed, 6 Sep 2023 13:30:47 +0000 (09:30 -0400)]
bftw: Enforce the dirlimit strictly

The previous accounting didn't fully control the number of allocated
bfs_dirs, as the dirlimit was incremented once we popped the directory,
not when we freed it.

9 months agobfs uses the C17 standard version
Alejandro Lazaro [Fri, 1 Sep 2023 15:50:26 +0000 (17:50 +0200)]
bfs uses the C17 standard version

`bfs` uses C17 since 3.0

9 months agopwcache: Don't use _SC_GET{PW,GR}_R_SIZE_MAX
Tavian Barnes [Thu, 31 Aug 2023 15:07:38 +0000 (11:07 -0400)]
pwcache: Don't use _SC_GET{PW,GR}_R_SIZE_MAX

They tend be 1024, which is a lot of memory per user/group.  128 is
usually enough, so start there instead.

9 months agopwcache: Arena-allocate struct passwd/group
Tavian Barnes [Thu, 31 Aug 2023 14:55:39 +0000 (10:55 -0400)]
pwcache: Arena-allocate struct passwd/group

9 months agoalloc: New varena_grow() function
Tavian Barnes [Thu, 31 Aug 2023 14:42:42 +0000 (10:42 -0400)]
alloc: New varena_grow() function

9 months agotrie: New trie_clear() function
Tavian Barnes [Thu, 31 Aug 2023 14:16:35 +0000 (10:16 -0400)]
trie: New trie_clear() function

9 months agoalloc: New [v]arena_clear() functions
Tavian Barnes [Thu, 31 Aug 2023 14:16:15 +0000 (10:16 -0400)]
alloc: New [v]arena_clear() functions

9 months agoWork around https://github.com/llvm/llvm-project/issues/64946
Tavian Barnes [Thu, 24 Aug 2023 03:19:55 +0000 (23:19 -0400)]
Work around https://github.com/llvm/llvm-project/issues/64946

9 months agoioq: New ioq_slot_monitor() helper
Tavian Barnes [Tue, 8 Aug 2023 20:03:11 +0000 (16:03 -0400)]
ioq: New ioq_slot_monitor() helper

9 months agodocs/bfs.1: Document each -regextype
Tavian Barnes [Tue, 15 Aug 2023 19:57:02 +0000 (15:57 -0400)]
docs/bfs.1: Document each -regextype

9 months agodocs/bfs.1: Document that -help/-version exit immediately
Tavian Barnes [Tue, 15 Aug 2023 18:35:55 +0000 (14:35 -0400)]
docs/bfs.1: Document that -help/-version exit immediately

9 months agodocs/bfs.1: Don't unnecessarily quote {}
Tavian Barnes [Tue, 15 Aug 2023 18:30:41 +0000 (14:30 -0400)]
docs/bfs.1: Don't unnecessarily quote {}

9 months agodocs/bfs.1: Clarify the effects of $POSIXLY_CORRECT
Tavian Barnes [Tue, 15 Aug 2023 18:30:17 +0000 (14:30 -0400)]
docs/bfs.1: Clarify the effects of $POSIXLY_CORRECT

9 months agodocs/bfs.1: Document use of $PATH
Tavian Barnes [Tue, 15 Aug 2023 18:28:10 +0000 (14:28 -0400)]
docs/bfs.1: Document use of $PATH

9 months agodocs/bfs.1: Document that -prune does not work together with -depth
Tavian Barnes [Tue, 15 Aug 2023 18:27:01 +0000 (14:27 -0400)]
docs/bfs.1: Document that -prune does not work together with -depth

9 months agodocs/bfs.1: Document the -type d,f syntax
Tavian Barnes [Tue, 15 Aug 2023 18:26:23 +0000 (14:26 -0400)]
docs/bfs.1: Document the -type d,f syntax

9 months agodocs/bfs.1: Use a bulleted list for -size units
Tavian Barnes [Tue, 15 Aug 2023 18:25:42 +0000 (14:25 -0400)]
docs/bfs.1: Use a bulleted list for -size units

9 months agodocs/bfs.1: Give an example with a space separating date from time
Tavian Barnes [Tue, 15 Aug 2023 18:21:47 +0000 (14:21 -0400)]
docs/bfs.1: Give an example with a space separating date from time

9 months agodocs/bfs.1: Make bold/italic formatting more consistent
Tavian Barnes [Tue, 15 Aug 2023 18:19:59 +0000 (14:19 -0400)]
docs/bfs.1: Make bold/italic formatting more consistent

9 months agotests: Add missing .out file
Tavian Barnes [Mon, 14 Aug 2023 20:05:35 +0000 (16:05 -0400)]
tests: Add missing .out file

9 months agoparse: Allow -files0-from an empty set of paths
Tavian Barnes [Mon, 14 Aug 2023 19:59:04 +0000 (15:59 -0400)]
parse: Allow -files0-from an empty set of paths

This follows a behaviour change in GNU findutils 4.9.0.

10 months agobfstd: Don't label a declaration
Tavian Barnes [Tue, 8 Aug 2023 19:11:45 +0000 (15:11 -0400)]
bfstd: Don't label a declaration

10 months agostat: Don't check for statx() mask bits we already checked for
Tavian Barnes [Mon, 7 Aug 2023 23:11:18 +0000 (19:11 -0400)]
stat: Don't check for statx() mask bits we already checked for

10 months agobfstd: Check multiple chars at once for isascii()
Tavian Barnes [Mon, 7 Aug 2023 23:41:12 +0000 (19:41 -0400)]
bfstd: Check multiple chars at once for isascii()

10 months agobfstd: Speed up wordesc() by caching isprint()/isspace()
Tavian Barnes [Mon, 7 Aug 2023 22:29:19 +0000 (18:29 -0400)]
bfstd: Speed up wordesc() by caching isprint()/isspace()

10 months agobit: Add a cast to squelch -Wsign-compare
Tavian Barnes [Mon, 24 Jul 2023 16:13:38 +0000 (12:13 -0400)]
bit: Add a cast to squelch -Wsign-compare

I see this only with musl-gcc for some reason.

10 months agoREADME: Official Homebrew formula
Martin Polden [Sat, 22 Jul 2023 10:51:35 +0000 (12:51 +0200)]
README: Official Homebrew formula

An official `bfs` formula has been added to Homebrew now.

10 months agoREADME.md: fix reversed examples
Wayne Scott [Sat, 22 Jul 2023 09:55:58 +0000 (05:55 -0400)]
README.md: fix reversed examples

10 months agoRename Makefile to GNUmakefile
Raf Czlonka [Thu, 20 Jul 2023 15:58:51 +0000 (16:58 +0100)]
Rename Makefile to GNUmakefile

10 months agoREADME: Add official Arch Linux package
Tavian Barnes [Thu, 20 Jul 2023 12:45:11 +0000 (08:45 -0400)]
README: Add official Arch Linux package

10 months agoCFLAGS adjustment in Makefile
Jason Stewart [Wed, 19 Jul 2023 16:50:14 +0000 (12:50 -0400)]
CFLAGS adjustment in Makefile

`-flto` to `-flto=auto` to eliminate `using serial compilation of 3 LTRANS jobs` gcc warning
see https://stackoverflow.com/questions/72218980/gcc-v12-1-warning-about-serial-compilation

10 months agoRelease 3.0.1
Tavian Barnes [Tue, 18 Jul 2023 16:23:21 +0000 (12:23 -0400)]
Release 3.0.1

10 months agobftw: Use bftw_file->next for multiple lists
Tavian Barnes [Tue, 18 Jul 2023 16:14:07 +0000 (12:14 -0400)]
bftw: Use bftw_file->next for multiple lists

A file can be on the to_open and to_read lists at the same time, but
otherwise only one list, so we can save memory by sharing the pointers.

10 months agobftw: Use a larger ioq depth
Tavian Barnes [Tue, 18 Jul 2023 15:56:41 +0000 (11:56 -0400)]
bftw: Use a larger ioq depth

Now that the dirlimit provides backpressure on the number of open
directories, we can use a uniformly larger queue depth for increased
performance.  The current parameters were tuned with a small grid search
on my workstation.

10 months agobftw: Add a queue of directories to unwrap
Tavian Barnes [Tue, 18 Jul 2023 15:43:21 +0000 (11:43 -0400)]
bftw: Add a queue of directories to unwrap

For !BFS_USE_UNWRAPDIR, if a file is still pinned in bftw_closedir(), it
has to stay open until its pincount drops to zero.  Since this happens
in bftw_ioq_pop(), we can't immediately call bftw_unwrapdir() as that
adds to the ioq.  Instead, add it to a list that gets drained by the
next bftw_gc().

10 months agobftw: Add dirs to the end of the queue in bftw_ioq_pop()
Tavian Barnes [Tue, 18 Jul 2023 00:30:57 +0000 (20:30 -0400)]
bftw: Add dirs to the end of the queue in bftw_ioq_pop()

I tried this before in #105 but it led to performance regressions.  The
key to avoiding those regressions is to put some backpressure on how
many bfs_dir's can be allocated simultaneously.

10 months agobftw: Use separate queues for open and closed directories
Tavian Barnes [Mon, 17 Jul 2023 22:40:32 +0000 (18:40 -0400)]
bftw: Use separate queues for open and closed directories

10 months agobftw: Check that file->fd == bfs_dirfd(file->dir) earlier
Tavian Barnes [Mon, 17 Jul 2023 23:58:39 +0000 (19:58 -0400)]
bftw: Check that file->fd == bfs_dirfd(file->dir) earlier

This has the potential to fail on at least one known platform: macports
with the legacysupport implementation of fdopendir().

Link: https://github.com/macports/macports-ports/pull/19047#issuecomment-1636059809
10 months agobftw: Reserve space in the cache before opening files
Tavian Barnes [Mon, 17 Jul 2023 23:05:23 +0000 (19:05 -0400)]
bftw: Reserve space in the cache before opening files

This fixes a storm of EMFILE retries observed with -j1 on a very large
directory tree.

Fixes: 7888fbababd22190e9f919fc272957426a27969e
10 months agobftw: Pass the whole bftw_state to bftw_openat()
Tavian Barnes [Mon, 17 Jul 2023 23:03:30 +0000 (19:03 -0400)]
bftw: Pass the whole bftw_state to bftw_openat()

This required shuffling a lot of code around.  Hopefully the new order
makes more sense.

10 months agobftw: Add bfs_dir allocation wrappers
Tavian Barnes [Mon, 17 Jul 2023 21:15:47 +0000 (17:15 -0400)]
bftw: Add bfs_dir allocation wrappers