0001 #ifndef _FS_NFSD_FILECACHE_H
0002 #define _FS_NFSD_FILECACHE_H
0003
0004 #include <linux/fsnotify_backend.h>
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 struct nfsd_file_mark {
0021 struct fsnotify_mark nfm_mark;
0022 refcount_t nfm_ref;
0023 };
0024
0025
0026
0027
0028
0029
0030
0031 struct nfsd_file {
0032 struct rhash_head nf_rhash;
0033 struct list_head nf_lru;
0034 struct rcu_head nf_rcu;
0035 struct file *nf_file;
0036 const struct cred *nf_cred;
0037 struct net *nf_net;
0038 #define NFSD_FILE_HASHED (0)
0039 #define NFSD_FILE_PENDING (1)
0040 #define NFSD_FILE_REFERENCED (2)
0041 unsigned long nf_flags;
0042 struct inode *nf_inode;
0043 refcount_t nf_ref;
0044 unsigned char nf_may;
0045 struct nfsd_file_mark *nf_mark;
0046 ktime_t nf_birthtime;
0047 };
0048
0049 int nfsd_file_cache_init(void);
0050 void nfsd_file_cache_purge(struct net *);
0051 void nfsd_file_cache_shutdown(void);
0052 int nfsd_file_cache_start_net(struct net *net);
0053 void nfsd_file_cache_shutdown_net(struct net *net);
0054 void nfsd_file_put(struct nfsd_file *nf);
0055 void nfsd_file_close(struct nfsd_file *nf);
0056 struct nfsd_file *nfsd_file_get(struct nfsd_file *nf);
0057 void nfsd_file_close_inode_sync(struct inode *inode);
0058 bool nfsd_file_is_cached(struct inode *inode);
0059 __be32 nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
0060 unsigned int may_flags, struct nfsd_file **nfp);
0061 __be32 nfsd_file_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
0062 unsigned int may_flags, struct nfsd_file **nfp);
0063 int nfsd_file_cache_stats_open(struct inode *, struct file *);
0064 #endif