/* SPDX-License-Identifier: GPL-2.0 */ /* * Request reply cache. This was heavily inspired by the * implementation in 4.3BSD/4.4BSD. * * Copyright (C) 1995, 1996 Olaf Kirch <[email protected]> */ #ifndef NFSCACHE_H #define NFSCACHE_H #include <linux/sunrpc/svc.h> #include "netns.h" /* * Representation of a reply cache entry. * * Note that we use a sockaddr_in6 to hold the address instead of the more * typical sockaddr_storage. This is for space reasons, since sockaddr_storage * is much larger than a sockaddr_in6. */ struct nfsd_cacherep { … }; #define c_replvec … #define c_replstat … /* cache entry states */ enum { … }; /* return values */ enum { … }; /* * Cache types. * We may want to add more types one day, e.g. for diropres and * attrstat replies. Using cache entries with fixed length instead * of buffer pointers may be more efficient. */ enum { … }; /* Cache entries expire after this time period */ #define RC_EXPIRE … /* Checksum this amount of the request */ #define RC_CSUMLEN … int nfsd_drc_slab_create(void); void nfsd_drc_slab_free(void); int nfsd_reply_cache_init(struct nfsd_net *); void nfsd_reply_cache_shutdown(struct nfsd_net *); int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start, unsigned int len, struct nfsd_cacherep **cacherep); void nfsd_cache_update(struct svc_rqst *rqstp, struct nfsd_cacherep *rp, int cachetype, __be32 *statp); int nfsd_reply_cache_stats_show(struct seq_file *m, void *v); #endif /* NFSCACHE_H */