diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:14:30 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:14:30 -0400 |
commit | 8854e82d9accc80f43c0bc3ff06b5979ac858185 (patch) | |
tree | 957a42c2959e52f9df2acd7a23c10bf5d6cbeaf0 /include | |
parent | 173912a6add00f4715774dcecf9ee53274c5924c (diff) |
SUNRPC: Add an rpc_pipefs front end for the sunrpc cache code
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/cache.h | 13 | ||||
-rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 8e5bf3036652..6f52b4d7c447 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -64,6 +64,10 @@ struct cache_detail_procfs { | |||
64 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; | 64 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct cache_detail_pipefs { | ||
68 | struct dentry *dir; | ||
69 | }; | ||
70 | |||
67 | struct cache_detail { | 71 | struct cache_detail { |
68 | struct module * owner; | 72 | struct module * owner; |
69 | int hash_size; | 73 | int hash_size; |
@@ -110,6 +114,7 @@ struct cache_detail { | |||
110 | 114 | ||
111 | union { | 115 | union { |
112 | struct cache_detail_procfs procfs; | 116 | struct cache_detail_procfs procfs; |
117 | struct cache_detail_pipefs pipefs; | ||
113 | } u; | 118 | } u; |
114 | }; | 119 | }; |
115 | 120 | ||
@@ -135,6 +140,10 @@ struct cache_deferred_req { | |||
135 | }; | 140 | }; |
136 | 141 | ||
137 | 142 | ||
143 | extern const struct file_operations cache_file_operations_pipefs; | ||
144 | extern const struct file_operations content_file_operations_pipefs; | ||
145 | extern const struct file_operations cache_flush_operations_pipefs; | ||
146 | |||
138 | extern struct cache_head * | 147 | extern struct cache_head * |
139 | sunrpc_cache_lookup(struct cache_detail *detail, | 148 | sunrpc_cache_lookup(struct cache_detail *detail, |
140 | struct cache_head *key, int hash); | 149 | struct cache_head *key, int hash); |
@@ -186,6 +195,10 @@ extern void cache_purge(struct cache_detail *detail); | |||
186 | extern int cache_register(struct cache_detail *cd); | 195 | extern int cache_register(struct cache_detail *cd); |
187 | extern void cache_unregister(struct cache_detail *cd); | 196 | extern void cache_unregister(struct cache_detail *cd); |
188 | 197 | ||
198 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, | ||
199 | mode_t, struct cache_detail *); | ||
200 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); | ||
201 | |||
189 | extern void qword_add(char **bpp, int *lp, char *str); | 202 | extern void qword_add(char **bpp, int *lp, char *str); |
190 | extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); | 203 | extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); |
191 | extern int qword_get(char **bpp, char *dest, int bufsize); | 204 | extern int qword_get(char **bpp, char *dest, int bufsize); |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 88332ef1e959..a92571a34556 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -47,6 +47,14 @@ extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | |||
47 | struct rpc_clnt; | 47 | struct rpc_clnt; |
48 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); | 48 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); |
49 | extern int rpc_remove_client_dir(struct dentry *); | 49 | extern int rpc_remove_client_dir(struct dentry *); |
50 | |||
51 | struct cache_detail; | ||
52 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | ||
53 | struct qstr *, | ||
54 | mode_t umode, | ||
55 | struct cache_detail *); | ||
56 | extern void rpc_remove_cache_dir(struct dentry *); | ||
57 | |||
50 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, | 58 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, |
51 | const struct rpc_pipe_ops *, int flags); | 59 | const struct rpc_pipe_ops *, int flags); |
52 | extern int rpc_unlink(struct dentry *); | 60 | extern int rpc_unlink(struct dentry *); |