From patchwork Wed Jan 25 13:34:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13115635 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 96503C61DA7 for ; Wed, 25 Jan 2023 13:34:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 115606B0075; Wed, 25 Jan 2023 08:34:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C22E6B0080; Wed, 25 Jan 2023 08:34:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE0D06B007B; Wed, 25 Jan 2023 08:34:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C86356B0075 for ; Wed, 25 Jan 2023 08:34:57 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 92E7CA0518 for ; Wed, 25 Jan 2023 13:34:57 +0000 (UTC) X-FDA: 80393417034.05.FAB592E Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf25.hostedemail.com (Postfix) with ESMTP id 3C66DA0004 for ; Wed, 25 Jan 2023 13:34:55 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1OkYkmeC; spf=none (imf25.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=1674653695; 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=T2C8sCZx2VTip67EbxZ++0B2OBKUBUFgCJpLY05V/n4=; b=zwt8ZKK5iPnNm9A/0JS0k0J2BGUTTkmQmefacH72okvq+YLDILvP4/hU7EJ/Ajua6snxIw 3QRSJDXxkG6YimQpMA4Z7uCBBDiOAMXxKzYyxUGxFZNOu5kI6D5xYh97slniRmWtAUw/k9 f4IapEywUewj+hvQ9TCGekEGRcF7bjc= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1OkYkmeC; spf=none (imf25.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=1674653695; a=rsa-sha256; cv=none; b=Jn/3YDKyKRy8UnTbVix6Emlkuxptu7vqrCfDG6NI2E8dWXnNdrXxWbgXS2+Ux9d7QbKrFi 52xgcAju7/xssadSgoOC0arfBRVSnp6So/8HL6w0TPqB3A2/jM3ERGDCqfzwsarsr1axmk fY0n0LXBjoX57TB7cCgIQol3E7YeDC0= 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=T2C8sCZx2VTip67EbxZ++0B2OBKUBUFgCJpLY05V/n4=; b=1OkYkmeC3ChehQGkCBhUBzHODi QSMoBl9rcdqYF7decsoyhscAM9vM9Hpnw/L4odKQ1gkjYKFwq/0oZkYxYu1aloIMtWAc08/FcY9ZL nSts4tqADKXgGbJWMAO8oSrFfsj2Yu7AtBHdLX8S1kDMvbf1Q1zrwua6XOWKJjmu1hStbMqfuaBsY tOmLvdjNBUEzgRogLqECDJPUjmGuxm3RCnXRaS/03B4XTS5sSIRIYxGfSgQ/f+q+LMmQ7E7fVG/ux gn9BdYL2Lq9oN8+PWNupsXpCM8PU0ttxtNTKJ6HOlMnWPrY11+sneV5vmaRixQQ0r4aNAUW5GTqng TN1Ky4mw==; 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 1pKfvK-007P1y-Ni; Wed, 25 Jan 2023 13:34:47 +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 2/7] mm: remove the swap_readpage return value Date: Wed, 25 Jan 2023 14:34:31 +0100 Message-Id: <20230125133436.447864-3-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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3C66DA0004 X-Stat-Signature: xyypa6xjr3sh6e533pwjpy86tyuhobz9 X-Rspam-User: X-HE-Tag: 1674653695-763678 X-HE-Meta: U2FsdGVkX19z7zKRJfnEGRGY2uJMMG5q/akDdObePZ6M62MchHa3x2VNckZTbBnEKLf8NNH5yxvoRxqYGmthfiml5uuR+0C5otCxUArBJ9R8UTxc2NO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PjURIzndKH62faIJpRMEgZmkaM2iikOQ5qGdvcBTyw/9IvfbJeKh/zK/+bsBGubRpJQ+UrHpckYzxnUPUP7E3GDT38d/SZmvETZiUO//Vdn2SWedEzJw9a5NxVOzJtRaRb1EevEDMc0DLjvTHHpiPzA+XRtFeh6Mfl6k37MFaFROPw+ouuwQ2rV38K4U/KYAvZZGwvxTXJLayY2sE0cNbezyV8nQVP2QJ4nKdgMm7uEeIA75O6LTFCzpUF32KD8ae4jbQwcTnX4nXPrqpebcxFg8yByCLt9a7VA3YhSW2 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_readpage always returns 0, and no caller checks the return value. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- mm/page_io.c | 16 +++++----------- mm/swap.h | 7 +++---- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 3a5f921b932e82..6f7166fdc4b2bb 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -445,11 +445,9 @@ static void swap_readpage_fs(struct page *page, *plug = sio; } -int swap_readpage(struct page *page, bool synchronous, - struct swap_iocb **plug) +void swap_readpage(struct page *page, bool synchronous, struct swap_iocb **plug) { struct bio *bio; - int ret = 0; struct swap_info_struct *sis = page_swap_info(page); bool workingset = PageWorkingset(page); unsigned long pflags; @@ -481,15 +479,12 @@ int swap_readpage(struct page *page, bool synchronous, goto out; } - if (sis->flags & SWP_SYNCHRONOUS_IO) { - ret = bdev_read_page(sis->bdev, swap_page_sector(page), page); - if (!ret) { - count_vm_event(PSWPIN); - goto out; - } + if ((sis->flags & SWP_SYNCHRONOUS_IO) && + !bdev_read_page(sis->bdev, swap_page_sector(page), page)) { + count_vm_event(PSWPIN); + goto out; } - ret = 0; bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_read; @@ -521,7 +516,6 @@ int swap_readpage(struct page *page, bool synchronous, psi_memstall_leave(&pflags); } delayacct_swapin_end(); - return ret; } void __swap_read_unplug(struct swap_iocb *sio) diff --git a/mm/swap.h b/mm/swap.h index f78065c8ef524b..f5eb5069d28c2e 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -8,8 +8,7 @@ /* linux/mm/page_io.c */ int sio_pool_init(void); struct swap_iocb; -int swap_readpage(struct page *page, bool do_poll, - struct swap_iocb **plug); +void swap_readpage(struct page *page, bool do_poll, struct swap_iocb **plug); void __swap_read_unplug(struct swap_iocb *plug); static inline void swap_read_unplug(struct swap_iocb *plug) { @@ -64,8 +63,8 @@ static inline unsigned int folio_swap_flags(struct folio *folio) } #else /* CONFIG_SWAP */ struct swap_iocb; -static inline int swap_readpage(struct page *page, bool do_poll, - struct swap_iocb **plug) +static inline void swap_readpage(struct page *page, bool do_poll, + struct swap_iocb **plug) { return 0; }