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

Re: [PATCH 2/7] fsmonitor: determine if filesystem is local or remote

From
Jean-Noël Avila <avila.jn@gmail.com>
Date
Feb 15, 2024, 11:24 UTC
Message-ID
<3e3d733f-d7d7-4dee-9ee9-d52ea215b36f@gmail.com>
In-Reply-To
<d26de10866662a5bcd16d562cd1063dedd21cf02.1707992978.git.gitgitgadget@gmail.com>
Hello,
Le 15/02/2024 à 11:29, Eric DeCosta via GitGitGadget a écrit :
Show 54 quoted lines
> 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
Previous: Eric DeCosta via GitGitGadgetNext: Patrick Steinhardt
Message 5 of 14 in “fsmonitor: completing a stale patch that Implements fsmonitor for Linux”
  1. 0/7 fsmonitor: completing a stale patch that Implements fsmonitor for Linuxmarzi via GitGitGadget, Feb 15, 2024
  2. 1/7 fsmonitor: rebase with masterEric DeCosta via GitGitGadget, Feb 15, 2024
  3. Patrick SteinhardtFeb 15, 2024
  4. 2/7 fsmonitor: determine if filesystem is local or remoteEric DeCosta via GitGitGadget, Feb 15, 2024
  5. Jean-Noël AvilaFeb 15, 2024
  6. Patrick SteinhardtFeb 15, 2024
  7. 3/7 fsmonitor: implement filesystem change listener for LinuxEric DeCosta via GitGitGadget, Feb 15, 2024
  8. Patrick SteinhardtFeb 15, 2024
  9. 4/7 fsmonitor: enable fsmonitor for LinuxEric DeCosta via GitGitGadget, Feb 15, 2024
  10. 5/7 fsmonitor: test updatesEric DeCosta via GitGitGadget, Feb 15, 2024
  11. 6/7 fsmonitor: update doc for LinuxEric DeCosta via GitGitGadget, Feb 15, 2024
  12. 7/7 fsmonitor: addressed comments for patch 1352marzi.esipreh via GitGitGadget, Feb 15, 2024
  13. Patrick SteinhardtFeb 15, 2024
  14. 0/7 fsmonitor: completing a stale patch that Implements fsmonitor for LinuxManoraj K, Jan 31, 2025

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.