mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-26 19:51:32 +00:00
mkfs.f2fs: add casefolding and project quota config
This can be used for Android build support. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
ec0f3c910e
commit
3aef9bc820
@ -1527,6 +1527,7 @@ extern const struct f2fs_nls_table *f2fs_load_nls_table(int encoding);
|
||||
#define F2FS_ENC_UTF8_12_0 1
|
||||
|
||||
extern int f2fs_str2encoding(const char *string);
|
||||
extern char *f2fs_encoding2str(const int encoding);
|
||||
extern int f2fs_get_encoding_flags(int encoding);
|
||||
extern int f2fs_str2encoding_flags(char **param, __u16 *flags);
|
||||
|
||||
|
@ -1306,6 +1306,17 @@ int f2fs_str2encoding(const char *string)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
char *f2fs_encoding2str(const int encoding)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0 ; i < ARRAY_SIZE(f2fs_encoding_map); i++)
|
||||
if (f2fs_encoding_map[i].encoding_magic == encoding)
|
||||
return f2fs_encoding_map[i].name;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int f2fs_get_encoding_flags(int encoding)
|
||||
{
|
||||
int i;
|
||||
|
@ -89,6 +89,12 @@ static void f2fs_show_info()
|
||||
|
||||
if (c.defset == CONF_ANDROID)
|
||||
MSG(0, "Info: Set conf for android\n");
|
||||
|
||||
if (c.feature & le32_to_cpu(F2FS_FEATURE_CASEFOLD))
|
||||
MSG(0, "Info: Enable %s with casefolding\n",
|
||||
f2fs_encoding2str(c.s_encoding));
|
||||
if (c.feature & le32_to_cpu(F2FS_FEATURE_PRJQUOTA))
|
||||
MSG(0, "Info: Enable Project quota\n");
|
||||
}
|
||||
|
||||
static void add_default_options(void)
|
||||
@ -105,6 +111,14 @@ static void add_default_options(void)
|
||||
c.root_uid = c.root_gid = 0;
|
||||
break;
|
||||
}
|
||||
#ifdef CONF_CASEFOLD
|
||||
c.s_encoding = F2FS_ENC_UTF8_12_1;
|
||||
c.feature |= cpu_to_le32(F2FS_FEATURE_CASEFOLD);
|
||||
#endif
|
||||
#ifdef CONF_PROJID
|
||||
c.feature |= cpu_to_le32(F2FS_FEATURE_PRJQUOTA);
|
||||
c.feature |= cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void f2fs_parse_options(int argc, char *argv[])
|
||||
|
Loading…
Reference in New Issue
Block a user