Re: [RFC PATCH 2/4] mm: shmem: Support case-insensitive file name lookups

From: André Almeida
Date: Wed Mar 24 2021 - 16:18:22 EST


Às 17:18 de 23/03/21, Gabriel Krisman Bertazi escreveu:
André Almeida <andrealmeid@xxxxxxxxxxxxx> writes:
opt = fs_parse(fc, shmem_fs_parameters, param, &result);
if (opt < 0)
@@ -3468,6 +3519,23 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
ctx->full_inums = true;
ctx->seen |= SHMEM_SEEN_INUMS;
break;
+ case Opt_casefold:
+ if (strncmp(param->string, "utf8-", 5))
+ return invalfc(fc, "Only utf8 encondings are supported");
+ ret = strscpy(version, param->string + 5, sizeof(version));

Ugh. Now we are doing two strscpy for the parse api (in unicode_load).
Can change the unicode_load api to reuse it?


So instead of getting just the version number (e.g. "12.1.0") as parameter, utf8_load/unicode_load would get the full encoding string (e.g. "utf8-12.1.0") right?