diff mbox series

[RFC,1/7] write-or-die.c: remove unused fsync_component() function

Message ID RFC-patch-1.7-e03c119c784-20220323T033928Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series bottom-up ns/batched-fsync & "plugging" in object-file.c | expand

Commit Message

Ævar Arnfjörð Bjarmason March 23, 2022, 3:47 a.m. UTC
This function added in 020406eaa52 (core.fsync: introduce granular
fsync control infrastructure, 2022-03-10) hasn't been used, and
appears not to be used by the follow-up series either?

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 cache.h        | 1 -
 write-or-die.c | 7 -------
 2 files changed, 8 deletions(-)

Comments

Neeraj Singh March 23, 2022, 5:27 a.m. UTC | #1
On Tue, Mar 22, 2022 at 8:48 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> This function added in 020406eaa52 (core.fsync: introduce granular
> fsync control infrastructure, 2022-03-10) hasn't been used, and
> appears not to be used by the follow-up series either?
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  cache.h        | 1 -
>  write-or-die.c | 7 -------
>  2 files changed, 8 deletions(-)
>
> diff --git a/cache.h b/cache.h
> index 84fafe2ed71..5d863f8c5e8 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -1766,7 +1766,6 @@ int copy_file_with_time(const char *dst, const char *src, int mode);
>
>  void write_or_die(int fd, const void *buf, size_t count);
>  void fsync_or_die(int fd, const char *);
> -int fsync_component(enum fsync_component component, int fd);
>  void fsync_component_or_die(enum fsync_component component, int fd, const char *msg);
>
>  static inline int batch_fsync_enabled(enum fsync_component component)
> diff --git a/write-or-die.c b/write-or-die.c
> index c4fd91b5b43..103698450c3 100644
> --- a/write-or-die.c
> +++ b/write-or-die.c
> @@ -76,13 +76,6 @@ void fsync_or_die(int fd, const char *msg)
>                 die_errno("fsync error on '%s'", msg);
>  }
>
> -int fsync_component(enum fsync_component component, int fd)
> -{
> -       if (fsync_components & component)
> -               return maybe_fsync(fd);
> -       return 0;
> -}
> -
>  void fsync_component_or_die(enum fsync_component component, int fd, const char *msg)
>  {
>         if (fsync_components & component)
> --
> 2.35.1.1428.g1c1a0152d61
>

This helper was put in for Patrick's patch at
https://lore.kernel.org/git/f1e8a7bb3bf0f4c0414819cb1d5579dc08fd2a4f.1646905589.git.ps@pks.im/.

Thanks,
Neeraj
diff mbox series

Patch

diff --git a/cache.h b/cache.h
index 84fafe2ed71..5d863f8c5e8 100644
--- a/cache.h
+++ b/cache.h
@@ -1766,7 +1766,6 @@  int copy_file_with_time(const char *dst, const char *src, int mode);
 
 void write_or_die(int fd, const void *buf, size_t count);
 void fsync_or_die(int fd, const char *);
-int fsync_component(enum fsync_component component, int fd);
 void fsync_component_or_die(enum fsync_component component, int fd, const char *msg);
 
 static inline int batch_fsync_enabled(enum fsync_component component)
diff --git a/write-or-die.c b/write-or-die.c
index c4fd91b5b43..103698450c3 100644
--- a/write-or-die.c
+++ b/write-or-die.c
@@ -76,13 +76,6 @@  void fsync_or_die(int fd, const char *msg)
 		die_errno("fsync error on '%s'", msg);
 }
 
-int fsync_component(enum fsync_component component, int fd)
-{
-	if (fsync_components & component)
-		return maybe_fsync(fd);
-	return 0;
-}
-
 void fsync_component_or_die(enum fsync_component component, int fd, const char *msg)
 {
 	if (fsync_components & component)