@@ -578,7 +578,8 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc,
*
* Returns 0 on success, negative error code on failure.
*/
-static int btrfs_begin_enable_verity(struct file *filp)
+static int btrfs_begin_enable_verity(struct file *filp, u64 merkle_tree_size,
+ unsigned int tree_blocksize)
{
struct btrfs_inode *inode = BTRFS_I(file_inode(filp));
struct btrfs_root *root = inode->root;
@@ -99,7 +99,8 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
return 0;
}
-static int ext4_begin_enable_verity(struct file *filp)
+static int ext4_begin_enable_verity(struct file *filp, u64 merkle_tree_size,
+ unsigned int tree_blocksize)
{
struct inode *inode = file_inode(filp);
const int credits = 2; /* superblock and inode for ext4_orphan_add() */
@@ -115,7 +115,8 @@ struct fsverity_descriptor_location {
__le64 pos;
};
-static int f2fs_begin_enable_verity(struct file *filp)
+static int f2fs_begin_enable_verity(struct file *filp, u64 merkle_tree_size,
+ unsigned int tree_blocksize)
{
struct inode *inode = file_inode(filp);
int err;
@@ -237,7 +237,8 @@ static int enable_verity(struct file *filp,
if (IS_VERITY(inode))
err = -EEXIST;
else
- err = vops->begin_enable_verity(filp);
+ err = vops->begin_enable_verity(filp, params.tree_size,
+ params.block_size);
inode_unlock(inode);
if (err)
goto out;
@@ -80,6 +80,8 @@ struct fsverity_operations {
* Begin enabling verity on the given file.
*
* @filp: a readonly file descriptor for the file
+ * @merkle_tree_size: total bytes the Merkle tree will take up
+ * @tree_blocksize: the Merkle tree block size
*
* The filesystem must do any needed filesystem-specific preparations
* for enabling verity, e.g. evicting inline data. It also must return
@@ -89,7 +91,8 @@ struct fsverity_operations {
*
* Return: 0 on success, -errno on failure
*/
- int (*begin_enable_verity)(struct file *filp);
+ int (*begin_enable_verity)(struct file *filp, u64 merkle_tree_size,
+ unsigned int tree_blocksize);
/**
* End enabling verity on the given file.