Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fedb52d authored by Eric Biggers's avatar Eric Biggers Committed by Alistair Delva
Browse files

FROMLIST: f2fs: add support for IV_INO_LBLK_64 encryption policies



f2fs inode numbers are stable across filesystem resizing, and f2fs inode
and file logical block numbers are always 32-bit.  So f2fs can always
support IV_INO_LBLK_64 encryption policies.  Wire up the needed
fscrypt_operations to declare support.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>

Change-Id: Ifc5b6bf883d0a049dbccf6a06955f69a1dfc4617
Signed-off-by: default avatarSatya Tangirala <satyat@google.com>
Link: https://patchwork.kernel.org/patch/11210903/
parent 11fd3752
Loading
Loading
Loading
Loading
+20 −6
Original line number Original line Diff line number Diff line
@@ -2316,6 +2316,18 @@ static bool f2fs_dummy_context(struct inode *inode)
	return DUMMY_ENCRYPTION_ENABLED(F2FS_I_SB(inode));
	return DUMMY_ENCRYPTION_ENABLED(F2FS_I_SB(inode));
}
}


static bool f2fs_has_stable_inodes(struct super_block *sb)
{
	return true;
}

static void f2fs_get_ino_and_lblk_bits(struct super_block *sb,
				       int *ino_bits_ret, int *lblk_bits_ret)
{
	*ino_bits_ret = 8 * sizeof(nid_t);
	*lblk_bits_ret = 8 * sizeof(block_t);
}

static const struct fscrypt_operations f2fs_cryptops = {
static const struct fscrypt_operations f2fs_cryptops = {
	.key_prefix		= "f2fs:",
	.key_prefix		= "f2fs:",
	.get_context		= f2fs_get_context,
	.get_context		= f2fs_get_context,
@@ -2323,6 +2335,8 @@ static const struct fscrypt_operations f2fs_cryptops = {
	.dummy_context		= f2fs_dummy_context,
	.dummy_context		= f2fs_dummy_context,
	.empty_dir		= f2fs_empty_dir,
	.empty_dir		= f2fs_empty_dir,
	.max_namelen		= F2FS_NAME_LEN,
	.max_namelen		= F2FS_NAME_LEN,
	.has_stable_inodes	= f2fs_has_stable_inodes,
	.get_ino_and_lblk_bits	= f2fs_get_ino_and_lblk_bits,
};
};
#endif
#endif