From patchwork Mon Jan 15 22:59:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13520255 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 D96EFC4707B for ; Mon, 15 Jan 2024 23:01:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 713436B0072; Mon, 15 Jan 2024 18:01:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 68F906B007D; Mon, 15 Jan 2024 18:01:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 440C06B0074; Mon, 15 Jan 2024 18:01:23 -0500 (EST) 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 2F66F6B0075 for ; Mon, 15 Jan 2024 18:01:23 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id ED9961204AA for ; Mon, 15 Jan 2024 23:01:22 +0000 (UTC) X-FDA: 81683068404.23.2DD9ACF Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf02.hostedemail.com (Postfix) with ESMTP id DAC6680002 for ; Mon, 15 Jan 2024 23:01:19 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=RPc0Smlo; spf=pass (imf02.hostedemail.com: domain of david@fromorbit.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=david@fromorbit.com; dmarc=pass (policy=quarantine) header.from=fromorbit.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705359680; 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=PWbtG64sD6BzeK2zveN6cjdFiuTvAXGzco6ErPoMl4w=; b=wWcEujG3WZFDAbQfcltfKbArmKwhUFZTBdYY9/q/2LRvtiNAmiF9U701N3OyHLbwdrD/b0 Iwm/bRLbiR6/UzH/6kHlGv5HoRPSf4icLMellbx9oSXS22wIfdGAyxb7HSRGOx52nGG1JN OIjDCT0gE/pbXrBpDzaF5XrfN/WvQ/Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705359680; a=rsa-sha256; cv=none; b=t1gbY3Y80GQio4+3cQHnrIFjX2X2dyv29mEctGpcnjnkNcV073q+B2qbzV7/KVE/EVhZA/ BxEAeN0p2sGj6yK8EAgx5R+7tnBshofdzsgTSZTEONoNth/tJPn1sHTLRRCWObNrNHSKcX tm2nKZbxOeFt5zINL0srA1ZBFzcrP90= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=RPc0Smlo; spf=pass (imf02.hostedemail.com: domain of david@fromorbit.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=david@fromorbit.com; dmarc=pass (policy=quarantine) header.from=fromorbit.com Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-28db4f860easo3511769a91.3 for ; Mon, 15 Jan 2024 15:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1705359678; x=1705964478; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PWbtG64sD6BzeK2zveN6cjdFiuTvAXGzco6ErPoMl4w=; b=RPc0Smloril/KNpQU/ES6ESylC/q2O1vIxb2ugPvRQ6AAJ+7GNfBYzgh9d/r78UXdx PXEhDTNXrEN+ZH3GPzH1t+0e3RouuMJ1vsSdL1vw7xnR/WFP2gxoTLrPxTxlmF/cXkds qF0EeEsUjFD/GC1LlZrsUgHUVVYCTaeex5wCLdhRXa3lMEqKIQToq6vN9FHglI+KFu8k nTTj0P3P0FnivGmzqcRfIte2dtQU7Ne0p3mK6F5jphs+I+D/baXNrtVKe3yhpnTOJc+1 q8TwEXXS9cGkUaPqXrePitRzW/1QZkSuoLdnroHAycI2lGV04RTTjx+f1OLgoBAOfZ+6 Fcrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705359678; x=1705964478; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PWbtG64sD6BzeK2zveN6cjdFiuTvAXGzco6ErPoMl4w=; b=s8A5bsMn1fDZmcJw6PqA3cSWfsOQIE0BV8PoNe6HnSi9nfDw0VCxn09jvT/oodSOUU 5R90VFDTdboC6lN+50ySIcSzlH5fwpID+rvRA4gzB0KiYBG+1yKp3kznC8xaCm6/uZ5l geQ7800aXt7lxHWIa5emzf7oQ9e+2Mg+llr2xLbR2GT+Wh7NjNlbGgKSyPz6uai/i83z UorEKHr3Ai/usqRZMav3saOA0ZKu6I76UfEGiHPjqV/IqMQ73vl+fXAgOZD76LskNfIQ ElaaLlgqVcEJlk8EqekWFy5zKbkLENWa33aJzNmbDuaBzq1AEgEOKMNu1XMyFj3V52Bo ryVQ== X-Gm-Message-State: AOJu0YxH2lVVqLOfkej+ctBlFPLUCingQ23ykJJieO0bCNlmm3Vmq5qd kVBWgFXsPozwGU9t08WWPZ6C4DX/N8GQOg== X-Google-Smtp-Source: AGHT+IHzvuZoaCbm5eSl7ojpSx8vkAcqHRsJMQCe+3FzNo0z4XkzqCyZoYBxmeRqTLmj2IAwHX2Rug== X-Received: by 2002:a17:90a:fd0a:b0:28c:891a:48f8 with SMTP id cv10-20020a17090afd0a00b0028c891a48f8mr2722876pjb.17.1705359678611; Mon, 15 Jan 2024 15:01:18 -0800 (PST) Received: from dread.disaster.area (pa49-180-249-6.pa.nsw.optusnet.com.au. [49.180.249.6]) by smtp.gmail.com with ESMTPSA id lf8-20020a170902fb4800b001d5b2967d00sm4882658plb.290.2024.01.15.15.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 15:01:18 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.96) (envelope-from ) id 1rPVxE-00AtJx-0B; Tue, 16 Jan 2024 10:01:15 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.97) (envelope-from ) id 1rPVxD-0000000H8fX-2Ebw; Tue, 16 Jan 2024 10:01:15 +1100 From: Dave Chinner To: linux-xfs@vger.kernel.org Cc: willy@infradead.org, linux-mm@kvack.org Subject: [PATCH 03/12] xfs: move kmem_to_page() Date: Tue, 16 Jan 2024 09:59:41 +1100 Message-ID: <20240115230113.4080105-4-david@fromorbit.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115230113.4080105-1-david@fromorbit.com> References: <20240115230113.4080105-1-david@fromorbit.com> MIME-Version: 1.0 X-Stat-Signature: 5a5mmmy6mrt5zxtk64xq7gtpfuz9tm9o X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: DAC6680002 X-Rspam-User: X-HE-Tag: 1705359679-345848 X-HE-Meta: U2FsdGVkX18hbYf6RcZAtKi9r2X9Ksqo9QGK9smfc8vI33oT3EfohmNYAkKV7mCH28qbPqi8u8fEKJqzLmUUjBjMM6K/LOqQ8l42W65L1oSp+p0KIgLsS3iH9nC/sIfyYfZoiimvyLrBJSkjhrjppALuMBwxam+jHI1J68eJlPw16FvhGq0/TvX1ElS3T0ynSZdpEDP6P6J0qTUnvlTlVpEWpD3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PTIhByVpNy6MGn54InMh2Be9Q8q0Io784Y9EKKJUBgK+nzEJRWETNJf2sXrnA/RoUh9MbpXpMZMiPVN4kVoM5dh3VaHGBziGdPGoLw8Og1lqS11uZpwDwoYasxLf6nVMeTLbrVxGQXYV8ymtZkmDsKECq+EnvM5blhg3gW919KqimLGjfL28j5/Y= 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: From: Dave Chinner Move it to the general xfs linux wrapper header file so we can prepare to remove kmem.h Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong --- fs/xfs/kmem.h | 11 ----------- fs/xfs/xfs_linux.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h index 1343f1a6f99b..48e43f29f2a0 100644 --- a/fs/xfs/kmem.h +++ b/fs/xfs/kmem.h @@ -20,15 +20,4 @@ static inline void kmem_free(const void *ptr) kvfree(ptr); } -/* - * Zone interfaces - */ -static inline struct page * -kmem_to_page(void *addr) -{ - if (is_vmalloc_addr(addr)) - return vmalloc_to_page(addr); - return virt_to_page(addr); -} - #endif /* __XFS_SUPPORT_KMEM_H__ */ diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index d7873e0360f0..666618b463c9 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -269,4 +269,15 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count, # define PTR_FMT "%p" #endif +/* + * Helper for IO routines to grab backing pages from allocated kernel memory. + */ +static inline struct page * +kmem_to_page(void *addr) +{ + if (is_vmalloc_addr(addr)) + return vmalloc_to_page(addr); + return virt_to_page(addr); +} + #endif /* __XFS_LINUX__ */