From patchwork Wed Jan 25 13:34:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13115639 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6CB4C61D9D for ; Wed, 25 Jan 2023 13:35:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B991C6B007E; Wed, 25 Jan 2023 08:35:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B496B6B0080; Wed, 25 Jan 2023 08:35:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EA936B0081; Wed, 25 Jan 2023 08:35:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 87C236B007E for ; Wed, 25 Jan 2023 08:35:05 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5DDF21C62BB for ; Wed, 25 Jan 2023 13:35:05 +0000 (UTC) X-FDA: 80393417370.20.DFBC0B5 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf02.hostedemail.com (Postfix) with ESMTP id B54A780015 for ; Wed, 25 Jan 2023 13:35:03 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Qa7NsUs+; spf=none (imf02.hostedemail.com: domain of BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674653703; a=rsa-sha256; cv=none; b=1FJwmbn51JZkzW+l1IpfRqWYz7n+qS6pihQmYyWIeAGQpLEZrlyGrRLdVVa1pKw6u0ACtY gqdDalh+Mujow4cGpUtuKyonNyaQrDQG8H5LLDq64szdFXLLTY6Qb0oyAcL4oyXh9/n/UE TAPjHokCnTBY+Ir9Sg+v4HtFQqDAPZA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Qa7NsUs+; spf=none (imf02.hostedemail.com: domain of BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+926f35216cf1e93e6ac9+7094+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674653703; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TjTCQ4W/29YQuTOitm932bfpCXinG0reI1NrYTz/RJs=; b=L9BqFAvRaK6Xha6TK0eaAubWKu602R/27FJcXrmVRIIsYQze5tZ1L9psoJEqclFXgqRJ+Z YHlSBESGZlefCT7gcgLkdOsrVliheqmt4doCnWn6ZNaaPEuUP3FuB82wTh1HBdCBVANP0g paopsXVi+MzOFryNZmaqIFnsJuvHfdA= 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=TjTCQ4W/29YQuTOitm932bfpCXinG0reI1NrYTz/RJs=; b=Qa7NsUs+tvjV6sn3Kr0WIEmeG9 geCnOc/IfyJxD9jHyWR/aN/A+TdXVZUfPy08CvfCxirk0mn9RmZVet9GdDBUb+pZ15qgVGPBGtzso QHEZQzT6kWyev3o6cAh6dAdjgTHxhev/QUsLJgkklZ0nXSKrdnTAlRntR9SiFK1438rz6lAE2Hpri h6CQfd/Z3iewk34wp9Lp40RKfXjVgKdofOMupCfP8jC+sr9umVu4jN3RDTewqJq03Y6kYUhiohgiI c7CoSzjjxFRQfN6MC3tuXDmzqdxnv2m5DTBHHzUWYe4RaojFo0cRMQ1D8vXnpnI6y8MLcrcx2vNri ukqR28IQ==; Received: from [2001:4bb8:19a:27af:c78f:9b0d:b95c:d248] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKfvW-007P4q-JB; Wed, 25 Jan 2023 13:34:59 +0000 From: Christoph Hellwig To: Jens Axboe , Minchan Kim , Sergey Senozhatsky , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny Cc: Andrew Morton , linux-block@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/7] mm: remove the __swap_writepage return value Date: Wed, 25 Jan 2023 14:34:34 +0100 Message-Id: <20230125133436.447864-6-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125133436.447864-1-hch@lst.de> References: <20230125133436.447864-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-Rspam-User: X-Rspamd-Queue-Id: B54A780015 X-Rspamd-Server: rspam01 X-Stat-Signature: fweppowjuegcgdahkywpjerg818fotcs X-HE-Tag: 1674653703-279777 X-HE-Meta: U2FsdGVkX1/NNX3lrC7IzhWhv0lxoJ88sf1PEQpxAZXUfZTrEJnucYIiIZl8NtIjqoBDMxphmP5eU3vxoi1Y9Y4nrb7oxSBuFLqu0Vt7HhppGML4LU2OGh4gFRuc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xDkODjFcvRx4zOW+F2cEI/xlk6bVafuJtPehZhXR8Se5kXonf7Sl3oDBvNp85AsRuVn+WQ8KHGRVvKx/gmbNldf6ZTYVR9vkjq+TbFimdGexP6dF2RfxxN3KK5OZsHPTITZvSsrTc4sbJyh9hnsaT6I2xzvBX3gnAkuA2Q0hbWzgqRN6J6WZHyjmiAztLlzPc4eslZ7Vl7kGd0Sn+l7VoHjP+iAqDAnXGyJ6FpU5/Mj3J8o9NXAFgoQ8Y5xtJy8O 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: __swap_writepage always returns 0. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 23 +++++++++-------------- mm/swap.h | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 21ce4505f00607..c373d5694cdffd 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -178,11 +178,11 @@ int generic_swapfile_activate(struct swap_info_struct *sis, int swap_writepage(struct page *page, struct writeback_control *wbc) { struct folio *folio = page_folio(page); - int ret = 0; + int ret; if (folio_free_swap(folio)) { folio_unlock(folio); - goto out; + return 0; } /* * Arch code may have to preserve more data than just the page @@ -192,17 +192,16 @@ int swap_writepage(struct page *page, struct writeback_control *wbc) if (ret) { folio_mark_dirty(folio); folio_unlock(folio); - goto out; + return ret; } if (frontswap_store(&folio->page) == 0) { folio_start_writeback(folio); folio_unlock(folio); folio_end_writeback(folio); - goto out; + return 0; } - ret = __swap_writepage(&folio->page, wbc); -out: - return ret; + __swap_writepage(&folio->page, wbc); + return 0; } static inline void count_swpout_vm_event(struct page *page) @@ -289,7 +288,7 @@ static void sio_write_complete(struct kiocb *iocb, long ret) mempool_free(sio, sio_pool); } -static int swap_writepage_fs(struct page *page, struct writeback_control *wbc) +static void swap_writepage_fs(struct page *page, struct writeback_control *wbc) { struct swap_iocb *sio = NULL; struct swap_info_struct *sis = page_swap_info(page); @@ -326,11 +325,9 @@ static int swap_writepage_fs(struct page *page, struct writeback_control *wbc) } if (wbc->swap_plug) *wbc->swap_plug = sio; - - return 0; } -int __swap_writepage(struct page *page, struct writeback_control *wbc) +void __swap_writepage(struct page *page, struct writeback_control *wbc) { struct bio *bio; int ret; @@ -348,7 +345,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc) ret = bdev_write_page(sis->bdev, swap_page_sector(page), page, wbc); if (!ret) { count_swpout_vm_event(page); - return 0; + return; } bio = bio_alloc(sis->bdev, 1, @@ -363,8 +360,6 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc) set_page_writeback(page); unlock_page(page); submit_bio(bio); - - return 0; } void swap_write_unplug(struct swap_iocb *sio) diff --git a/mm/swap.h b/mm/swap.h index f5eb5069d28c2e..28be6cb3277fa4 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -17,7 +17,7 @@ static inline void swap_read_unplug(struct swap_iocb *plug) } void swap_write_unplug(struct swap_iocb *sio); int swap_writepage(struct page *page, struct writeback_control *wbc); -int __swap_writepage(struct page *page, struct writeback_control *wbc); +void __swap_writepage(struct page *page, struct writeback_control *wbc); /* linux/mm/swap_state.c */ /* One swap address space for each 64M swap space */