2021-03-24 07:24:58

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [RFC PATCH 1/4] Revert "libfs: unexport generic_ci_d_compare() and generic_ci_d_hash()"

On Tue, Mar 23, 2021 at 04:59:38PM -0300, Andr? Almeida wrote:
> This reverts commit 794c43f716845e2d48ce195ed5c4179a4e05ce5f.
>
> For implementing casefolding support at tmpfs, it needs to set dentry
> operations at superblock level, given that tmpfs has no support for
> fscrypt and we don't need to set operations on a per-dentry basis.
> Revert this commit so we can access those exported function from tmpfs
> code.

But tmpfs / shmem are Kconfig bools, not tristate. They can't be built
as modules, so there's no need to export the symbols.

> +#ifdef CONFIG_UNICODE
> +extern int generic_ci_d_hash(const struct dentry *dentry, struct qstr *str);
> +extern int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
> + const char *str, const struct qstr *name);
> +#endif

There's no need for the ifdef (it only causes unnecessary rebuilds) and
the 'extern' keyword is also unwelcome.


2021-03-24 20:17:38

by André Almeida

[permalink] [raw]
Subject: Re: [RFC PATCH 1/4] Revert "libfs: unexport generic_ci_d_compare() and generic_ci_d_hash()"

Hi Matthew,

Às 17:15 de 23/03/21, Matthew Wilcox escreveu:
> On Tue, Mar 23, 2021 at 04:59:38PM -0300, André Almeida wrote:
>> This reverts commit 794c43f716845e2d48ce195ed5c4179a4e05ce5f.
>>
>> For implementing casefolding support at tmpfs, it needs to set dentry
>> operations at superblock level, given that tmpfs has no support for
>> fscrypt and we don't need to set operations on a per-dentry basis.
>> Revert this commit so we can access those exported function from tmpfs
>> code.
>
> But tmpfs / shmem are Kconfig bools, not tristate. They can't be built
> as modules, so there's no need to export the symbols.
>
>> +#ifdef CONFIG_UNICODE
>> +extern int generic_ci_d_hash(const struct dentry *dentry, struct qstr *str);
>> +extern int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
>> + const char *str, const struct qstr *name);
>> +#endif
>
> There's no need for the ifdef (it only causes unnecessary rebuilds) and
> the 'extern' keyword is also unwelcome.
>

Thank you. Instead of reverting the commit, I'll do a new commit doing
this in a properly way.