Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 19725491 authored by Gao Xiang's avatar Gao Xiang Committed by Michael Bestas
Browse files

erofs: fold in postsubmit_is_all_bypassed()

No need to introduce such separated helper since
cache strategy compile configs were changed into
runtime options instead in v5.4. No logic changes.

Link: https://lore.kernel.org/r/20200121064747.138987-1-gaoxiang25@huawei.com


Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Change-Id: I2653ee9a7d8de2d84c36c7a7f736d79814b6f113
Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
parent 2b968c0f
Loading
Loading
Loading
Loading
+7 −16
Original line number Diff line number Diff line
@@ -1149,20 +1149,6 @@ static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl,
	qtail[JQ_BYPASS] = &pcl->next;
}

static bool postsubmit_is_all_bypassed(struct z_erofs_decompressqueue *q[],
				       unsigned int nr_bios, bool force_fg)
{
	/*
	 * although background is preferred, no one is pending for submission.
	 * don't issue workqueue for decompression but drop it directly instead.
	 */
	if (force_fg || nr_bios)
		return false;

	kvfree(q[JQ_SUBMIT]);
	return true;
}

static bool z_erofs_submit_queue(struct super_block *sb,
				 z_erofs_next_pcluster_t owned_head,
				 struct list_head *pagepool,
@@ -1263,9 +1249,14 @@ static bool z_erofs_submit_queue(struct super_block *sb,
	if (bio)
		submit_bio(bio);

	if (postsubmit_is_all_bypassed(q, nr_bios, *force_fg))
	/*
	 * although background is preferred, no one is pending for submission.
	 * don't issue workqueue for decompression but drop it directly instead.
	 */
	if (!*force_fg && !nr_bios) {
		kvfree(q[JQ_SUBMIT]);
		return true;

	}
	z_erofs_decompress_kickoff(q[JQ_SUBMIT], *force_fg, nr_bios);
	return true;
}