fsmonitor--daemon: create token-based changed path cache
commitbec486b9c13c51b7eca0231ed4b7dac75deaf6a6
authorJeff Hostetler <jeffhost@microsoft.com>
Fri, 25 Mar 2022 18:02:57 +0000 (25 18:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Mar 2022 23:04:16 +0000 (25 16:04 -0700)
treeeb0c64d8bff962ab2f93d01c3dc25135c4cf31ed
parentaeef767a4155f55233338928f705a3e9986fe2bf
fsmonitor--daemon: create token-based changed path cache

Teach fsmonitor--daemon to build a list of changed paths and associate
them with a token-id.  This will be used by the platform-specific
backends to accumulate changed paths in response to filesystem events.

The platform-specific file system listener thread receives file system
events containing one or more changed pathnames (with whatever
bucketing or grouping that is convenient for the file system).  These
paths are accumulated (without locking) by the file system layer into
a `fsmonitor_batch`.

When the file system layer has drained the kernel event queue, it will
"publish" them to our token queue and make them visible to concurrent
client worker threads.  The token layer is free to combine and/or de-dup
paths within these batches for efficient presentation to clients.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsmonitor--daemon.c
fsmonitor--daemon.h