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


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to