libfs.c (87a0b2fafc09766d8c55461a18345a1cfb10a7fe) | libfs.c (5298d4bfe80f6ae6ae2777bcd1357b0022d98573) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * fs/libfs.c 4 * Library for filesystems writers. 5 */ 6 7#include <linux/blkdev.h> 8#include <linux/export.h> --- 1365 unchanged lines hidden (view full) --- 1374} 1375 1376bool is_empty_dir_inode(struct inode *inode) 1377{ 1378 return (inode->i_fop == &empty_dir_operations) && 1379 (inode->i_op == &empty_dir_inode_operations); 1380} 1381 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * fs/libfs.c 4 * Library for filesystems writers. 5 */ 6 7#include <linux/blkdev.h> 8#include <linux/export.h> --- 1365 unchanged lines hidden (view full) --- 1374} 1375 1376bool is_empty_dir_inode(struct inode *inode) 1377{ 1378 return (inode->i_fop == &empty_dir_operations) && 1379 (inode->i_op == &empty_dir_inode_operations); 1380} 1381 |
1382#ifdef CONFIG_UNICODE | 1382#if IS_ENABLED(CONFIG_UNICODE) |
1383/* 1384 * Determine if the name of a dentry should be casefolded. 1385 * 1386 * Return: if names will need casefolding 1387 */ 1388static bool needs_casefold(const struct inode *dir) 1389{ 1390 return IS_CASEFOLDED(dir) && dir->i_sb->s_encoding; --- 77 unchanged lines hidden (view full) --- 1468#endif 1469 1470#ifdef CONFIG_FS_ENCRYPTION 1471static const struct dentry_operations generic_encrypted_dentry_ops = { 1472 .d_revalidate = fscrypt_d_revalidate, 1473}; 1474#endif 1475 | 1383/* 1384 * Determine if the name of a dentry should be casefolded. 1385 * 1386 * Return: if names will need casefolding 1387 */ 1388static bool needs_casefold(const struct inode *dir) 1389{ 1390 return IS_CASEFOLDED(dir) && dir->i_sb->s_encoding; --- 77 unchanged lines hidden (view full) --- 1468#endif 1469 1470#ifdef CONFIG_FS_ENCRYPTION 1471static const struct dentry_operations generic_encrypted_dentry_ops = { 1472 .d_revalidate = fscrypt_d_revalidate, 1473}; 1474#endif 1475 |
1476#if defined(CONFIG_FS_ENCRYPTION) && defined(CONFIG_UNICODE) | 1476#if defined(CONFIG_FS_ENCRYPTION) && IS_ENABLED(CONFIG_UNICODE) |
1477static const struct dentry_operations generic_encrypted_ci_dentry_ops = { 1478 .d_hash = generic_ci_d_hash, 1479 .d_compare = generic_ci_d_compare, 1480 .d_revalidate = fscrypt_d_revalidate, 1481}; 1482#endif 1483 1484/** --- 18 unchanged lines hidden (view full) --- 1503 * performance hit, we use custom dentry_operations for each possible 1504 * combination rather than always installing all operations. 1505 */ 1506void generic_set_encrypted_ci_d_ops(struct dentry *dentry) 1507{ 1508#ifdef CONFIG_FS_ENCRYPTION 1509 bool needs_encrypt_ops = dentry->d_flags & DCACHE_NOKEY_NAME; 1510#endif | 1477static const struct dentry_operations generic_encrypted_ci_dentry_ops = { 1478 .d_hash = generic_ci_d_hash, 1479 .d_compare = generic_ci_d_compare, 1480 .d_revalidate = fscrypt_d_revalidate, 1481}; 1482#endif 1483 1484/** --- 18 unchanged lines hidden (view full) --- 1503 * performance hit, we use custom dentry_operations for each possible 1504 * combination rather than always installing all operations. 1505 */ 1506void generic_set_encrypted_ci_d_ops(struct dentry *dentry) 1507{ 1508#ifdef CONFIG_FS_ENCRYPTION 1509 bool needs_encrypt_ops = dentry->d_flags & DCACHE_NOKEY_NAME; 1510#endif |
1511#ifdef CONFIG_UNICODE | 1511#if IS_ENABLED(CONFIG_UNICODE) |
1512 bool needs_ci_ops = dentry->d_sb->s_encoding; 1513#endif | 1512 bool needs_ci_ops = dentry->d_sb->s_encoding; 1513#endif |
1514#if defined(CONFIG_FS_ENCRYPTION) && defined(CONFIG_UNICODE) | 1514#if defined(CONFIG_FS_ENCRYPTION) && IS_ENABLED(CONFIG_UNICODE) |
1515 if (needs_encrypt_ops && needs_ci_ops) { 1516 d_set_d_op(dentry, &generic_encrypted_ci_dentry_ops); 1517 return; 1518 } 1519#endif 1520#ifdef CONFIG_FS_ENCRYPTION 1521 if (needs_encrypt_ops) { 1522 d_set_d_op(dentry, &generic_encrypted_dentry_ops); 1523 return; 1524 } 1525#endif | 1515 if (needs_encrypt_ops && needs_ci_ops) { 1516 d_set_d_op(dentry, &generic_encrypted_ci_dentry_ops); 1517 return; 1518 } 1519#endif 1520#ifdef CONFIG_FS_ENCRYPTION 1521 if (needs_encrypt_ops) { 1522 d_set_d_op(dentry, &generic_encrypted_dentry_ops); 1523 return; 1524 } 1525#endif |
1526#ifdef CONFIG_UNICODE | 1526#if IS_ENABLED(CONFIG_UNICODE) |
1527 if (needs_ci_ops) { 1528 d_set_d_op(dentry, &generic_ci_dentry_ops); 1529 return; 1530 } 1531#endif 1532} 1533EXPORT_SYMBOL(generic_set_encrypted_ci_d_ops); | 1527 if (needs_ci_ops) { 1528 d_set_d_op(dentry, &generic_ci_dentry_ops); 1529 return; 1530 } 1531#endif 1532} 1533EXPORT_SYMBOL(generic_set_encrypted_ci_d_ops); |