1*e571cbf1STrond Myklebust /* 2*e571cbf1STrond Myklebust * Helper routines for the NFS client caches 3*e571cbf1STrond Myklebust * 4*e571cbf1STrond Myklebust * Copyright (c) 2009 Trond Myklebust <Trond.Myklebust@netapp.com> 5*e571cbf1STrond Myklebust */ 6*e571cbf1STrond Myklebust 7*e571cbf1STrond Myklebust #include <linux/completion.h> 8*e571cbf1STrond Myklebust #include <linux/sunrpc/cache.h> 9*e571cbf1STrond Myklebust #include <asm/atomic.h> 10*e571cbf1STrond Myklebust 11*e571cbf1STrond Myklebust /* 12*e571cbf1STrond Myklebust * Deferred request handling 13*e571cbf1STrond Myklebust */ 14*e571cbf1STrond Myklebust struct nfs_cache_defer_req { 15*e571cbf1STrond Myklebust struct cache_req req; 16*e571cbf1STrond Myklebust struct cache_deferred_req deferred_req; 17*e571cbf1STrond Myklebust struct completion completion; 18*e571cbf1STrond Myklebust atomic_t count; 19*e571cbf1STrond Myklebust }; 20*e571cbf1STrond Myklebust 21*e571cbf1STrond Myklebust extern int nfs_cache_upcall(struct cache_detail *cd, char *entry_name); 22*e571cbf1STrond Myklebust extern struct nfs_cache_defer_req *nfs_cache_defer_req_alloc(void); 23*e571cbf1STrond Myklebust extern void nfs_cache_defer_req_put(struct nfs_cache_defer_req *dreq); 24*e571cbf1STrond Myklebust extern int nfs_cache_wait_for_upcall(struct nfs_cache_defer_req *dreq); 25*e571cbf1STrond Myklebust 26*e571cbf1STrond Myklebust extern int nfs_cache_register(struct cache_detail *cd); 27*e571cbf1STrond Myklebust extern void nfs_cache_unregister(struct cache_detail *cd); 28