Skip to content

Commit 090c5c1

Browse files
Christoph HellwigEric Biggers
authored andcommitted
fscrypt: pass a byte offset to fscrypt_zeroout_range_inline_crypt
Logical offsets into an inode are usually expressed as bytes in the VFS. Switch fscrypt_zeroout_range_inline_crypt to that convention. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20260302141922.370070-10-hch@lst.de Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 3c7eaa7 commit 090c5c1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/crypto/bio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,11 @@ static void fscrypt_zeroout_range_end_io(struct bio *bio)
7070
}
7171

7272
static int fscrypt_zeroout_range_inline_crypt(const struct inode *inode,
73-
pgoff_t lblk, sector_t sector,
73+
loff_t pos, sector_t sector,
7474
unsigned int len)
7575
{
7676
const unsigned int blockbits = inode->i_blkbits;
7777
const unsigned int blocks_per_page = 1 << (PAGE_SHIFT - blockbits);
78-
loff_t pos = (loff_t)lblk << blockbits;
7978
struct fscrypt_zero_done done = {
8079
.pending = ATOMIC_INIT(1),
8180
.done = COMPLETION_INITIALIZER_ONSTACK(done.done),
@@ -142,6 +141,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
142141
const unsigned int du_per_page = 1U << du_per_page_bits;
143142
u64 du_index = (u64)lblk << (inode->i_blkbits - du_bits);
144143
u64 du_remaining = (u64)len << (inode->i_blkbits - du_bits);
144+
loff_t pos = (loff_t)lblk << inode->i_blkbits;
145145
sector_t sector = pblk << (inode->i_blkbits - SECTOR_SHIFT);
146146
struct page *pages[16]; /* write up to 16 pages at a time */
147147
unsigned int nr_pages;
@@ -154,7 +154,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
154154
return 0;
155155

156156
if (fscrypt_inode_uses_inline_crypto(inode))
157-
return fscrypt_zeroout_range_inline_crypt(inode, lblk, sector,
157+
return fscrypt_zeroout_range_inline_crypt(inode, pos, sector,
158158
len);
159159

160160
BUILD_BUG_ON(ARRAY_SIZE(pages) > BIO_MAX_VECS);

0 commit comments

Comments
 (0)