From: Eugen Hristev <eugen.hristev@collabora.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, jaegeuk@kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@collabora.com, eugen.hristev@collabora.com, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, krisman@suse.de, ebiggers@kernel.org, Gabriel Krisman Bertazi <krisman@collabora.com> Subject: [PATCH v16 9/9] f2fs: Move CONFIG_UNICODE defguards into the code flow Date: Fri, 5 Apr 2024 15:13:32 +0300 [thread overview] Message-ID: <20240405121332.689228-10-eugen.hristev@collabora.com> (raw) In-Reply-To: <20240405121332.689228-1-eugen.hristev@collabora.com> From: Gabriel Krisman Bertazi <krisman@collabora.com> Instead of a bunch of ifdefs, make the unicode built checks part of the code flow where possible, as requested by Torvalds. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> [eugen.hristev@collabora.com: port to 6.8-rc3] Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com> --- fs/f2fs/namei.c | 10 ++++------ fs/f2fs/super.c | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index e54f8c08bda8..1ecde2b45e99 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -576,8 +576,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 @@ -586,7 +585,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); trace_f2fs_lookup_end(dir, !IS_ERR_OR_NULL(new) ? new : dentry, ino, IS_ERR(new) ? PTR_ERR(new) : err); @@ -639,16 +638,15 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) f2fs_delete_entry(de, page, dir, inode); f2fs_unlock_op(sbi); -#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 + if (IS_DIRSYNC(dir)) f2fs_sync_fs(sbi->sb, 1); fail: diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index a4bc26dfdb1a..68f3639d9b52 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -311,7 +311,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); return f2fs_cf_name_slab ? 0 : -ENOMEM; } @@ -1313,13 +1313,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.34.1
WARNING: multiple messages have this Message-ID (diff)
From: Eugen Hristev via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net> To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, jaegeuk@kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: krisman@suse.de, brauner@kernel.org, jack@suse.cz, linux-kernel@vger.kernel.org, eugen.hristev@collabora.com, ebiggers@kernel.org, viro@zeniv.linux.org.uk, kernel@collabora.com, Gabriel Krisman Bertazi <krisman@collabora.com> Subject: [f2fs-dev] [PATCH v16 9/9] f2fs: Move CONFIG_UNICODE defguards into the code flow Date: Fri, 5 Apr 2024 15:13:32 +0300 [thread overview] Message-ID: <20240405121332.689228-10-eugen.hristev@collabora.com> (raw) In-Reply-To: <20240405121332.689228-1-eugen.hristev@collabora.com> From: Gabriel Krisman Bertazi <krisman@collabora.com> Instead of a bunch of ifdefs, make the unicode built checks part of the code flow where possible, as requested by Torvalds. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> [eugen.hristev@collabora.com: port to 6.8-rc3] Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com> --- fs/f2fs/namei.c | 10 ++++------ fs/f2fs/super.c | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index e54f8c08bda8..1ecde2b45e99 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -576,8 +576,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 @@ -586,7 +585,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); trace_f2fs_lookup_end(dir, !IS_ERR_OR_NULL(new) ? new : dentry, ino, IS_ERR(new) ? PTR_ERR(new) : err); @@ -639,16 +638,15 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) f2fs_delete_entry(de, page, dir, inode); f2fs_unlock_op(sbi); -#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 + if (IS_DIRSYNC(dir)) f2fs_sync_fs(sbi->sb, 1); fail: diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index a4bc26dfdb1a..68f3639d9b52 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -311,7 +311,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); return f2fs_cf_name_slab ? 0 : -ENOMEM; } @@ -1313,13 +1313,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.34.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2024-04-05 12:14 UTC|newest] Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-05 12:13 [PATCH v16 0/9] Cache insensitive cleanup for ext4/f2fs Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-04-05 12:13 ` [PATCH v16 1/9] ext4: Simplify the handling of cached insensitive names Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:23 ` Eric Biggers 2024-05-10 1:23 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` [PATCH v16 2/9] f2fs: " Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:23 ` Eric Biggers 2024-05-10 1:23 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` [PATCH v16 3/9] libfs: Introduce case-insensitive string comparison helper Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:33 ` Eric Biggers 2024-05-10 1:33 ` [f2fs-dev] " Eric Biggers 2024-05-12 21:27 ` Gabriel Krisman Bertazi 2024-05-12 21:27 ` [f2fs-dev] " Gabriel Krisman Bertazi 2024-04-05 12:13 ` [PATCH v16 4/9] ext4: Reuse generic_ci_match for ci comparisons Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:23 ` Eric Biggers 2024-05-10 1:23 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` [PATCH v16 5/9] f2fs: " Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:24 ` Eric Biggers 2024-05-10 1:24 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` [PATCH v16 6/9] ext4: Log error when lookup of encoded dentry fails Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:24 ` Eric Biggers 2024-05-10 1:24 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` [PATCH v16 7/9] f2fs: " Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:25 ` Eric Biggers 2024-05-10 1:25 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` [PATCH v16 8/9] ext4: Move CONFIG_UNICODE defguards into the code flow Eugen Hristev 2024-04-05 12:13 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:25 ` Eric Biggers 2024-05-10 1:25 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:13 ` Eugen Hristev [this message] 2024-04-05 12:13 ` [f2fs-dev] [PATCH v16 9/9] f2fs: " Eugen Hristev via Linux-f2fs-devel 2024-05-10 1:25 ` Eric Biggers 2024-05-10 1:25 ` [f2fs-dev] " Eric Biggers 2024-04-05 12:18 ` [PATCH v16 0/9] Cache insensitive cleanup for ext4/f2fs Matthew Wilcox 2024-04-05 12:18 ` [f2fs-dev] " Matthew Wilcox 2024-04-05 13:02 ` Eugen Hristev 2024-04-05 13:02 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel 2024-04-05 16:37 ` Gabriel Krisman Bertazi 2024-04-05 16:37 ` [f2fs-dev] " Gabriel Krisman Bertazi 2024-05-09 15:12 ` Eugen Hristev 2024-05-09 15:12 ` [f2fs-dev] " Eugen Hristev via Linux-f2fs-devel
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240405121332.689228-10-eugen.hristev@collabora.com \ --to=eugen.hristev@collabora.com \ --cc=adilger.kernel@dilger.ca \ --cc=brauner@kernel.org \ --cc=chao@kernel.org \ --cc=ebiggers@kernel.org \ --cc=jack@suse.cz \ --cc=jaegeuk@kernel.org \ --cc=kernel@collabora.com \ --cc=krisman@collabora.com \ --cc=krisman@suse.de \ --cc=linux-ext4@vger.kernel.org \ --cc=linux-f2fs-devel@lists.sourceforge.net \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=tytso@mit.edu \ --cc=viro@zeniv.linux.org.uk \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.