Re: [PATCH v4 10/10] f2fs: Move CONFIG_UNICODE defguards into the code flow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 11, 2022 at 03:31:46PM -0400, Gabriel Krisman Bertazi wrote:
> @@ -293,10 +294,6 @@ static void f2fs_destroy_casefold_cache(void)
>  {
>  	kmem_cache_destroy(f2fs_cf_name_slab);
>  }
> -#else
> -static int __init f2fs_create_casefold_cache(void) { return 0; }
> -static void f2fs_destroy_casefold_cache(void) { }
> -#endif
[...]
> @@ -4611,7 +4608,10 @@ static int __init init_f2fs_fs(void)
>  	err = f2fs_init_compress_cache();
>  	if (err)
>  		goto free_compress_mempool;
> -	err = f2fs_create_casefold_cache();
> +
> +	if (IS_ENABLED(CONFIG_UNICODE))
> +		err = f2fs_create_casefold_cache();
> +
>  	if (err)
>  		goto free_compress_cache;
>  	return 0;
> @@ -4654,7 +4654,9 @@ static int __init init_f2fs_fs(void)
>  
>  static void __exit exit_f2fs_fs(void)
>  {
> -	f2fs_destroy_casefold_cache();
> +	if (IS_ENABLED(CONFIG_UNICODE))
> +		f2fs_destroy_casefold_cache();
> +

I don't think the above two changes are actually an improvement.  It's cleaner
to use stub functions to keep the callers simpler, as the original code did.

- Eric



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux