diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-26 15:38:11 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-30 09:19:38 -0400 |
| commit | 6739ffb754b47e6c0fa9d9e268bde828f6856528 (patch) | |
| tree | 2bb59f676758404f87954c5f631c816935064490 /include/linux/sunrpc | |
| parent | d7631250b20119ea763d9ba461c3a9c5710cfa98 (diff) | |
SUNRPC: Add a framework to clean up management of rpc_pipefs directories
The current system requires everyone to set up notifiers, manage directory
locking, etc.
What we really want to do is have the rpc_client create its directory,
and then create all the entries.
This patch will allow the RPCSEC_GSS and NFS code to register all the
objects that they want to have appear in the directory, and then have
the sunrpc code call them back to actually create/destroy their pipefs
dentries when the rpc_client creates/destroys the parent.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index b93b4aa49ffd..0dccd01ae2de 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/sunrpc/stats.h> | 21 | #include <linux/sunrpc/stats.h> |
| 22 | #include <linux/sunrpc/xdr.h> | 22 | #include <linux/sunrpc/xdr.h> |
| 23 | #include <linux/sunrpc/timer.h> | 23 | #include <linux/sunrpc/timer.h> |
| 24 | #include <linux/sunrpc/rpc_pipe_fs.h> | ||
| 24 | #include <asm/signal.h> | 25 | #include <asm/signal.h> |
| 25 | #include <linux/path.h> | 26 | #include <linux/path.h> |
| 26 | #include <net/ipv6.h> | 27 | #include <net/ipv6.h> |
| @@ -55,6 +56,7 @@ struct rpc_clnt { | |||
| 55 | 56 | ||
| 56 | int cl_nodelen; /* nodename length */ | 57 | int cl_nodelen; /* nodename length */ |
| 57 | char cl_nodename[UNX_MAXNODENAME]; | 58 | char cl_nodename[UNX_MAXNODENAME]; |
| 59 | struct rpc_pipe_dir_head cl_pipedir_objects; | ||
| 58 | struct dentry * cl_dentry; | 60 | struct dentry * cl_dentry; |
| 59 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 61 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 60 | struct rpc_rtt cl_rtt_default; | 62 | struct rpc_rtt cl_rtt_default; |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index aa5b582cc471..188e7fca67e1 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
| @@ -5,6 +5,26 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/workqueue.h> | 6 | #include <linux/workqueue.h> |
| 7 | 7 | ||
| 8 | struct rpc_pipe_dir_head { | ||
| 9 | struct list_head pdh_entries; | ||
| 10 | struct dentry *pdh_dentry; | ||
| 11 | }; | ||
| 12 | |||
| 13 | struct rpc_pipe_dir_object_ops; | ||
| 14 | struct rpc_pipe_dir_object { | ||
| 15 | struct list_head pdo_head; | ||
| 16 | const struct rpc_pipe_dir_object_ops *pdo_ops; | ||
| 17 | |||
| 18 | void *pdo_data; | ||
| 19 | }; | ||
| 20 | |||
| 21 | struct rpc_pipe_dir_object_ops { | ||
| 22 | int (*create)(struct dentry *dir, | ||
| 23 | struct rpc_pipe_dir_object *pdo); | ||
| 24 | void (*destroy)(struct dentry *dir, | ||
| 25 | struct rpc_pipe_dir_object *pdo); | ||
| 26 | }; | ||
| 27 | |||
| 8 | struct rpc_pipe_msg { | 28 | struct rpc_pipe_msg { |
| 9 | struct list_head list; | 29 | struct list_head list; |
| 10 | void *data; | 30 | void *data; |
| @@ -74,7 +94,18 @@ extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); | |||
| 74 | 94 | ||
| 75 | struct rpc_clnt; | 95 | struct rpc_clnt; |
| 76 | extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *); | 96 | extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *); |
| 77 | extern int rpc_remove_client_dir(struct dentry *); | 97 | extern int rpc_remove_client_dir(struct dentry *, struct rpc_clnt *); |
| 98 | |||
| 99 | extern void rpc_init_pipe_dir_head(struct rpc_pipe_dir_head *pdh); | ||
| 100 | extern void rpc_init_pipe_dir_object(struct rpc_pipe_dir_object *pdo, | ||
| 101 | const struct rpc_pipe_dir_object_ops *pdo_ops, | ||
| 102 | void *pdo_data); | ||
| 103 | extern int rpc_add_pipe_dir_object(struct net *net, | ||
| 104 | struct rpc_pipe_dir_head *pdh, | ||
| 105 | struct rpc_pipe_dir_object *pdo); | ||
| 106 | extern void rpc_remove_pipe_dir_object(struct net *net, | ||
| 107 | struct rpc_pipe_dir_head *pdh, | ||
| 108 | struct rpc_pipe_dir_object *pdo); | ||
| 78 | 109 | ||
| 79 | struct cache_detail; | 110 | struct cache_detail; |
| 80 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | 111 | extern struct dentry *rpc_create_cache_dir(struct dentry *, |
