Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp483554pxf; Thu, 8 Apr 2021 07:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7ZpsNOAZq+YR3N498sH5b87DHrcnEuq/CT/cerBcq8o21k4wYe+GDLgRgZ7QOuyDGUHKF X-Received: by 2002:a17:906:d8a3:: with SMTP id qc3mr10578375ejb.353.1617890899360; Thu, 08 Apr 2021 07:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617890899; cv=none; d=google.com; s=arc-20160816; b=HgiLTS76lyR7IaOFBCxf2QeKRWvKzzWjP2k4Ebw+h72j/AvCPlBUpHebhhro9uItV/ 7umKO84RJ4xd5RuoZEoNbcgIN5Tr2qcSypWnMMWKoIkEdv0PimjSIpZ5HvZxtw/DruIn vvXr+9pBdxIHNBXgIxrDwH/ymFNn6BedU05zp/6dKecy6JsayJ3FplCWO3syKSBGY8X+ He3By+yhmpeDImV9RxEOKDnnGKzzn8OrD6HoKlBbmbIbhZGhFfpHC2JnqM4mxA08EGgF SLQWDgVBItjd5XquQQh8UVzfDPN4xDHBH20lrn5prusVBLR+D9McajStz7p7S9Y1zboq W5Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:dkim-signature; bh=fg86JDBwcP16Fxsll9BDaoEjPdAbfzTLfHbNsyUbw0c=; b=V7zPFsPsb91+MbVcaDgEArRcwpXbeFQVqZ4UXFoFdSmuxqmSD3LPYwYIt0ruXfaSkr D/vLz8QHbIbuaeoNbGOPTq2mEHNCcNqcQrlzaO364rGP40uyI5C4bPhmgR1SW2GeEk1F kPf7/UnTgLvG0S/hYUrKKgun9xrpIzM9q2VU16PXM/I9icuL3RJRbrieoYyMFMP8jFkM Ofp7DeqnW4hmW6cKoSn//t6uZEhxqiBsMVXd8d6Ivgb9UnBiHw+uiczSZX3ueDEBSuhX ia3zk61ruq6l8V++hYeTDxEYJ/65CxT52F62NRNhBSbhh//XAoilH5VEOSpGXx+tmXlo Bsxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cT6I8e74; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si10862317ejy.108.2021.04.08.07.07.56; Thu, 08 Apr 2021 07:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cT6I8e74; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbhDHOGL (ORCPT + 99 others); Thu, 8 Apr 2021 10:06:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48469 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbhDHOGD (ORCPT ); Thu, 8 Apr 2021 10:06:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617890751; h=from:from: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; bh=fg86JDBwcP16Fxsll9BDaoEjPdAbfzTLfHbNsyUbw0c=; b=cT6I8e74T6ETuHxgKF3bhJTaWRZ7HPMQhx8xmWXt/gmg3yD3mHTGNll0cPvhDzY7D1Iljz 64r0DVVuo/oq+16M+gcNq1MXgetHk473SQ14E9Ugdaz47S2CD7Vv3MlL6vHymNYlui/L9f q4xaelVk7tTcr2I3657xxR+kI10DYFQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-5PAP6V_0NAK9U1tl3ISQOg-1; Thu, 08 Apr 2021 10:05:50 -0400 X-MC-Unique: 5PAP6V_0NAK9U1tl3ISQOg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B57A188353E; Thu, 8 Apr 2021 14:05:48 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-119-35.rdu2.redhat.com [10.10.119.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id C975A5D9CC; Thu, 8 Apr 2021 14:05:40 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH v6 08/30] netfs, mm: Move PG_fscache helper funcs to linux/netfs.h From: David Howells To: linux-fsdevel@vger.kernel.org Cc: Matthew Wilcox , linux-mm@kvack.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, dhowells@redhat.com, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , David Wysochanski , "Matthew Wilcox (Oracle)" , Alexander Viro , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Thu, 08 Apr 2021 15:05:39 +0100 Message-ID: <161789073997.6155.18442271115255650614.stgit@warthog.procyon.org.uk> In-Reply-To: <161789062190.6155.12711584466338493050.stgit@warthog.procyon.org.uk> References: <161789062190.6155.12711584466338493050.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Move the PG_fscache related helper funcs (such as SetPageFsCache()) to linux/netfs.h rather than linux/fscache.h as the intention is to move to a model where they're used by the network filesystem and the helper library, but not by fscache/cachefiles itself. Signed-off-by: David Howells cc: Matthew Wilcox cc: linux-mm@kvack.org cc: linux-cachefs@redhat.com cc: linux-afs@lists.infradead.org cc: linux-nfs@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: v9fs-developer@lists.sourceforge.net cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/161340392347.1303470.18065131603507621762.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/161539534516.286939.6265142985563005000.stgit@warthog.procyon.org.uk/ # v4 Link: https://lore.kernel.org/r/161653792959.2770958.5386546945273988117.stgit@warthog.procyon.org.uk/ # v5 --- include/linux/fscache.h | 11 +---------- include/linux/netfs.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 include/linux/netfs.h diff --git a/include/linux/fscache.h b/include/linux/fscache.h index a1c928fe98e7..1f8dc72369ee 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -19,6 +19,7 @@ #include #include #include +#include #if defined(CONFIG_FSCACHE) || defined(CONFIG_FSCACHE_MODULE) #define fscache_available() (1) @@ -29,16 +30,6 @@ #endif -/* - * overload PG_private_2 to give us PG_fscache - this is used to indicate that - * a page is currently backed by a local disk cache - */ -#define PageFsCache(page) PagePrivate2((page)) -#define SetPageFsCache(page) SetPagePrivate2((page)) -#define ClearPageFsCache(page) ClearPagePrivate2((page)) -#define TestSetPageFsCache(page) TestSetPagePrivate2((page)) -#define TestClearPageFsCache(page) TestClearPagePrivate2((page)) - /* pattern used to fill dead space in an index entry */ #define FSCACHE_INDEX_DEADFILL_PATTERN 0x79 diff --git a/include/linux/netfs.h b/include/linux/netfs.h new file mode 100644 index 000000000000..cc1102040488 --- /dev/null +++ b/include/linux/netfs.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* Network filesystem support services. + * + * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * See: + * + * Documentation/filesystems/netfs_library.rst + * + * for a description of the network filesystem interface declared here. + */ + +#ifndef _LINUX_NETFS_H +#define _LINUX_NETFS_H + +#include + +/* + * Overload PG_private_2 to give us PG_fscache - this is used to indicate that + * a page is currently backed by a local disk cache + */ +#define PageFsCache(page) PagePrivate2((page)) +#define SetPageFsCache(page) SetPagePrivate2((page)) +#define ClearPageFsCache(page) ClearPagePrivate2((page)) +#define TestSetPageFsCache(page) TestSetPagePrivate2((page)) +#define TestClearPageFsCache(page) TestClearPagePrivate2((page)) + +#endif /* _LINUX_NETFS_H */