Re: [f2fs-dev] [PATCH] f2fs: introduce cf_name_slab cache

From: Eric Biggers
Date: Mon Jun 07 2021 - 19:47:46 EST


On Tue, Jun 08, 2021 at 07:27:15AM +0800, Chao Yu wrote:
> From: Chao Yu <yuchao0@xxxxxxxxxx>
>
> Add a slab cache: "f2fs_casefold_name_entry" for memory allocation
> of casefold name.
>
> Signed-off-by: Chao Yu <yuchao0@xxxxxxxxxx>
> ---
> fs/f2fs/dir.c | 16 ++++++++++------
> fs/f2fs/recovery.c | 6 +++++-
> fs/f2fs/super.c | 24 ++++++++++++++++++++++++
> 3 files changed, 39 insertions(+), 7 deletions(-)

Looks good, but "f2fs_casefolded_name" would be a better name for this cache.

"f2fs_casefold_name_entry" makes it sounds like it contains some bookkeeping
information and not the actual casefolded filenames.

>
> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
> index 96dcc4aca639..ee400562157d 100644
> --- a/fs/f2fs/dir.c
> +++ b/fs/f2fs/dir.c
> @@ -16,6 +16,10 @@
> #include "xattr.h"
> #include <trace/events/f2fs.h>
>
> +#ifdef CONFIG_UNICODE
> +extern struct kmem_cache *cf_name_slab;
> +#endif

Also this variable needs to be prefixed with "f2fs_". Otherwise this will cause
a build error if/when ext4 adds the same thing.

- Eric