Skip to content

Commit 101c3fa

Browse files
committed
libfs: Drop generic_set_encrypted_ci_d_ops
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive capable filesystems, it should be propagated through ->s_d_op. Reviewed-by: Eric Biggers <ebiggers@google.com> Link: https://lore.kernel.org/r/20240221171412.10710-11-krisman@suse.de Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
1 parent bc401c2 commit 101c3fa

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

fs/libfs.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,40 +1784,6 @@ static const struct dentry_operations generic_encrypted_dentry_ops = {
17841784
};
17851785
#endif
17861786

1787-
/**
1788-
* generic_set_encrypted_ci_d_ops - helper for setting d_ops for given dentry
1789-
* @dentry: dentry to set ops on
1790-
*
1791-
* Casefolded directories need d_hash and d_compare set, so that the dentries
1792-
* contained in them are handled case-insensitively. Note that these operations
1793-
* are needed on the parent directory rather than on the dentries in it, and
1794-
* while the casefolding flag can be toggled on and off on an empty directory,
1795-
* dentry_operations can't be changed later. As a result, if the filesystem has
1796-
* casefolding support enabled at all, we have to give all dentries the
1797-
* casefolding operations even if their inode doesn't have the casefolding flag
1798-
* currently (and thus the casefolding ops would be no-ops for now).
1799-
*
1800-
* Encryption works differently in that the only dentry operation it needs is
1801-
* d_revalidate, which it only needs on dentries that have the no-key name flag.
1802-
* The no-key flag can't be set "later", so we don't have to worry about that.
1803-
*/
1804-
void generic_set_encrypted_ci_d_ops(struct dentry *dentry)
1805-
{
1806-
#if IS_ENABLED(CONFIG_UNICODE)
1807-
if (dentry->d_sb->s_encoding) {
1808-
d_set_d_op(dentry, &generic_ci_dentry_ops);
1809-
return;
1810-
}
1811-
#endif
1812-
#ifdef CONFIG_FS_ENCRYPTION
1813-
if (dentry->d_flags & DCACHE_NOKEY_NAME) {
1814-
d_set_d_op(dentry, &generic_encrypted_dentry_ops);
1815-
return;
1816-
}
1817-
#endif
1818-
}
1819-
EXPORT_SYMBOL(generic_set_encrypted_ci_d_ops);
1820-
18211787
/**
18221788
* generic_set_sb_d_ops - helper for choosing the set of
18231789
* filesystem-wide dentry operations for the enabled features

include/linux/fs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,6 @@ extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
32803280

32813281
extern int generic_check_addressable(unsigned, u64);
32823282

3283-
extern void generic_set_encrypted_ci_d_ops(struct dentry *dentry);
32843283
extern void generic_set_sb_d_ops(struct super_block *sb);
32853284

32863285
static inline bool sb_has_encoding(const struct super_block *sb)

0 commit comments

Comments
 (0)