From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C12F6C433FE for ; Thu, 19 May 2022 01:41:42 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nrVAd-0007cn-KP; Thu, 19 May 2022 01:41:42 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nrVAc-0007cY-80 for linux-f2fs-devel@lists.sourceforge.net; Thu, 19 May 2022 01:41:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8tCoJ/dSB2Ue2RsEwrMKt7QEF8ASr9sl2Eccv3XzWOM=; b=BpCtHrZdbhnIzeSk8I4qfV3CzS /uV+6jqeiq1Tgl7iX/MiDBqoa2+I75kQsTi7IYeln6JvBBaAMKdScwyO9W9nFwAweKpFrWv7ixlXU /rlmk+j5TswUL6powogDNHkfF3HoH2SHJD5DkfGmA+v2TvyZiab0Qn3UM+RHvxYCbGWc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8tCoJ/dSB2Ue2RsEwrMKt7QEF8ASr9sl2Eccv3XzWOM=; b=V8E7lBToSfzoO664vg+e6rtNgG vf7UMCWpre8GX1ut2cLUapkfQzMtEgAoOXuzE3gpnEp846vMysej3oMl3WX/epHVH5qr4IiNQRZaU klv03gjojPmz/UxxMD5/jL0j//nL2OCQZOKX3sXZQYDrjfrLzBe4qHW6S62DYxDTBbXw=; Received: from bhuna.collabora.co.uk ([46.235.227.227]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1nrVAZ-007ym2-T5 for linux-f2fs-devel@lists.sourceforge.net; Thu, 19 May 2022 01:41:40 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id D733B1F4542F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652924489; bh=lVxCi2vcBawXM+9LvQgMSIUjo3YYqafepE8JNRdl2/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AzdlUusccC7kY4mQcr7yY8vgR3r9vYijVlTfpyc7aQReTSLla8k9EJN8mTUkGnpms JoQ+fW7e5kcAxzRl+arsUrFu5LX54rJMoSg96r9MPVjQYTvT1UEcRHO6aPKqnFANv6 gzhkqGa4ptCpDJgbpuoAcb9e6wr1tZSAJbFdE6XzXQ6Vud74NiiEp1t7HdrsmvpBZC Rqy6EDezKEaKVEAcYS6ibMZQ2daZ39FCVhb6Idmat2jEtmr46QnbUoFwwuoDXSgcDk L8RTarv8e7jYyp8L6LLM6NGLGNt4I+g2U+V+qyFHv1vQ6IN+kYoFK8VIYUpaaMNh4G TIX4tLmX2Lb/A== From: Gabriel Krisman Bertazi To: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, ebiggers@kernel.org Date: Wed, 18 May 2022 21:40:44 -0400 Message-Id: <20220519014044.508099-9-krisman@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220519014044.508099-1-krisman@collabora.com> References: <20220519014044.508099-1-krisman@collabora.com> MIME-Version: 1.0 X-Headers-End: 1nrVAZ-007ym2-T5 Subject: [f2fs-dev] [PATCH v6 8/8] f2fs: Move CONFIG_UNICODE defguards into the code flow X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com, Eric Biggers , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Instead of a bunch of ifdefs, make the unicode built checks part of the code flow where possible, as requested by Torvalds. Reviewed-by: Eric Biggers Signed-off-by: Gabriel Krisman Bertazi --- Changes since v4: - Drop stub removal for !CONFIG_UNICODE case (eric) --- fs/f2fs/namei.c | 11 +++++------ fs/f2fs/super.c | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 5f213f05556d..8567a9045df1 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -561,8 +561,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, goto out_iput; } out_splice: -#if IS_ENABLED(CONFIG_UNICODE) - if (!inode && IS_CASEFOLDED(dir)) { + if (IS_ENABLED(CONFIG_UNICODE) && !inode && IS_CASEFOLDED(dir)) { /* Eventually we want to call d_add_ci(dentry, NULL) * for negative dentries in the encoding case as * well. For now, prevent the negative dentry @@ -571,7 +570,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, trace_f2fs_lookup_end(dir, dentry, ino, err); return NULL; } -#endif + new = d_splice_alias(inode, dentry); err = PTR_ERR_OR_ZERO(new); trace_f2fs_lookup_end(dir, dentry, ino, !new ? -ENOENT : err); @@ -622,16 +621,16 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) goto fail; } f2fs_delete_entry(de, page, dir, inode); -#if IS_ENABLED(CONFIG_UNICODE) + /* VFS negative dentries are incompatible with Encoding and * Case-insensitiveness. Eventually we'll want avoid * invalidating the dentries here, alongside with returning the * negative dentries at f2fs_lookup(), when it is better * supported by the VFS for the CI case. */ - if (IS_CASEFOLDED(dir)) + if (IS_ENABLED(CONFIG_UNICODE) && IS_CASEFOLDED(dir)) d_invalidate(dentry); -#endif + f2fs_unlock_op(sbi); if (IS_DIRSYNC(dir)) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index baefd398ec1a..b17bd7a70d53 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -283,7 +283,7 @@ struct kmem_cache *f2fs_cf_name_slab; static int __init f2fs_create_casefold_cache(void) { f2fs_cf_name_slab = f2fs_kmem_cache_create("f2fs_casefolded_name", - F2FS_NAME_LEN); + F2FS_NAME_LEN); if (!f2fs_cf_name_slab) return -ENOMEM; return 0; @@ -1259,13 +1259,13 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) return -EINVAL; } #endif -#if !IS_ENABLED(CONFIG_UNICODE) - if (f2fs_sb_has_casefold(sbi)) { + + if (!IS_ENABLED(CONFIG_UNICODE) && f2fs_sb_has_casefold(sbi)) { f2fs_err(sbi, "Filesystem with casefold feature cannot be mounted without CONFIG_UNICODE"); return -EINVAL; } -#endif + /* * The BLKZONED feature indicates that the drive was formatted with * zone alignment optimization. This is optional for host-aware -- 2.36.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel