All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Vandiver via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Nipunn Koorapati <nipunn1313@gmail.com>,
	Alex Vandiver <alexmv@dropbox.com>
Subject: [PATCH 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid
Date: Wed, 21 Oct 2020 18:04:33 +0000	[thread overview]
Message-ID: <049989652cefb90304e711dbfe354b55a5a71f41.1603303474.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.767.git.1603303474.gitgitgadget@gmail.com>

From: Alex Vandiver <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>
Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com>
---
 fsmonitor.c | 19 +++++++++++++++++++
 fsmonitor.h | 18 ++----------------
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/fsmonitor.c b/fsmonitor.c
index ca031c3abb..e120b3c5a9 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -287,6 +287,25 @@ void refresh_fsmonitor(struct index_state *istate)
 	istate->fsmonitor_last_update = strbuf_detach(&last_update_token, NULL);
 }
 
+void mark_fsmonitor_valid(struct index_state *istate, struct cache_entry *ce)
+{
+	if (core_fsmonitor && !(ce->ce_flags & CE_FSMONITOR_VALID)) {
+		istate->cache_changed = 1;
+		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, 1);
+		trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_invalid '%s'", ce->name);
+	}
+}
+
+
 void add_fsmonitor(struct index_state *istate)
 {
 	unsigned int i;
diff --git a/fsmonitor.h b/fsmonitor.h
index 739318ab6d..6249020692 100644
--- a/fsmonitor.h
+++ b/fsmonitor.h
@@ -49,14 +49,7 @@ 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 index_state *istate, struct cache_entry *ce)
-{
-	if (core_fsmonitor && !(ce->ce_flags & CE_FSMONITOR_VALID)) {
-		istate->cache_changed = 1;
-		ce->ce_flags |= CE_FSMONITOR_VALID;
-		trace_printf_key(&trace_fsmonitor, "mark_fsmonitor_clean '%s'", ce->name);
-	}
-}
+extern void mark_fsmonitor_valid(struct index_state *istate, struct cache_entry *ce);
 
 /*
  * Clear the given cache entry's CE_FSMONITOR_VALID bit and invalidate
@@ -65,13 +58,6 @@ static inline void mark_fsmonitor_valid(struct index_state *istate, struct cache
  * 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, 1);
-		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
-- 
gitgitgadget


  reply	other threads:[~2020-10-21 18:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 18:04 [PATCH 0/2] fsmonitor inline / testing cleanup Nipunn Koorapati via GitGitGadget
2020-10-21 18:04 ` Alex Vandiver via GitGitGadget [this message]
2020-10-21 20:55   ` [PATCH 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid Taylor Blau
2020-10-21 21:24     ` Junio C Hamano
2020-10-21 21:31       ` Taylor Blau
2020-10-21 21:38         ` Junio C Hamano
2020-10-21 23:22     ` Nipunn Koorapati
2020-10-21 18:04 ` [PATCH 2/2] fsmonitor: make output of test-dump-fsmonitor more concise Alex Vandiver via GitGitGadget
2020-10-21 20:52 ` [PATCH 0/2] fsmonitor inline / testing cleanup Taylor Blau
2020-10-21 23:15   ` Nipunn Koorapati
2020-10-22  0:21 ` [PATCH v2 " Nipunn Koorapati via GitGitGadget
2020-10-22  0:21   ` [PATCH v2 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid Alex Vandiver via GitGitGadget
2020-10-22  0:21   ` [PATCH v2 2/2] fsmonitor: make output of test-dump-fsmonitor more concise Alex Vandiver via GitGitGadget
2020-10-22 17:40   ` [PATCH v2 0/2] fsmonitor inline / testing cleanup Taylor Blau
2020-10-22 18:32     ` Junio C Hamano
2020-10-22 18:38       ` Taylor Blau
2020-10-22 19:14         ` Junio C Hamano
2020-10-22 20:59           ` Nipunn Koorapati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=049989652cefb90304e711dbfe354b55a5a71f41.1603303474.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=alexmv@dropbox.com \
    --cc=git@vger.kernel.org \
    --cc=nipunn1313@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.