linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>, Theodore Tso <tytso@mit.edu>,
	 Gabriel Krisman Bertazi <krisman@kernel.org>,
	linux-unionfs@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	 kernel-dev@igalia.com
Subject: Re: [PATCH v4 2/9] fs: Create new helper sb_encoding()
Date: Thu, 14 Aug 2025 14:18:03 +0200	[thread overview]
Message-ID: <CAOQ4uxjKoBbyUNR=1yOdb2fy9iZjReWkF7y7nmFivXORH1F=gQ@mail.gmail.com> (raw)
In-Reply-To: <20250813-tonyk-overlayfs-v4-2-357ccf2e12ad@igalia.com>

On Thu, Aug 14, 2025 at 12:37 AM André Almeida <andrealmeid@igalia.com> wrote:
>
> Filesystems that need to deal with the super block encoding need to use
> a if IS_ENABLED(CONFIG_UNICODE) around it because this struct member is
> not declared otherwise. In order to move this if/endif guards outside of
> the filesytem code and make it simpler, create a new function that
> returns the s_encoding member of struct super_block if Unicode is
> enabled, and return NULL otherwise.
>
> Suggested-by: Amir Goldstein <amir73il@gmail.com>
> Signed-off-by: André Almeida <andrealmeid@igalia.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Andre,

I know I suggested starting the series with ofs->casefold patch,
but I meant the ovl patches series.

The two vfs helper patches should come before the ovl patches,
because Christian might prefer to carry them separately via vfs tree.

Thanks,
Amir.

> ---
> Changes from v3:
> - New patch
> ---
>  include/linux/fs.h | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 796319914b0a063642c2bd0c0140697a0eb651f6..20102d81e18a59d5daaed06855d1f168979b4fa7 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -3739,15 +3739,20 @@ static inline bool generic_ci_validate_strict_name(struct inode *dir, struct qst
>  }
>  #endif
>
> -static inline bool sb_has_encoding(const struct super_block *sb)
> +static inline struct unicode_map *sb_encoding(const struct super_block *sb)
>  {
>  #if IS_ENABLED(CONFIG_UNICODE)
> -       return !!sb->s_encoding;
> +       return sb->s_encoding;
>  #else
> -       return false;
> +       return NULL;
>  #endif
>  }
>
> +static inline bool sb_has_encoding(const struct super_block *sb)
> +{
> +       return !!sb_encoding(sb);
> +}
> +
>  int may_setattr(struct mnt_idmap *idmap, struct inode *inode,
>                 unsigned int ia_valid);
>  int setattr_prepare(struct mnt_idmap *, struct dentry *, struct iattr *);
>
> --
> 2.50.1
>

  reply	other threads:[~2025-08-14 12:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 22:36 [PATCH v4 0/9] ovl: Enable support for casefold filesystems André Almeida
2025-08-13 22:36 ` [PATCH v4 1/9] ovl: Support mounting case-insensitive enabled filesystems André Almeida
2025-08-14  8:35   ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 2/9] fs: Create new helper sb_encoding() André Almeida
2025-08-14 12:18   ` Amir Goldstein [this message]
2025-08-13 22:36 ` [PATCH v4 3/9] ovl: Create ovl_casefold() to support casefolded strncmp() André Almeida
2025-08-14 12:53   ` Amir Goldstein
2025-08-14 13:02     ` André Almeida
2025-08-14 13:20       ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 4/9] fs: Create sb_same_encoding() helper André Almeida
2025-08-14 12:19   ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 5/9] ovl: Ensure that all layers have the same encoding André Almeida
2025-08-14 12:56   ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 6/9] ovl: Set case-insensitive dentry operations for ovl sb André Almeida
2025-08-14 12:57   ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 7/9] ovl: Add S_CASEFOLD as part of the inode flag to be copied André Almeida
2025-08-14 13:00   ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 8/9] ovl: Check for casefold consistency when creating new dentries André Almeida
2025-08-14 13:06   ` Amir Goldstein
2025-08-13 22:36 ` [PATCH v4 9/9] ovl: Allow case-insensitive lookup André Almeida
2025-08-14  8:44   ` Amir Goldstein

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='CAOQ4uxjKoBbyUNR=1yOdb2fy9iZjReWkF7y7nmFivXORH1F=gQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=andrealmeid@igalia.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=kernel-dev@igalia.com \
    --cc=krisman@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).