Skip to contentSkip to conversation

fs/buffer.c: use b_folio for fscrypt work

PATCH Applied Eric Biggers 1 participant 2 messages Feb 24, 2023 – Mar 7, 2023

Subsystems (2)
lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 fs/buffer.c: use b_folio for fscrypt work

From: Eric Biggers <[email protected]>

Use b_folio now that it exists. This removes an unnecessary call to compound_head(). No actual change in behavior.

---
 fs/buffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/buffer.c +2 -2
index 034bece27163..d759b105c1e7 100644
@@ -330,8 +330,8 @@ static void decrypt_bh(struct work_struct *work)
 	struct buffer_head *bh = ctx->bh;
 	int err;
 
-	err = fscrypt_decrypt_pagecache_blocks(page_folio(bh->b_page),
-					       bh->b_size, bh_offset(bh));
+	err = fscrypt_decrypt_pagecache_blocks(bh->b_folio, bh->b_size,
+					       bh_offset(bh));
 	if (err == 0 && need_fsverity(bh)) {
 		/*
 		 * We use different work queues for decryption and for verity
Signature · 1 line
2.39.2
author maintainer Applied
#1 lore raw
Quoted 15 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Use b_folio now that it exists. This removes an unnecessary call to compound_head(). No actual change in behavior.

---
 fs/buffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/buffer.c +0 -0
index 034bece27163..d759b105c1e7 100644

fs/buffer.c static void decrypt_bh(struct work_struct *work) · line 337

Quoted 10 lines
fs/buffer.c +2 -2
@@ -330,8 +330,8 @@ static void decrypt_bh(struct work_struct *work)
 	struct buffer_head *bh = ctx->bh;
 	int err;
 
-	err = fscrypt_decrypt_pagecache_blocks(page_folio(bh->b_page),
-					       bh->b_size, bh_offset(bh));
+	err = fscrypt_decrypt_pagecache_blocks(bh->b_folio, bh->b_size,
+					       bh_offset(bh));
 	if (err == 0 && need_fsverity(bh)) {
 		/*
 		 * We use different work queues for decryption and for verity

Applied to https://git.kernel.org/pub/scm/fs/fscrypt/linux.git/log/?h=for-next

- Eric