Skip to content

Commit 26b433d

Browse files
jankaratorvalds
authored andcommitted
fscache: remove unused ->now_uncached callback
Patch series "Ranged pagevec lookup", v2. In this series I make pagevec_lookup() update the index (to be consistent with pagevec_lookup_tag() and also as a preparation for ranged lookups), provide ranged variant of pagevec_lookup() and use it in places where it makes sense. This not only removes some common code but is also a measurable performance win for some use cases (see patch 4/10) where radix tree is sparse and searching & grabing of a page after the end of the range has measurable overhead. This patch (of 10): The callback doesn't ever get called. Remove it. Link: http://lkml.kernel.org/r/20170726114704.7626-2-jack@suse.cz Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent db73ee0 commit 26b433d

7 files changed

Lines changed: 0 additions & 185 deletions

File tree

‎Documentation/filesystems/caching/netfs-api.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ To define an object, a structure of the following type should be filled out:
151151
void (*mark_pages_cached)(void *cookie_netfs_data,
152152
struct address_space *mapping,
153153
struct pagevec *cached_pvec);
154-
155-
void (*now_uncached)(void *cookie_netfs_data);
156154
};
157155

158156
This has the following fields:

‎fs/9p/cache.c‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -151,42 +151,13 @@ fscache_checkaux v9fs_cache_inode_check_aux(void *cookie_netfs_data,
151151
return FSCACHE_CHECKAUX_OKAY;
152152
}
153153

154-
static void v9fs_cache_inode_now_uncached(void *cookie_netfs_data)
155-
{
156-
struct v9fs_inode *v9inode = cookie_netfs_data;
157-
struct pagevec pvec;
158-
pgoff_t first;
159-
int loop, nr_pages;
160-
161-
pagevec_init(&pvec, 0);
162-
first = 0;
163-
164-
for (;;) {
165-
nr_pages = pagevec_lookup(&pvec, v9inode->vfs_inode.i_mapping,
166-
first,
167-
PAGEVEC_SIZE - pagevec_count(&pvec));
168-
if (!nr_pages)
169-
break;
170-
171-
for (loop = 0; loop < nr_pages; loop++)
172-
ClearPageFsCache(pvec.pages[loop]);
173-
174-
first = pvec.pages[nr_pages - 1]->index + 1;
175-
176-
pvec.nr = nr_pages;
177-
pagevec_release(&pvec);
178-
cond_resched();
179-
}
180-
}
181-
182154
const struct fscache_cookie_def v9fs_cache_inode_index_def = {
183155
.name = "9p.inode",
184156
.type = FSCACHE_COOKIE_TYPE_DATAFILE,
185157
.get_key = v9fs_cache_inode_get_key,
186158
.get_attr = v9fs_cache_inode_get_attr,
187159
.get_aux = v9fs_cache_inode_get_aux,
188160
.check_aux = v9fs_cache_inode_check_aux,
189-
.now_uncached = v9fs_cache_inode_now_uncached,
190161
};
191162

192163
void v9fs_cache_inode_get_cookie(struct inode *inode)

‎fs/afs/cache.c‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static uint16_t afs_vnode_cache_get_aux(const void *cookie_netfs_data,
3939
static enum fscache_checkaux afs_vnode_cache_check_aux(void *cookie_netfs_data,
4040
const void *buffer,
4141
uint16_t buflen);
42-
static void afs_vnode_cache_now_uncached(void *cookie_netfs_data);
4342

4443
struct fscache_netfs afs_cache_netfs = {
4544
.name = "afs",
@@ -75,7 +74,6 @@ struct fscache_cookie_def afs_vnode_cache_index_def = {
7574
.get_attr = afs_vnode_cache_get_attr,
7675
.get_aux = afs_vnode_cache_get_aux,
7776
.check_aux = afs_vnode_cache_check_aux,
78-
.now_uncached = afs_vnode_cache_now_uncached,
7977
};
8078

8179
/*
@@ -359,44 +357,3 @@ static enum fscache_checkaux afs_vnode_cache_check_aux(void *cookie_netfs_data,
359357
_leave(" = SUCCESS");
360358
return FSCACHE_CHECKAUX_OKAY;
361359
}
362-
363-
/*
364-
* indication the cookie is no longer uncached
365-
* - this function is called when the backing store currently caching a cookie
366-
* is removed
367-
* - the netfs should use this to clean up any markers indicating cached pages
368-
* - this is mandatory for any object that may have data
369-
*/
370-
static void afs_vnode_cache_now_uncached(void *cookie_netfs_data)
371-
{
372-
struct afs_vnode *vnode = cookie_netfs_data;
373-
struct pagevec pvec;
374-
pgoff_t first;
375-
int loop, nr_pages;
376-
377-
_enter("{%x,%x,%Lx}",
378-
vnode->fid.vnode, vnode->fid.unique, vnode->status.data_version);
379-
380-
pagevec_init(&pvec, 0);
381-
first = 0;
382-
383-
for (;;) {
384-
/* grab a bunch of pages to clean */
385-
nr_pages = pagevec_lookup(&pvec, vnode->vfs_inode.i_mapping,
386-
first,
387-
PAGEVEC_SIZE - pagevec_count(&pvec));
388-
if (!nr_pages)
389-
break;
390-
391-
for (loop = 0; loop < nr_pages; loop++)
392-
ClearPageFsCache(pvec.pages[loop]);
393-
394-
first = pvec.pages[nr_pages - 1]->index + 1;
395-
396-
pvec.nr = nr_pages;
397-
pagevec_release(&pvec);
398-
cond_resched();
399-
}
400-
401-
_leave("");
402-
}

‎fs/ceph/cache.c‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -194,44 +194,13 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux(
194194
return FSCACHE_CHECKAUX_OKAY;
195195
}
196196

197-
static void ceph_fscache_inode_now_uncached(void* cookie_netfs_data)
198-
{
199-
struct ceph_inode_info* ci = cookie_netfs_data;
200-
struct pagevec pvec;
201-
pgoff_t first;
202-
int loop, nr_pages;
203-
204-
pagevec_init(&pvec, 0);
205-
first = 0;
206-
207-
dout("ceph inode 0x%p now uncached", ci);
208-
209-
while (1) {
210-
nr_pages = pagevec_lookup(&pvec, ci->vfs_inode.i_mapping, first,
211-
PAGEVEC_SIZE - pagevec_count(&pvec));
212-
213-
if (!nr_pages)
214-
break;
215-
216-
for (loop = 0; loop < nr_pages; loop++)
217-
ClearPageFsCache(pvec.pages[loop]);
218-
219-
first = pvec.pages[nr_pages - 1]->index + 1;
220-
221-
pvec.nr = nr_pages;
222-
pagevec_release(&pvec);
223-
cond_resched();
224-
}
225-
}
226-
227197
static const struct fscache_cookie_def ceph_fscache_inode_object_def = {
228198
.name = "CEPH.inode",
229199
.type = FSCACHE_COOKIE_TYPE_DATAFILE,
230200
.get_key = ceph_fscache_inode_get_key,
231201
.get_attr = ceph_fscache_inode_get_attr,
232202
.get_aux = ceph_fscache_inode_get_aux,
233203
.check_aux = ceph_fscache_inode_check_aux,
234-
.now_uncached = ceph_fscache_inode_now_uncached,
235204
};
236205

237206
void ceph_fscache_register_inode_cookie(struct inode *inode)

‎fs/cifs/cache.c‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -292,42 +292,11 @@ fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data,
292292
return FSCACHE_CHECKAUX_OKAY;
293293
}
294294

295-
static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data)
296-
{
297-
struct cifsInodeInfo *cifsi = cookie_netfs_data;
298-
struct pagevec pvec;
299-
pgoff_t first;
300-
int loop, nr_pages;
301-
302-
pagevec_init(&pvec, 0);
303-
first = 0;
304-
305-
cifs_dbg(FYI, "%s: cifs inode 0x%p now uncached\n", __func__, cifsi);
306-
307-
for (;;) {
308-
nr_pages = pagevec_lookup(&pvec,
309-
cifsi->vfs_inode.i_mapping, first,
310-
PAGEVEC_SIZE - pagevec_count(&pvec));
311-
if (!nr_pages)
312-
break;
313-
314-
for (loop = 0; loop < nr_pages; loop++)
315-
ClearPageFsCache(pvec.pages[loop]);
316-
317-
first = pvec.pages[nr_pages - 1]->index + 1;
318-
319-
pvec.nr = nr_pages;
320-
pagevec_release(&pvec);
321-
cond_resched();
322-
}
323-
}
324-
325295
const struct fscache_cookie_def cifs_fscache_inode_object_def = {
326296
.name = "CIFS.uniqueid",
327297
.type = FSCACHE_COOKIE_TYPE_DATAFILE,
328298
.get_key = cifs_fscache_inode_get_key,
329299
.get_attr = cifs_fscache_inode_get_attr,
330300
.get_aux = cifs_fscache_inode_get_aux,
331301
.check_aux = cifs_fscache_inode_check_aux,
332-
.now_uncached = cifs_fscache_inode_now_uncached,
333302
};

‎fs/nfs/fscache-index.c‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -251,45 +251,6 @@ enum fscache_checkaux nfs_fscache_inode_check_aux(void *cookie_netfs_data,
251251
return FSCACHE_CHECKAUX_OKAY;
252252
}
253253

254-
/*
255-
* Indication from FS-Cache that the cookie is no longer cached
256-
* - This function is called when the backing store currently caching a cookie
257-
* is removed
258-
* - The netfs should use this to clean up any markers indicating cached pages
259-
* - This is mandatory for any object that may have data
260-
*/
261-
static void nfs_fscache_inode_now_uncached(void *cookie_netfs_data)
262-
{
263-
struct nfs_inode *nfsi = cookie_netfs_data;
264-
struct pagevec pvec;
265-
pgoff_t first;
266-
int loop, nr_pages;
267-
268-
pagevec_init(&pvec, 0);
269-
first = 0;
270-
271-
dprintk("NFS: nfs_inode_now_uncached: nfs_inode 0x%p\n", nfsi);
272-
273-
for (;;) {
274-
/* grab a bunch of pages to unmark */
275-
nr_pages = pagevec_lookup(&pvec,
276-
nfsi->vfs_inode.i_mapping,
277-
first,
278-
PAGEVEC_SIZE - pagevec_count(&pvec));
279-
if (!nr_pages)
280-
break;
281-
282-
for (loop = 0; loop < nr_pages; loop++)
283-
ClearPageFsCache(pvec.pages[loop]);
284-
285-
first = pvec.pages[nr_pages - 1]->index + 1;
286-
287-
pvec.nr = nr_pages;
288-
pagevec_release(&pvec);
289-
cond_resched();
290-
}
291-
}
292-
293254
/*
294255
* Get an extra reference on a read context.
295256
* - This function can be absent if the completion function doesn't require a
@@ -330,7 +291,6 @@ const struct fscache_cookie_def nfs_fscache_inode_object_def = {
330291
.get_attr = nfs_fscache_inode_get_attr,
331292
.get_aux = nfs_fscache_inode_get_aux,
332293
.check_aux = nfs_fscache_inode_check_aux,
333-
.now_uncached = nfs_fscache_inode_now_uncached,
334294
.get_context = nfs_fh_get_context,
335295
.put_context = nfs_fh_put_context,
336296
};

‎include/linux/fscache.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ struct fscache_cookie_def {
143143
void (*mark_page_cached)(void *cookie_netfs_data,
144144
struct address_space *mapping,
145145
struct page *page);
146-
147-
/* indicate the cookie is no longer cached
148-
* - this function is called when the backing store currently caching
149-
* a cookie is removed
150-
* - the netfs should use this to clean up any markers indicating
151-
* cached pages
152-
* - this is mandatory for any object that may have data
153-
*/
154-
void (*now_uncached)(void *cookie_netfs_data);
155146
};
156147

157148
/*

0 commit comments

Comments
 (0)