Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inotify: simplify bookkeeping of watched paths
Create a new watcher type to keep track of the watches instead of keeping two maps on the Watcher and accessing these directly. This makes the bookkeeping a bit easier to follow, and we no longer need to worry about locking map access as the watcher type takes care of that now. Came up in #472 where I want to keep track if a path was added recursively, and this makes that a bit easier. Also seems a bit faster: BenchmarkWatch-2 903709 7122 ns/op 194 B/op 3 allocs/op BenchmarkWatch-2 923980 6322 ns/op 196 B/op 3 allocs/op Although that benchmark is very simply and only tests one code path; just want to make sure it's not a horrible regression.
- Loading branch information
Showing
3 changed files
with
92 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters