From patchwork Tue Apr 2 20:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13614575 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 85235CD1284 for ; Tue, 2 Apr 2024 20:17:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A12B6B0083; Tue, 2 Apr 2024 16:17:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1521E6B008C; Tue, 2 Apr 2024 16:17:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 040846B0098; Tue, 2 Apr 2024 16:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DC3C06B0083 for ; Tue, 2 Apr 2024 16:17:03 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9A5F91A041B for ; Tue, 2 Apr 2024 20:17:03 +0000 (UTC) X-FDA: 81965700726.01.864F3C7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 19B3220028 for ; Tue, 2 Apr 2024 20:17:01 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=X6Rdga6G; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712089022; 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:references:dkim-signature; bh=BlBYgB/vDOo76ILCNc0dKjW8gWRMmKXEYasPmZBCmNA=; b=6pBwfsrYKgoPNnG4DKbE0ON7XvuYQlVKbZjyRZxY366n/SvTwFf7yh6nSU9f+Plimtw3H+ BGTOSjgKgiwBakJC51GVwjBwkL3E80zOv6xkD8YD/HSwefuLnQ2/LXzCuk4EnBY8vAMH+S PrGQXwWmW5UFFFTubLXurwgm/wOEF/I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712089022; a=rsa-sha256; cv=none; b=7xW8+i+lbEtQW/P5Njt8crIOr/IsdOtKhzbYtOR/TQ7zEmCnlKsUu3eDWGKjBsjP6ed9hC z6z3pjOM2DkTJPBJr+3PuKwM6/2cqi1UAyqtLxdMa//45k5hfW6EJvhV7yhjhPI0i8sAiw EGQYHqUZsUZ+3nC0YO1qyUOOttvee3s= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=X6Rdga6G; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=BlBYgB/vDOo76ILCNc0dKjW8gWRMmKXEYasPmZBCmNA=; b=X6Rdga6GTwBmXSUxYZlb/CoGcr NwZqr8QEhvZ7RbvyXcuAwDWjoHXRqXsHCAbd8oKkVHO3swoars/C1L2hF/h/0YdogpGGYwJhPSW0+ YclRMVq4dP3VeZC3/gKsyHuNYCWl3S7NJl8SjEoGHZKDvuQLdGDF94ill+RpxOGPLuqR1zaR03baY vTh54ibZoFYzJeS6oMFZDtMF+I+QqsME81zOzibAxyiJl8Kqb0SUUAMFJvnUwow3g+UAF3kCKI/N1 49QC5k2uCI7uQP/s4NvbZcW6nxTM4HYY49tjp4o1OLwYGLzdU1K6cK/oMwe2LZFtoXDIEZR7I3BC3 ffrnU5Wg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrkZ2-00000003qtc-2MPv; Tue, 02 Apr 2024 20:17:00 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH] mm: Remove struct page from get_shadow_from_swap_cache Date: Tue, 2 Apr 2024 21:16:57 +0100 Message-ID: <20240402201659.918308-1-willy@infradead.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Stat-Signature: p3s3mc564gzif3q6u58fuoqkeombb1xb X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 19B3220028 X-Rspam-User: X-HE-Tag: 1712089021-252169 X-HE-Meta: U2FsdGVkX1+TTDD48AhpI0MBevwauXPT+HF/9GM9QTUoU1rumqaWiHXwgbHO5TVJ0+eRGwyGnyX5/YisKjJvWo7yPo+sa5cF4L1SpOap7AMiD1vBBNremZbzKsx9skXMRBJTpSF+J1jQrSmzSvgPvO1axgovH8jmgbUQinQgQcBun6viLYedMyJvUp6Tim7+FUY1dY+dWkG2sXQ67RD4PeWPL+1fJb4izFD4276TdzQNt9kXf0tJpImz89efocsaHHng/Z5s6K14qbzXgNq1Sw25GXnSWIqcQwxlSsXTesC2We1TkdI1izM6C6hbGQ+JwWzEFnyG67Kct4cFPABz9ARNs80EQqqBVAoys9jLjJQ0UqCz41XYCsrkCNDB4TxpiEtU6BNmBwJd64yX0Tm+KraDK3V59J0k++L4pMUZpgwE8tIfkAlW4lvIDIKduQWtJ1pfvDcW1aTqVBKS+mz5lFpOmM59Av3cUKlptKwnOdcAIKEvktSMxZl+64xZgEnoEHx3GQ8FxuvNw74CXFuwr26ahiiPYvBmiULywKF9m4UuVYaJ2DdQwYt72dHZ1qh50UaYBaDU1fowaHmMhhXzuK/8iO4VQftmWzQC9JdOeJu5dp3ieY/G+Tr+Z5mmnjfxfY1mHRLsK5WlC+9w8cUxPPSxUw3b20NFLnNur85JYNJrIiHw+rb/7s+SxJl8dA/cQIYC942CZi4hxXcRX995Fo8FT1NdDFOiS1RQfJXiTbvTgPLhq9lQ5reTIqZXQdG+703x5znyF7+k+zoKoOOw7u4APj/kJCGZzYZ8nY3GFelJormv+dhn91AzK656YSjweKrWAKjRATV7ZK2SotuxBuXXQIx8eW9Gxh3AjqWxw3t18+9MRMzIBgul6ioWYmptDXsiUPIASYh2F6M/O+CzNX05+wlpVg37+uu1sJq9n42tDAYEgAWIi0i9V3JZuYi0rZRAZ5yzxJJa7f+QWmN rgHVGlHI SGLmgsH60tFlcNt+vo5oJOrtcCEcGvMefuQxypdpi9wgHZguxTou5Qk0gboEoiH59iV3m2FUCpCLy5OezsGDXqUR4oqwP2dxSVxD+dWkXgX6N3ZPQl1NeC6w7wpsWshoNtyuElyJhpuIb2Evzt9GSwbU/kcCq5KHIcV0FvqVujFFU3sdhI0TdGcADYW9JSgOiEed4eXI+6PRo2o4+mlPWKHy8yc5VE2fTurKK 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: List-Subscribe: List-Unsubscribe: We don't actually use any parts of struct page; all we do is check the value of the pointer. So give the pointer the appropriate name & type. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand --- mm/swap_state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/swap_state.c b/mm/swap_state.c index f3c379e93bc6..c00ef2f18f2b 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -73,11 +73,11 @@ void *get_shadow_from_swap_cache(swp_entry_t entry) { struct address_space *address_space = swap_address_space(entry); pgoff_t idx = swp_offset(entry); - struct page *page; + void *shadow; - page = xa_load(&address_space->i_pages, idx); - if (xa_is_value(page)) - return page; + shadow = xa_load(&address_space->i_pages, idx); + if (xa_is_value(shadow)) + return shadow; return NULL; }