git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Vandiver via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Taylor Blau <me@ttaylorr.com>,
	Nipunn Koorapati <nipunn1313@gmail.com>,
	Nipunn Koorapati <nipunn1313@gmail.com>,
	Alex Vandiver <alexmv@dropbox.com>
Subject: [PATCH v2 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid
Date: Thu, 22 Oct 2020 00:21:05 +0000	[thread overview]
Message-ID: <ab9c330ca804eab6061d997bb5f216e48b199876.1603326066.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.767.v2.git.1603326066.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 | 19 ++-----------------
 2 files changed, 21 insertions(+), 17 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..313a35fdc8 100644
--- a/fsmonitor.h
+++ b/fsmonitor.h
@@ -2,7 +2,6 @@
 #define FSMONITOR_H
 
 #include "cache.h"
-#include "dir.h"
 
 extern struct trace_key trace_fsmonitor;
 
@@ -49,14 +48,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 +57,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-22  0:21 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 ` [PATCH 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid Alex Vandiver via GitGitGadget
2020-10-21 20:55   ` 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   ` Alex Vandiver via GitGitGadget [this message]
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=ab9c330ca804eab6061d997bb5f216e48b199876.1603326066.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=alexmv@dropbox.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).