|
21 | 21 |
|
22 | 22 | enum netfs_sreq_ref_trace; |
23 | 23 |
|
24 | | -/* |
25 | | - * Overload PG_private_2 to give us PG_fscache - this is used to indicate that |
26 | | - * a page is currently backed by a local disk cache |
27 | | - */ |
28 | | -#define folio_test_fscache(folio) folio_test_private_2(folio) |
29 | | -#define PageFsCache(page) PagePrivate2((page)) |
30 | | -#define SetPageFsCache(page) SetPagePrivate2((page)) |
31 | | -#define ClearPageFsCache(page) ClearPagePrivate2((page)) |
32 | | -#define TestSetPageFsCache(page) TestSetPagePrivate2((page)) |
33 | | -#define TestClearPageFsCache(page) TestClearPagePrivate2((page)) |
34 | | - |
35 | 24 | /** |
36 | | - * folio_start_fscache - Start an fscache write on a folio. |
| 25 | + * folio_start_private_2 - Start an fscache write on a folio. [DEPRECATED] |
37 | 26 | * @folio: The folio. |
38 | 27 | * |
39 | 28 | * Call this function before writing a folio to a local cache. Starting a |
40 | 29 | * second write before the first one finishes is not allowed. |
| 30 | + * |
| 31 | + * Note that this should no longer be used. |
41 | 32 | */ |
42 | | -static inline void folio_start_fscache(struct folio *folio) |
| 33 | +static inline void folio_start_private_2(struct folio *folio) |
43 | 34 | { |
44 | 35 | VM_BUG_ON_FOLIO(folio_test_private_2(folio), folio); |
45 | 36 | folio_get(folio); |
46 | 37 | folio_set_private_2(folio); |
47 | 38 | } |
48 | 39 |
|
49 | | -/** |
50 | | - * folio_end_fscache - End an fscache write on a folio. |
51 | | - * @folio: The folio. |
52 | | - * |
53 | | - * Call this function after the folio has been written to the local cache. |
54 | | - * This will wake any sleepers waiting on this folio. |
55 | | - */ |
56 | | -static inline void folio_end_fscache(struct folio *folio) |
57 | | -{ |
58 | | - folio_end_private_2(folio); |
59 | | -} |
60 | | - |
61 | | -/** |
62 | | - * folio_wait_fscache - Wait for an fscache write on this folio to end. |
63 | | - * @folio: The folio. |
64 | | - * |
65 | | - * If this folio is currently being written to a local cache, wait for |
66 | | - * the write to finish. Another write may start after this one finishes, |
67 | | - * unless the caller holds the folio lock. |
68 | | - */ |
69 | | -static inline void folio_wait_fscache(struct folio *folio) |
70 | | -{ |
71 | | - folio_wait_private_2(folio); |
72 | | -} |
73 | | - |
74 | | -/** |
75 | | - * folio_wait_fscache_killable - Wait for an fscache write on this folio to end. |
76 | | - * @folio: The folio. |
77 | | - * |
78 | | - * If this folio is currently being written to a local cache, wait |
79 | | - * for the write to finish or for a fatal signal to be received. |
80 | | - * Another write may start after this one finishes, unless the caller |
81 | | - * holds the folio lock. |
82 | | - * |
83 | | - * Return: |
84 | | - * - 0 if successful. |
85 | | - * - -EINTR if a fatal signal was encountered. |
86 | | - */ |
87 | | -static inline int folio_wait_fscache_killable(struct folio *folio) |
88 | | -{ |
89 | | - return folio_wait_private_2_killable(folio); |
90 | | -} |
91 | | - |
92 | | -static inline void set_page_fscache(struct page *page) |
93 | | -{ |
94 | | - folio_start_fscache(page_folio(page)); |
95 | | -} |
96 | | - |
97 | | -static inline void end_page_fscache(struct page *page) |
98 | | -{ |
99 | | - folio_end_private_2(page_folio(page)); |
100 | | -} |
101 | | - |
102 | | -static inline void wait_on_page_fscache(struct page *page) |
103 | | -{ |
104 | | - folio_wait_private_2(page_folio(page)); |
105 | | -} |
106 | | - |
107 | | -static inline int wait_on_page_fscache_killable(struct page *page) |
108 | | -{ |
109 | | - return folio_wait_private_2_killable(page_folio(page)); |
110 | | -} |
111 | | - |
112 | 40 | /* Marks used on xarray-based buffers */ |
113 | 41 | #define NETFS_BUF_PUT_MARK XA_MARK_0 /* - Page needs putting */ |
114 | 42 | #define NETFS_BUF_PAGECACHE_MARK XA_MARK_1 /* - Page needs wb/dirty flag wrangling */ |
|
0 commit comments