blob: 220ee409abc46d80d5144414efb135a3eda265fd [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Trond Myklebuste571cbf2009-08-19 18:12:27 -04002/*
3 * Helper routines for the NFS client caches
4 *
5 * Copyright (c) 2009 Trond Myklebust <Trond.Myklebust@netapp.com>
6 */
7
8#include <linux/completion.h>
9#include <linux/sunrpc/cache.h>
Arun Sharma600634972011-07-26 16:09:06 -070010#include <linux/atomic.h>
Trond Myklebuste571cbf2009-08-19 18:12:27 -040011
12/*
13 * Deferred request handling
14 */
15struct nfs_cache_defer_req {
16 struct cache_req req;
17 struct cache_deferred_req deferred_req;
18 struct completion completion;
Elena Reshetova0896cad2017-10-20 12:53:35 +030019 refcount_t count;
Trond Myklebuste571cbf2009-08-19 18:12:27 -040020};
21
22extern int nfs_cache_upcall(struct cache_detail *cd, char *entry_name);
23extern struct nfs_cache_defer_req *nfs_cache_defer_req_alloc(void);
24extern void nfs_cache_defer_req_put(struct nfs_cache_defer_req *dreq);
25extern int nfs_cache_wait_for_upcall(struct nfs_cache_defer_req *dreq);
26
Stanislav Kinsbursky5c1cacb2011-11-25 17:12:56 +030027extern int nfs_cache_register_net(struct net *net, struct cache_detail *cd);
28extern void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd);
Stanislav Kinsbursky9df69c82011-11-25 17:13:12 +030029extern int nfs_cache_register_sb(struct super_block *sb,
30 struct cache_detail *cd);
31extern void nfs_cache_unregister_sb(struct super_block *sb,
32 struct cache_detail *cd);