Skip to contentSkip to conversation

f2fs: decompress data without workqueue

PATCH In review Jaegeuk Kim 1 participant 2 messages May 18, 2022 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: decompress data without workqueue

Let's decompress data under the same context to avoid workqueue delay.

---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/data.c +3 -1
index 54a7a8ad994d..37aa7ac5d463 100644
@@ -285,10 +285,12 @@ static void f2fs_read_end_io(struct bio *bio)
 		return;
 	}
 
-	if (ctx && (ctx->enabled_steps & (STEP_DECRYPT | STEP_DECOMPRESS))) {
+	if (ctx && (ctx->enabled_steps & STEP_DECRYPT)) {
 		INIT_WORK(&ctx->work, f2fs_post_read_work);
 		queue_work(ctx->sbi->post_read_wq, &ctx->work);
 	} else {
+		if (ctx && (ctx->enabled_steps & STEP_DECOMPRESS))
+			f2fs_handle_step_decompress(ctx);
 		f2fs_verify_and_finish_bio(bio);
 	}
 }
Signature · 1 line
2.36.1.124.g0e6072fb45-goog
author maintainer
#1 lore raw

Please hold any test, since this patch has a bug.

Quoted 27 lines · Jaegeuk Kim

Let's decompress data under the same context to avoid workqueue delay.

---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/data.c +3 -1
index 54a7a8ad994d..37aa7ac5d463 100644
@@ -285,10 +285,12 @@ static void f2fs_read_end_io(struct bio *bio)
 		return;
 	}
 
-	if (ctx && (ctx->enabled_steps & (STEP_DECRYPT | STEP_DECOMPRESS))) {
+	if (ctx && (ctx->enabled_steps & STEP_DECRYPT)) {
 		INIT_WORK(&ctx->work, f2fs_post_read_work);
 		queue_work(ctx->sbi->post_read_wq, &ctx->work);
 	} else {
+		if (ctx && (ctx->enabled_steps & STEP_DECOMPRESS))
+			f2fs_handle_step_decompress(ctx);
 		f2fs_verify_and_finish_bio(bio);
 	}
 }
Signature · 1 line
2.36.1.124.g0e6072fb45-goog