Skip to content

Commit b533a83

Browse files
committed
netfs, mm: Move PG_fscache helper funcs to linux/netfs.h
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 <dhowells@redhat.com> Tested-by: Jeff Layton <jlayton@kernel.org> Tested-by: Dave Wysochanski <dwysocha@redhat.com> Tested-By: Marc Dionne <marc.dionne@auristor.com> cc: Matthew Wilcox <willy@infradead.org> 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 Link: https://lore.kernel.org/r/161789073997.6155.18442271115255650614.stgit@warthog.procyon.org.uk/ # v6
1 parent fb28afc commit b533a83

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

include/linux/fscache.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/pagemap.h>
2020
#include <linux/pagevec.h>
2121
#include <linux/list_bl.h>
22+
#include <linux/netfs.h>
2223

2324
#if defined(CONFIG_FSCACHE) || defined(CONFIG_FSCACHE_MODULE)
2425
#define fscache_available() (1)
@@ -29,16 +30,6 @@
2930
#endif
3031

3132

32-
/*
33-
* overload PG_private_2 to give us PG_fscache - this is used to indicate that
34-
* a page is currently backed by a local disk cache
35-
*/
36-
#define PageFsCache(page) PagePrivate2((page))
37-
#define SetPageFsCache(page) SetPagePrivate2((page))
38-
#define ClearPageFsCache(page) ClearPagePrivate2((page))
39-
#define TestSetPageFsCache(page) TestSetPagePrivate2((page))
40-
#define TestClearPageFsCache(page) TestClearPagePrivate2((page))
41-
4233
/* pattern used to fill dead space in an index entry */
4334
#define FSCACHE_INDEX_DEADFILL_PATTERN 0x79
4435

include/linux/netfs.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/* Network filesystem support services.
3+
*
4+
* Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
5+
* Written by David Howells (dhowells@redhat.com)
6+
*
7+
* See:
8+
*
9+
* Documentation/filesystems/netfs_library.rst
10+
*
11+
* for a description of the network filesystem interface declared here.
12+
*/
13+
14+
#ifndef _LINUX_NETFS_H
15+
#define _LINUX_NETFS_H
16+
17+
#include <linux/pagemap.h>
18+
19+
/*
20+
* Overload PG_private_2 to give us PG_fscache - this is used to indicate that
21+
* a page is currently backed by a local disk cache
22+
*/
23+
#define PageFsCache(page) PagePrivate2((page))
24+
#define SetPageFsCache(page) SetPagePrivate2((page))
25+
#define ClearPageFsCache(page) ClearPagePrivate2((page))
26+
#define TestSetPageFsCache(page) TestSetPagePrivate2((page))
27+
#define TestClearPageFsCache(page) TestClearPagePrivate2((page))
28+
29+
#endif /* _LINUX_NETFS_H */

0 commit comments

Comments
 (0)