From: "Jean-Noël Avila" <avila.jn@gmail.com>
To: Eric DeCosta via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Cc: "Eric Sunshine [ ]" <sunshine@sunshineco.com>,
"Ævar Arnfjörð Bjarmason [ ]" <avarab@gmail.com>,
"Glen Choo [ ]" <chooglen@google.com>,
"Johannes Schindelin [ ]" <Johannes.Schindelin@gmx.de>,
"Taylor Blau [ ]" <me@ttaylorr.com>, marzi <m.ispare63@gmail.com>,
"Eric DeCosta" <edecosta@mathworks.com>
Subject: Re: [PATCH 2/7] fsmonitor: determine if filesystem is local or remote
Date: Thu, 15 Feb 2024 12:24:39 +0100 [thread overview]
Message-ID: <3e3d733f-d7d7-4dee-9ee9-d52ea215b36f@gmail.com> (raw)
In-Reply-To: <d26de10866662a5bcd16d562cd1063dedd21cf02.1707992978.git.gitgitgadget@gmail.com>
Hello,
Le 15/02/2024 à 11:29, Eric DeCosta via GitGitGadget a écrit :
> From: Eric DeCosta <edecosta@mathworks.com>
>
> Compare the given path to the mounted filesystems. Find the mount that is
> the longest prefix of the path (if any) and determine if that mount is on a
> local or remote filesystem.
>
> Signed-off-by: Eric DeCosta <edecosta@mathworks.com>
> ---
> Makefile | 4 +
> compat/fsmonitor/fsm-path-utils-linux.c | 195 ++++++++++++++++++++++++
> compat/fsmonitor/fsm-path-utils-linux.h | 91 +++++++++++
> config.mak.uname | 11 ++
> 4 files changed, 301 insertions(+)
> create mode 100644 compat/fsmonitor/fsm-path-utils-linux.c
> create mode 100644 compat/fsmonitor/fsm-path-utils-linux.h
>
> diff --git a/Makefile b/Makefile
> index 78e874099d9..0f36a0fd83a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2088,6 +2088,10 @@ ifdef HAVE_CLOCK_GETTIME
> BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
> endif
>
> +ifdef HAVE_LINUX_MAGIC_H
> + BASIC_CFLAGS += -DHAVE_LINUX_MAGIC_H
> +endif
> +
> ifdef HAVE_CLOCK_MONOTONIC
> BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC
> endif
> diff --git a/compat/fsmonitor/fsm-path-utils-linux.c b/compat/fsmonitor/fsm-path-utils-linux.c
> new file mode 100644
> index 00000000000..c21d1349532
> --- /dev/null
> +++ b/compat/fsmonitor/fsm-path-utils-linux.c
> @@ -0,0 +1,195 @@
> +#include "git-compat-util.h"
> +#include "abspath.h"
> +#include "fsmonitor.h"
> +#include "fsmonitor-path-utils.h"
> +#include "fsm-path-utils-linux.h"
> +#include <errno.h>
> +#include <mntent.h>
> +#include <sys/mount.h>
> +#include <sys/vfs.h>
> +#include <sys/statvfs.h>
> +
> +static int is_remote_fs(const char *path)
> +{
> + struct statfs fs;
> +
> + if (statfs(path, &fs))
> + return error_errno(_("statfs('%s') failed"), path);
For the sake of simplifying of the work of translators, would it be wise
to change this to
+ if (statfs(path, &fs))
+ /* TRANSLATORS: %s('%s') is a libc function call */
+ return error_errno(_("%s('%s') failed"), "statfs", + path);
and generalize this to all other messages?
Thanks,
JN
next prev parent reply other threads:[~2024-02-15 11:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 10:29 [PATCH 0/7] fsmonitor: completing a stale patch that Implements fsmonitor for Linux marzi via GitGitGadget
2024-02-15 10:29 ` [PATCH 1/7] fsmonitor: rebase with master Eric DeCosta via GitGitGadget
2024-02-15 13:49 ` Patrick Steinhardt
2024-02-15 10:29 ` [PATCH 2/7] fsmonitor: determine if filesystem is local or remote Eric DeCosta via GitGitGadget
2024-02-15 11:24 ` Jean-Noël Avila [this message]
2024-02-15 13:49 ` Patrick Steinhardt
2024-02-15 10:29 ` [PATCH 3/7] fsmonitor: implement filesystem change listener for Linux Eric DeCosta via GitGitGadget
2024-02-15 13:49 ` Patrick Steinhardt
2024-02-15 10:29 ` [PATCH 4/7] fsmonitor: enable fsmonitor " Eric DeCosta via GitGitGadget
2024-02-15 10:29 ` [PATCH 5/7] fsmonitor: test updates Eric DeCosta via GitGitGadget
2024-02-15 10:29 ` [PATCH 6/7] fsmonitor: update doc for Linux Eric DeCosta via GitGitGadget
2024-02-15 10:29 ` [PATCH 7/7] fsmonitor: addressed comments for patch 1352 marzi.esipreh via GitGitGadget
2024-02-15 13:49 ` Patrick Steinhardt
2025-01-31 3:28 ` [PATCH 0/7] fsmonitor: completing a stale patch that Implements fsmonitor for Linux Manoraj K
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=3e3d733f-d7d7-4dee-9ee9-d52ea215b36f@gmail.com \
--to=avila.jn@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=avarab@gmail.com \
--cc=chooglen@google.com \
--cc=edecosta@mathworks.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=m.ispare63@gmail.com \
--cc=me@ttaylorr.com \
--cc=sunshine@sunshineco.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.