[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOQ4uxjKoBbyUNR=1yOdb2fy9iZjReWkF7y7nmFivXORH1F=gQ@mail.gmail.com>
Date: Thu, 14 Aug 2025 14:18:03 +0200
From: Amir Goldstein <amir73il@...il.com>
To: André Almeida <andrealmeid@...lia.com>
Cc: Miklos Szeredi <miklos@...redi.hu>, Theodore Tso <tytso@....edu>,
Gabriel Krisman Bertazi <krisman@...nel.org>, linux-unionfs@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
kernel-dev@...lia.com
Subject: Re: [PATCH v4 2/9] fs: Create new helper sb_encoding()
On Thu, Aug 14, 2025 at 12:37 AM André Almeida <andrealmeid@...lia.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@...il.com>
> Signed-off-by: André Almeida <andrealmeid@...lia.com>
Reviewed-by: Amir Goldstein <amir73il@...il.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
>
Powered by blists - more mailing lists