diff options
author | Eric Biggers <ebiggers@google.com> | 2022-12-14 14:43:04 -0800 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-01-01 15:46:48 -0800 |
commit | 72ea15f0ddd29b9facdab836a2f5d3e28df9b202 (patch) | |
tree | 9f95596ad06bec7df04f4c24aef45322cba92302 /fs/f2fs/verity.c | |
parent | 9642946c6c851ba954689f184b3370e3594b6b1a (diff) |
fsverity: pass pos and size to ->write_merkle_tree_block
fsverity_operations::write_merkle_tree_block is passed the index of the
block to write and the log base 2 of the block size. However, all
implementations of it use these parameters only to calculate the
position and the size of the block, in bytes.
Therefore, make ->write_merkle_tree_block take 'pos' and 'size'
parameters instead of 'index' and 'log_blocksize'.
Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Link: https://lore.kernel.org/r/20221214224304.145712-5-ebiggers@kernel.org
Diffstat (limited to 'fs/f2fs/verity.c')
-rw-r--r-- | fs/f2fs/verity.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index c352fff88a5e..f320ed8172ec 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -276,11 +276,11 @@ static struct page *f2fs_read_merkle_tree_page(struct inode *inode, } static int f2fs_write_merkle_tree_block(struct inode *inode, const void *buf, - u64 index, int log_blocksize) + u64 pos, unsigned int size) { - loff_t pos = f2fs_verity_metadata_pos(inode) + (index << log_blocksize); + pos += f2fs_verity_metadata_pos(inode); - return pagecache_write(inode, buf, 1 << log_blocksize, pos); + return pagecache_write(inode, buf, size, pos); } const struct fsverity_operations f2fs_verityops = { |