From patchwork Tue Apr 17 12:55:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 10344969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F49360216 for ; Tue, 17 Apr 2018 12:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82EF9286B6 for ; Tue, 17 Apr 2018 12:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7764B28A91; Tue, 17 Apr 2018 12:55:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C843286B6 for ; Tue, 17 Apr 2018 12:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbeDQMzt (ORCPT ); Tue, 17 Apr 2018 08:55:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:43690 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753280AbeDQMzj (ORCPT ); Tue, 17 Apr 2018 08:55:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9BC65AF6E; Tue, 17 Apr 2018 12:55:37 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7B3771E09FD; Tue, 17 Apr 2018 14:55:36 +0200 (CEST) From: Jan Kara To: Cc: Andrew Gabbasov , arthur200126@gmail.com, Jan Kara Subject: [PATCH 2/7] udf: Always require NLS support Date: Tue, 17 Apr 2018 14:55:24 +0200 Message-Id: <20180417125529.6975-3-jack@suse.cz> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180417125529.6975-1-jack@suse.cz> References: <20180417125529.6975-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP UDF needs to convert strings between OSTA CS0 charset and standard UTF8. Currently we implement our own utf-16 <-> utf-8 translations which is unnecessary code duplication. Always select NLS so that we can use translation functions from there. Signed-off-by: Jan Kara --- fs/udf/Kconfig | 6 +----- fs/udf/super.c | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/fs/udf/Kconfig b/fs/udf/Kconfig index c6e17a744c3b..aa415054ad0a 100644 --- a/fs/udf/Kconfig +++ b/fs/udf/Kconfig @@ -1,6 +1,7 @@ config UDF_FS tristate "UDF file system support" select CRC_ITU_T + select NLS help This is a file system used on some CD-ROMs and DVDs. Since the file system is supported by multiple operating systems and is more @@ -13,8 +14,3 @@ config UDF_FS module will be called udf. If unsure, say N. - -config UDF_NLS - bool - default y - depends on (UDF_FS=m && NLS) || (UDF_FS=y && NLS=y) diff --git a/fs/udf/super.c b/fs/udf/super.c index 7949c338efa5..37d2565a7f78 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -572,7 +572,6 @@ static int udf_parse_options(char *options, struct udf_options *uopt, case Opt_utf8: uopt->flags |= (1 << UDF_FLAG_UTF8); break; -#ifdef CONFIG_UDF_NLS case Opt_iocharset: if (!remount) { if (uopt->nls_map) @@ -581,7 +580,6 @@ static int udf_parse_options(char *options, struct udf_options *uopt, uopt->flags |= (1 << UDF_FLAG_NLS_MAP); } break; -#endif case Opt_uforget: uopt->flags |= (1 << UDF_FLAG_UID_FORGET); break; @@ -2117,7 +2115,6 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) udf_err(sb, "utf8 cannot be combined with iocharset\n"); goto parse_options_failure; } -#ifdef CONFIG_UDF_NLS if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map) { uopt.nls_map = load_nls_default(); if (!uopt.nls_map) @@ -2125,7 +2122,6 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) else udf_debug("Using default NLS map\n"); } -#endif if (!(uopt.flags & (1 << UDF_FLAG_NLS_MAP))) uopt.flags |= (1 << UDF_FLAG_UTF8); @@ -2279,10 +2275,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) error_out: iput(sbi->s_vat_inode); parse_options_failure: -#ifdef CONFIG_UDF_NLS if (uopt.nls_map) unload_nls(uopt.nls_map); -#endif if (lvid_open) udf_close_lvid(sb); brelse(sbi->s_lvid_bh); @@ -2332,10 +2326,8 @@ static void udf_put_super(struct super_block *sb) sbi = UDF_SB(sb); iput(sbi->s_vat_inode); -#ifdef CONFIG_UDF_NLS if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP)) unload_nls(sbi->s_nls_map); -#endif if (!sb_rdonly(sb)) udf_close_lvid(sb); brelse(sbi->s_lvid_bh);