Skip to content

Commit d987f62

Browse files
committed
Merge tag 'udf_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull udf updates from Jan Kara: "UDF support for UTF-16 characters in file names" * tag 'udf_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Add support for decoding UTF-16 characters udf: Add support for encoding UTF-16 characters udf: Push sb argument to udf_name_[to|from]_CS0() udf: Convert ident strings to proper charset udf: Use UTF-32 <-> UTF-8 conversion functions from NLS udf: Always require NLS support
2 parents 091a0f2 + 8a0cdef commit d987f62

File tree

4 files changed

+131
-150
lines changed

4 files changed

+131
-150
lines changed

fs/udf/Kconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config UDF_FS
22
tristate "UDF file system support"
33
select CRC_ITU_T
4+
select NLS
45
help
56
This is a file system used on some CD-ROMs and DVDs. Since the
67
file system is supported by multiple operating systems and is more
@@ -13,8 +14,3 @@ config UDF_FS
1314
module will be called udf.
1415

1516
If unsure, say N.
16-
17-
config UDF_NLS
18-
bool
19-
default y
20-
depends on (UDF_FS=m && NLS) || (UDF_FS=y && NLS=y)

fs/udf/super.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
572572
case Opt_utf8:
573573
uopt->flags |= (1 << UDF_FLAG_UTF8);
574574
break;
575-
#ifdef CONFIG_UDF_NLS
576575
case Opt_iocharset:
577576
if (!remount) {
578577
if (uopt->nls_map)
@@ -581,7 +580,6 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
581580
uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
582581
}
583582
break;
584-
#endif
585583
case Opt_uforget:
586584
uopt->flags |= (1 << UDF_FLAG_UID_FORGET);
587585
break;
@@ -892,14 +890,14 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
892890
#endif
893891
}
894892

895-
ret = udf_dstrCS0toUTF8(outstr, 31, pvoldesc->volIdent, 32);
893+
ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32);
896894
if (ret < 0)
897895
goto out_bh;
898896

899897
strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret);
900898
udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident);
901899

902-
ret = udf_dstrCS0toUTF8(outstr, 127, pvoldesc->volSetIdent, 128);
900+
ret = udf_dstrCS0toChar(sb, outstr, 127, pvoldesc->volSetIdent, 128);
903901
if (ret < 0)
904902
goto out_bh;
905903

@@ -2117,15 +2115,13 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
21172115
udf_err(sb, "utf8 cannot be combined with iocharset\n");
21182116
goto parse_options_failure;
21192117
}
2120-
#ifdef CONFIG_UDF_NLS
21212118
if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map) {
21222119
uopt.nls_map = load_nls_default();
21232120
if (!uopt.nls_map)
21242121
uopt.flags &= ~(1 << UDF_FLAG_NLS_MAP);
21252122
else
21262123
udf_debug("Using default NLS map\n");
21272124
}
2128-
#endif
21292125
if (!(uopt.flags & (1 << UDF_FLAG_NLS_MAP)))
21302126
uopt.flags |= (1 << UDF_FLAG_UTF8);
21312127

@@ -2279,10 +2275,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
22792275
error_out:
22802276
iput(sbi->s_vat_inode);
22812277
parse_options_failure:
2282-
#ifdef CONFIG_UDF_NLS
22832278
if (uopt.nls_map)
22842279
unload_nls(uopt.nls_map);
2285-
#endif
22862280
if (lvid_open)
22872281
udf_close_lvid(sb);
22882282
brelse(sbi->s_lvid_bh);
@@ -2332,10 +2326,8 @@ static void udf_put_super(struct super_block *sb)
23322326
sbi = UDF_SB(sb);
23332327

23342328
iput(sbi->s_vat_inode);
2335-
#ifdef CONFIG_UDF_NLS
23362329
if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
23372330
unload_nls(sbi->s_nls_map);
2338-
#endif
23392331
if (!sb_rdonly(sb))
23402332
udf_close_lvid(sb);
23412333
brelse(sbi->s_lvid_bh);

fs/udf/udfdecl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ extern int udf_get_filename(struct super_block *, const uint8_t *, int,
220220
uint8_t *, int);
221221
extern int udf_put_filename(struct super_block *, const uint8_t *, int,
222222
uint8_t *, int);
223-
extern int udf_dstrCS0toUTF8(uint8_t *, int, const uint8_t *, int);
223+
extern int udf_dstrCS0toChar(struct super_block *, uint8_t *, int,
224+
const uint8_t *, int);
224225

225226
/* ialloc.c */
226227
extern void udf_free_inode(struct inode *);

0 commit comments

Comments
 (0)