Message ID | 20230328112716.50120-4-p.raghav@samsung.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3A84C761A6 for <linux-mm@archiver.kernel.org>; Tue, 28 Mar 2023 11:27:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C6946B007D; Tue, 28 Mar 2023 07:27:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6401B6B0072; Tue, 28 Mar 2023 07:27:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EEA56B007B; Tue, 28 Mar 2023 07:27:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D84236B0072 for <linux-mm@kvack.org>; Tue, 28 Mar 2023 07:27:25 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B5BCD1C467D for <linux-mm@kvack.org>; Tue, 28 Mar 2023 11:27:25 +0000 (UTC) X-FDA: 80618081250.10.8FA5289 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf29.hostedemail.com (Postfix) with ESMTP id 2D14612001C for <linux-mm@kvack.org>; Tue, 28 Mar 2023 11:27:22 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=X8veZPRU; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf29.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680002843; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; b=1RLXMbCk81E/gd3moOdwUt2/gavGxJOh3mUx6vxsj0GCXRiRjS9nFsJKgS9B0gPwO4OxxR dZ8r3pVqoTOZIwVnaGivh8ifNQIbbLnWBcJMHjGJog8uVjJ+hU3VtM/Y7AkWWnDVMlzTCH EPJNXr2sfoe/caKCINJdWWvKj7VYPZ4= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=X8veZPRU; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf29.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680002843; a=rsa-sha256; cv=none; b=W+DOzIyBLUavj7hXW9jR++tQMqH/6u8sbP3SPGPuQoAopKIcTW6YwB5GeJh74K2vKxIhNm NPNfp3d+7cGG1L9ROyT2gKiGaVh4usKA+BhGRZTFFxoO+1qdIa8oUdRmjmPJsXTWPjjqc6 a/YrRqTNXrsuIsmanhhU8CVCH5792KI= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230328112721euoutp0174b2284cfe3fd310defe60b3314985f3~Qka796UUg0345803458euoutp01- for <linux-mm@kvack.org>; Tue, 28 Mar 2023 11:27:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230328112721euoutp0174b2284cfe3fd310defe60b3314985f3~Qka796UUg0345803458euoutp01- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680002841; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X8veZPRUscTbo+csuyoBzJR3U41Q+EmfypVD8wc3G9EESXJDZizknQm0BysjftENp 7A7p+glY1oSYzot0AYfTKdxnMFGYgLUMcXjGSitN+JrzARRrIZHLf3dtA6cPZ8MyYv S+79mloau2Nn8yJ7L9kJGA/quO8JGZfTHftIr/DU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230328112720eucas1p22832e14ccc0ab8aa31019946721f05ee~Qka6fKv8z0111901119eucas1p2l; Tue, 28 Mar 2023 11:27:20 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 75.51.09503.81FC2246; Tue, 28 Mar 2023 12:27:20 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230328112719eucas1p2b0f94ad7b06990203081d2b125dfc6ac~Qka531zRT0949409494eucas1p26; Tue, 28 Mar 2023 11:27:19 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230328112719eusmtrp2e345237a90bdb05950bbce0a693b0b7e~Qka53IS6i0134701347eusmtrp2Q; Tue, 28 Mar 2023 11:27:19 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-7c-6422cf18c5ba Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9D.71.09583.71FC2246; Tue, 28 Mar 2023 12:27:19 +0100 (BST) Received: from localhost (unknown [106.210.248.108]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230328112719eusmtip1eb2b40496aafbd97f77244d6662ebaed~Qka5ppj340337303373eusmtip1Z; Tue, 28 Mar 2023 11:27:19 +0000 (GMT) From: Pankaj Raghav <p.raghav@samsung.com> To: martin@omnibond.com, axboe@kernel.dk, minchan@kernel.org, akpm@linux-foundation.org, hubcap@omnibond.com, willy@infradead.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, brauner@kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, mcgrof@kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, linux-mm@kvack.org, devel@lists.orangefs.org, Pankaj Raghav <p.raghav@samsung.com>, Christoph Hellwig <hch@lst.de> Subject: [PATCH 3/5] mpage: split bi_end_io callback for reads and writes Date: Tue, 28 Mar 2023 13:27:14 +0200 Message-Id: <20230328112716.50120-4-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230328112716.50120-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEKsWRmVeSWpSXmKPExsWy7djP87oS55VSDObuZ7eYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8Wyr+/ZLT4vbWG32L1xEZvF+b/HWS1+/5jD5iDkMbvhIovH5hVaHpfPlnpsWtXJ5rHp 0yR2jxMzfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRXDYpqTmZZalF+nYJ XBmrNvgX/OOp+LvOt4HxGFcXIyeHhICJxNsNrewgtpDACkaJs1fUIOwvjBINy0Qg7M+MEi/u MMHUN+zuYuli5AKKL2eUeLrxLitE0UtGiQVtHl2MHBxsAloSjZ3sIDUiAmcYJRYvb2QDcZgF /jNKfJq0EmySsICnxJofEM0sAqoSO24eZwGxeQUsJRo3dbJAbJOX2H/wLDPIUE4BK4lpv60g SgQlTs58AlbCDFTSvHU2M8h8CYHdnBJtZ9qZIXpdJI7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rNvgX/OOp+LvOt4HxGFcX IyeHhICJRMPuLpYuRi4OIYGljBIt22cxQSQkJG4vbGKEsIUl/lzrYoMoes4o8b5vN1ARBweb gJZEYyc7SFxE4AajxNqnv1hBHGaBTiaJF6t2gHULC3hKrPlxlxXEZhFQldhx8zgLiM0rYCnR uKmTBWKDvMT+g2eZQYZyClhJTPttBRIWAiq5euY9I0S5oMTJmU/AypmBypu3zmaewCgwC0lq FpLUAkamVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIHxu+3Yzy07GFe++qh3iJGJg/EQowQH s5II72ZvxRQh3pTEyqrUovz4otKc1OJDjKZAZ09klhJNzgcmkLySeEMzA1NDEzNLA1NLM2Ml cV7Pgo5EIYH0xJLU7NTUgtQimD4mDk6pBqbNdol5y11cd7bsqjn1/OjxXdtePowstgldtexz 7QTxe4uf/Vx2V2BLkMaGwz4934pi4+bdehheql7Z9kRmmYlXov3zeW/UO1WtYt2cc5LOmi7O Nq2vf/up5enH1OJZlw9lryhRU9qaELrj1oym7cxKt1J0voRz/uabUD7ZXXyO+BXT1m+/GR7Y yur/S3LW8/m+TuLiI4Ujq47JlumGFPg/sWWWtpy02WzLsquCQomCp3NlQ09v/fhXm8vv70Su dtb7weI7nPe/qk87Ev7kyuNfsV/0Ts/Ym31+ve0l8VxzD9EYYVuLs2r1C4+terNI44HQ62+V uRfag7nS8mKcdv3wkXsx1b5x742HpzVWyIoqsRRnJBpqMRcVJwIALLf4ZWgDAAA= X-CMS-MailID: 20230328112719eucas1p2b0f94ad7b06990203081d2b125dfc6ac X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20230328112719eucas1p2b0f94ad7b06990203081d2b125dfc6ac X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230328112719eucas1p2b0f94ad7b06990203081d2b125dfc6ac References: <20230328112716.50120-1-p.raghav@samsung.com> <CGME20230328112719eucas1p2b0f94ad7b06990203081d2b125dfc6ac@eucas1p2.samsung.com> X-R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1XCQyV3huj/keHAAZd /mYZpchh nDd6oRPiehAvxySpsCjnV+CVVB2fxyH3BCP6B2XhNfPu9B6gCT9TsG+5VzhE2g0y/2AerWm7h8aSJRMZjD9uLQdWKYc12X7Whi5UjH8K8su+W2GTDYOIYlQwlzQtA7mMHo2ZvZFq21GSVX2HEDIqFEMF4darxPv33BvaL X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[1/5] zram: remove the call to page_endio in the bio end_io handler
|
expand
|
diff --git a/fs/mpage.c b/fs/mpage.c index 22b9de5ddd68..3a545bf0f184 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -43,14 +43,28 @@ * status of that page is hard. See end_buffer_async_read() for the details. * There is no point in duplicating all that complexity. */ -static void mpage_end_io(struct bio *bio) +static void mpage_read_end_io(struct bio *bio) { struct bio_vec *bv; struct bvec_iter_all iter_all; bio_for_each_segment_all(bv, bio, iter_all) { struct page *page = bv->bv_page; - page_endio(page, bio_op(bio), + page_endio(page, REQ_OP_READ, + blk_status_to_errno(bio->bi_status)); + } + + bio_put(bio); +} + +static void mpage_write_end_io(struct bio *bio) +{ + struct bio_vec *bv; + struct bvec_iter_all iter_all; + + bio_for_each_segment_all(bv, bio, iter_all) { + struct page *page = bv->bv_page; + page_endio(page, REQ_OP_WRITE, blk_status_to_errno(bio->bi_status)); } @@ -59,7 +73,11 @@ static void mpage_end_io(struct bio *bio) static struct bio *mpage_bio_submit(struct bio *bio) { - bio->bi_end_io = mpage_end_io; + if (op_is_write(bio_op(bio))) + bio->bi_end_io = mpage_write_end_io; + else + bio->bi_end_io = mpage_read_end_io; + guard_bio_eod(bio); submit_bio(bio); return NULL;
Split the bi_end_io handler for reads and writes similar to other aops. This is a prep patch before we convert end_io handlers to use folios. Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> --- fs/mpage.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)