From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30EC93FD140; Mon, 2 Mar 2026 14:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772461175; cv=none; b=rYowLozhy8jJd5yXVSKT3e89aYVPGZE2Uk7HLSzw4zkUtFJyiijLb29XVclXW8NabSds45oEs1qqWH5l3kD1xukzc8uAy1POuXLWecUQgkEW/GoZ9X6z0yRYIj5s1Tlzje2c7NbIJZHLT9EFE8EmGn73Qc1GEWZbM+QQcHmmMRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772461175; c=relaxed/simple; bh=jNN+pxCqQfmKgqzEm/JbRLH09RDDBICEzMCdt6/vDYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T2j3x9pJJGhUWv3rQA23IEuKX6hmdGga9h4C1Y5DKDlXhIQUkLxMTaDPK7YcVFtg5NF1zQPnlkxntUBhLjiFobss0W0oXCFw8BWDdxjr6mGtN/MMpnGJmrdAepnAefQS5+qAvtTnERudjBHgUREL3hxmrd1rkDQkWBK00+AWsGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=KlH8q9wj; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="KlH8q9wj" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=2MKwitb679q/7EFRawvNRTcIo328h9sEUi+N9CTrDp0=; b=KlH8q9wjrnFAY6DKylX10U8ahL 4dm7vJPNndoAPXuPNAbCy8wEkewJ8m3Bqnw11DMcwm8Tf3oxM6Y/wtYy2gPd1ibjaaEGZyK72RxXO rg5PCwSwCZOzHGau2wJZWgpVLJ6DLv1FCejzB6b0cSbFCXqLDoJ28cevdBqBH4nq1EGo64yyxnash GFYjLwQa6DETQdUlXGdhG8qVef6rNQ3fTN/Rms7p7vjEOHVuzH/Ng47S8JdbMjlI2vmrWqMPXhvfV soqQUoiYgAiBEj6+9JFloeKBeZYZro3sj0VIF1c/pPNn7tcnvrx4bSdu1ZkzSK5prJWvYD8fH18uj o7XxGCfg==; Received: from [2604:3d08:797f:2840::9d5f] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vx47R-0000000DDTC-3B0a; Mon, 02 Mar 2026 14:19:33 +0000 From: Christoph Hellwig To: Eric Biggers Cc: "Theodore Y. Ts'o" , Jaegeuk Kim , Andreas Dilger , Chao Yu , Christian Brauner , "Darrick J. Wong" , linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: [PATCH 09/14] fscrypt: pass a byte offset to fscrypt_zeroout_range_inline_crypt Date: Mon, 2 Mar 2026 06:18:14 -0800 Message-ID: <20260302141922.370070-10-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260302141922.370070-1-hch@lst.de> References: <20260302141922.370070-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 --- fs/crypto/bio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index e7fb2fdd9728..7558b3e69701 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -70,12 +70,11 @@ static void fscrypt_zeroout_range_end_io(struct bio *bio) } static int fscrypt_zeroout_range_inline_crypt(const struct inode *inode, - pgoff_t lblk, sector_t sector, + loff_t pos, sector_t sector, unsigned int len) { const unsigned int blockbits = inode->i_blkbits; const unsigned int blocks_per_page = 1 << (PAGE_SHIFT - blockbits); - loff_t pos = (loff_t)lblk << blockbits; struct fscrypt_zero_done done = { .pending = ATOMIC_INIT(1), .done = COMPLETION_INITIALIZER_ONSTACK(done.done), @@ -142,6 +141,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, const unsigned int du_per_page = 1U << du_per_page_bits; u64 du_index = (u64)lblk << (inode->i_blkbits - du_bits); u64 du_remaining = (u64)len << (inode->i_blkbits - du_bits); + loff_t pos = (loff_t)lblk << inode->i_blkbits; sector_t sector = pblk << (inode->i_blkbits - SECTOR_SHIFT); struct page *pages[16]; /* write up to 16 pages at a time */ unsigned int nr_pages; @@ -154,7 +154,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, return 0; if (fscrypt_inode_uses_inline_crypto(inode)) - return fscrypt_zeroout_range_inline_crypt(inode, lblk, sector, + return fscrypt_zeroout_range_inline_crypt(inode, pos, sector, len); BUILD_BUG_ON(ARRAY_SIZE(pages) > BIO_MAX_VECS); -- 2.47.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B6F5EA4E0C for ; Mon, 2 Mar 2026 14:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xXfalWg4Sx0fSnJ1c95D5O8XZoRI4LovmAY99rfW9cc=; b=A9M2DYLmwX4SfbhySmoB5DVfn1 FxRAqv8eNJDdpmZN7B3wfEUUn7DAiA0c3AFoXQFFzXoxdiV0plSXecV0lRHBKugE1dvrTPfj4NFx9 Y7nSwTA7miP4PVv130hpGirvShbvPj1+Y8+C1r5rJDIeZbMG7EApnbYfwpAGZNuhin0s=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vx47e-0007pl-9f; Mon, 02 Mar 2026 14:19:46 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vx47d-0007pf-7G for linux-f2fs-devel@lists.sourceforge.net; Mon, 02 Mar 2026 14:19:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2MKwitb679q/7EFRawvNRTcIo328h9sEUi+N9CTrDp0=; b=jrzrjaJ9v0N5BUJH4Szl6413Go AFlnSZRWGt9PlJdcrnIG4MsXxk+HY96jNVTKMwiOCTB20S0S7sI+kGTRd5HFIJTXD4Ipg/QEdMJwJ RhMXdj61D5cGUDJL8yxla9yvrkQmuME+bJQhkO0HEAY6OZwjLJBPH3wuphj/2JD5E1/c=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2MKwitb679q/7EFRawvNRTcIo328h9sEUi+N9CTrDp0=; b=HhnsMKGBeLnmWuoH59JrsGC8Jm y2B0EFZyb0DjquZXZdsq8NbReoprkZVhGKEC4gB1bL8ZNUR1qL0OXn2Xfq4mvWsvQ4sAAIFJdsxmO SCUy6rboXbHkhPAMpSVJl1zEc8Q6LotbguS4xCoIkwT7N8Ztm8l1ecCto9MC5PUk70AM=; Received: from bombadil.infradead.org ([198.137.202.133]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vx47c-0001UH-Qi for linux-f2fs-devel@lists.sourceforge.net; Mon, 02 Mar 2026 14:19:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=2MKwitb679q/7EFRawvNRTcIo328h9sEUi+N9CTrDp0=; b=KlH8q9wjrnFAY6DKylX10U8ahL 4dm7vJPNndoAPXuPNAbCy8wEkewJ8m3Bqnw11DMcwm8Tf3oxM6Y/wtYy2gPd1ibjaaEGZyK72RxXO rg5PCwSwCZOzHGau2wJZWgpVLJ6DLv1FCejzB6b0cSbFCXqLDoJ28cevdBqBH4nq1EGo64yyxnash GFYjLwQa6DETQdUlXGdhG8qVef6rNQ3fTN/Rms7p7vjEOHVuzH/Ng47S8JdbMjlI2vmrWqMPXhvfV soqQUoiYgAiBEj6+9JFloeKBeZYZro3sj0VIF1c/pPNn7tcnvrx4bSdu1ZkzSK5prJWvYD8fH18uj o7XxGCfg==; Received: from [2604:3d08:797f:2840::9d5f] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vx47R-0000000DDTC-3B0a; Mon, 02 Mar 2026 14:19:33 +0000 From: Christoph Hellwig To: Eric Biggers Date: Mon, 2 Mar 2026 06:18:14 -0800 Message-ID: <20260302141922.370070-10-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260302141922.370070-1-hch@lst.de> References: <20260302141922.370070-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Headers-End: 1vx47c-0001UH-Qi Subject: [f2fs-dev] [PATCH 09/14] fscrypt: pass a byte offset to fscrypt_zeroout_range_inline_crypt X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Brauner , "Theodore Y. Ts'o" , "Darrick J. Wong" , linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, Andreas Dilger , linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 --- fs/crypto/bio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index e7fb2fdd9728..7558b3e69701 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -70,12 +70,11 @@ static void fscrypt_zeroout_range_end_io(struct bio *bio) } static int fscrypt_zeroout_range_inline_crypt(const struct inode *inode, - pgoff_t lblk, sector_t sector, + loff_t pos, sector_t sector, unsigned int len) { const unsigned int blockbits = inode->i_blkbits; const unsigned int blocks_per_page = 1 << (PAGE_SHIFT - blockbits); - loff_t pos = (loff_t)lblk << blockbits; struct fscrypt_zero_done done = { .pending = ATOMIC_INIT(1), .done = COMPLETION_INITIALIZER_ONSTACK(done.done), @@ -142,6 +141,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, const unsigned int du_per_page = 1U << du_per_page_bits; u64 du_index = (u64)lblk << (inode->i_blkbits - du_bits); u64 du_remaining = (u64)len << (inode->i_blkbits - du_bits); + loff_t pos = (loff_t)lblk << inode->i_blkbits; sector_t sector = pblk << (inode->i_blkbits - SECTOR_SHIFT); struct page *pages[16]; /* write up to 16 pages at a time */ unsigned int nr_pages; @@ -154,7 +154,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, return 0; if (fscrypt_inode_uses_inline_crypto(inode)) - return fscrypt_zeroout_range_inline_crypt(inode, lblk, sector, + return fscrypt_zeroout_range_inline_crypt(inode, pos, sector, len); BUILD_BUG_ON(ARRAY_SIZE(pages) > BIO_MAX_VECS); -- 2.47.3 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel