fscrypt: remove fscrypt_operations::max_namelen
Subsystems (5)
Memory technology devices (MTD) ext4 file system F2FS file system UBI file system (UBIFS) +1 more subsystems
Eric Biggers
maintainerPATCH 1/1 fscrypt: remove fscrypt_operations::max_namelen
From: Eric Biggers <[email protected]>
The max_namelen field is unnecessary, as it is set to 255 (NAME_MAX) on all filesystems that support fscrypt (or plan to support fscrypt). For simplicity, just use NAME_MAX directly instead.
Signed-off-by Eric Biggers <[email protected]>
--- fs/crypto/fname.c | 3 +-- fs/ext4/super.c | 1 - fs/f2fs/super.c | 1 - fs/ubifs/crypto.c | 1 - include/linux/fscrypt.h | 3 --- 5 files changed, 1 insertion(+), 8 deletions(-)
fs/crypto/fname.c +1 -2
@@ -429,8 +429,7 @@ int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname,if (fscrypt_has_encryption_key (dir)) {if (!fscrypt_fname_encrypted_size (&dir->i_crypt_info->ci_policy, - iname->len, - dir->i_sb->s_cop->max_namelen, + iname->len,NAME_MAX , &fname->crypto_buf.len))return -ENAMETOOLONG ; fname->crypto_buf.name = kmalloc(fname->crypto_buf.len,
fs/ext4/super.c +0 -1
@@ -1566,7 +1566,6 @@ static const struct fscrypt_operations ext4_cryptops = { .set_context = ext4_set_context, .get_dummy_policy = ext4_get_dummy_policy, .empty_dir = ext4_empty_dir, - .max_namelen = EXT4_NAME_LEN, .has_stable_inodes = ext4_has_stable_inodes, .get_ino_and_lblk_bits = ext4_get_ino_and_lblk_bits, };
fs/f2fs/super.c +0 -1
@@ -2976,7 +2976,6 @@ static const struct fscrypt_operations f2fs_cryptops = { .set_context = f2fs_set_context, .get_dummy_policy = f2fs_get_dummy_policy, .empty_dir = f2fs_empty_dir, - .max_namelen = F2FS_NAME_LEN, .has_stable_inodes = f2fs_has_stable_inodes, .get_ino_and_lblk_bits = f2fs_get_ino_and_lblk_bits, .get_num_devices = f2fs_get_num_devices,
fs/ubifs/crypto.c +0 -1
@@ -82,5 +82,4 @@ const struct fscrypt_operations ubifs_crypt_operations = { .get_context = ubifs_crypt_get_context, .set_context = ubifs_crypt_set_context, .empty_dir = ubifs_crypt_empty_dir, - .max_namelen = UBIFS_MAX_NLEN, };
include/linux/fscrypt.h +0 -3
@@ -118,9 +118,6 @@ struct fscrypt_operations {*/ bool (*empty_dir)(struct inode *inode); -/* The filesystem's maximum ciphertext filename length, in bytes */ -unsigned int max_namelen; -/* * Check whether the filesystem's inode numbers and UUID are stable, * meaning that they will never be changed even by offline operations
Signature · 8 lines
2.33.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 6 lines · Eric Biggers
From: Eric Biggers <[email protected]>
The
max_namelenfield is unnecessary, as it is set to 255 (NAME_MAX) on all filesystems that support fscrypt (or plan to support fscrypt). For simplicity, just useNAME_MAXdirectly instead.
Quoted 8 lines
Signed-off-by Eric Biggers <[email protected]>--- fs/crypto/fname.c | 3 +-- fs/ext4/super.c | 1 - fs/f2fs/super.c | 1 - fs/ubifs/crypto.c | 1 - include/linux/fscrypt.h | 3 --- 5 files changed, 1 insertion(+), 8 deletions(-)
Applied to fscrypt.git#master for 5.16.
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel