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

[PATCH 2/6] fsmonitor: Stop inline'ing mark_fsmonitor_valid / _invalid

From
AVAlex Vandiver <alexmv@dropbox.com>
Date
Jan 3, 2018, 03:04 UTC
Message-ID
<9bb36cea369530b980f6542e3e0f24dc142a20a8.1514948078.git.alexmv@dropbox.com>
In-Reply-To
<20180103030456.8181-1-alexmv@dropbox.com>

These were inline'd when they were first introduced, presumably as an optimization for cases when they were called in tight loops. This complicates using these functions, as untracked_cache_invalidate_path is defined in dir.h.

Leave the inline'ing up to the compiler's decision, for ease of use.
Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
---
 fsmonitor.c | 18 ++++++++++++++++++
 fsmonitor.h | 17 ++---------------
 2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/fsmonitor.c b/fsmonitor.c
index 0af7c4edb..df084235b 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -194,6 +194,24 @@ void refresh_fsmonitor(struct index_state *istate)
 	istate->fsmonitor_last_update = last_update;
 }
 
+void mark_fsmonitor_valid(struct cache_entry *ce)
+{
+	if (core_fsmonitor) {
+		ce->ce_flags |= CE_FSMONITOR_VALID;
+		trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_clean '%s'", ce->name);
+	}
+}
+
+void mark_fsmonitor_invalid(struct index_state *istate, struct cache_entry *ce)
+{
+	if (core_fsmonitor) {
+		ce->ce_flags &= ~CE_FSMONITOR_VALID;
+		untracked_cache_invalidate_path(istate, ce->name);
+		trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_invalid '%s'", ce->name);
+	}
+}
+
+
 void add_fsmonitor(struct index_state *istate)
 {
 	int i;
diff --git a/fsmonitor.h b/fsmonitor.h
index cd3cc0ccf..6328745b2 100644
--- a/fsmonitor.h
+++ b/fsmonitor.h
@@ -46,13 +46,7 @@ extern void refresh_fsmonitor(struct index_state *istate);
  * called any time the cache entry has been updated to reflect the
  * current state of the file on disk.
  */
-static inline void mark_fsmonitor_valid(struct cache_entry *ce)
-{
-	if (core_fsmonitor) {
-		ce->ce_flags |= CE_FSMONITOR_VALID;
-		trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_clean '%s'", ce->name);
-	}
-}
+extern void mark_fsmonitor_valid(struct cache_entry *ce);
 
 /*
  * Clear the given cache entry's CE_FSMONITOR_VALID bit and invalidate
@@ -61,13 +55,6 @@ static inline void mark_fsmonitor_valid(struct cache_entry *ce)
  * trigger an lstat() or invalidate the untracked cache for the
  * corresponding directory
  */
-static inline void mark_fsmonitor_invalid(struct index_state *istate, struct cache_entry *ce)
-{
-	if (core_fsmonitor) {
-		ce->ce_flags &= ~CE_FSMONITOR_VALID;
-		untracked_cache_invalidate_path(istate, ce->name);
-		trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_invalid '%s'", ce->name);
-	}
-}
+extern void mark_fsmonitor_invalid(struct index_state *istate, struct cache_entry *ce);
 
 #endif
-- 
2.15.1.31.gddce0adfe
Previous: Alex VandiverNext: Johannes Schindelin
Message 8 of 15 in “Minor fsmonitor bugfixes, use with `git diff`”
  1. 0/6 Minor fsmonitor bugfixes, use with `git diff`Alex Vandiver, Jan 3, 2018
  2. 1/6 Fix comments to agree with argument nameAlex Vandiver, Jan 3, 2018
  3. 6/6 fsmonitor: Use fsmonitor data in `git diff`Alex Vandiver, Jan 3, 2018
  4. Johannes SchindelinJan 4, 2018
  5. Junio C HamanoJan 5, 2018
  6. Ben PeartJan 8, 2018
  7. 5/6 fsmonitor: Remove debugging lines from t/t7519-status-fsmonitor.shAlex Vandiver, Jan 3, 2018
  8. 2/6 fsmonitor: Stop inline'ing mark_fsmonitor_valid / _invalidAlex Vandiver, Jan 3, 2018
  9. Johannes SchindelinJan 4, 2018
  10. Ben PeartJan 8, 2018
  11. 4/6 fsmonitor: Make output of test-dump-fsmonitor more conciseAlex Vandiver, Jan 3, 2018
  12. Johannes SchindelinJan 4, 2018
  13. Ben PeartJan 8, 2018
  14. 3/6 fsmonitor: Update helper tool, now that flags are filled laterAlex Vandiver, Jan 3, 2018
  15. Johannes SchindelinJan 4, 2018

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.