diff options
| author | Eric Paris <eparis@redhat.com> | 2013-11-22 18:57:08 -0500 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2013-11-22 18:57:54 -0500 |
| commit | fc582aef7dcc27a7120cf232c1e76c569c7b6eab (patch) | |
| tree | 7d275dd4ceab6067b91e9a25a5f6338b425fbccd /include/linux/sunrpc | |
| parent | 9175c9d2aed528800175ef81c90569d00d23f9be (diff) | |
| parent | 5e01dc7b26d9f24f39abace5da98ccbd6a5ceb52 (diff) | |
Merge tag 'v3.12'
Linux 3.12
Conflicts:
fs/exec.c
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/auth.h | 28 | ||||
| -rw-r--r-- | include/linux/sunrpc/cache.h | 22 | ||||
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 6 | ||||
| -rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 39 | ||||
| -rw-r--r-- | include/linux/sunrpc/sched.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 1 |
6 files changed, 86 insertions, 12 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 0dd00f4f6810..790be1472792 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -24,12 +24,21 @@ | |||
| 24 | 24 | ||
| 25 | struct rpcsec_gss_info; | 25 | struct rpcsec_gss_info; |
| 26 | 26 | ||
| 27 | /* auth_cred ac_flags bits */ | ||
| 28 | enum { | ||
| 29 | RPC_CRED_NO_CRKEY_TIMEOUT = 0, /* underlying cred has no key timeout */ | ||
| 30 | RPC_CRED_KEY_EXPIRE_SOON = 1, /* underlying cred key will expire soon */ | ||
| 31 | RPC_CRED_NOTIFY_TIMEOUT = 2, /* nofity generic cred when underlying | ||
| 32 | key will expire soon */ | ||
| 33 | }; | ||
| 34 | |||
| 27 | /* Work around the lack of a VFS credential */ | 35 | /* Work around the lack of a VFS credential */ |
| 28 | struct auth_cred { | 36 | struct auth_cred { |
| 29 | kuid_t uid; | 37 | kuid_t uid; |
| 30 | kgid_t gid; | 38 | kgid_t gid; |
| 31 | struct group_info *group_info; | 39 | struct group_info *group_info; |
| 32 | const char *principal; | 40 | const char *principal; |
| 41 | unsigned long ac_flags; | ||
| 33 | unsigned char machine_cred : 1; | 42 | unsigned char machine_cred : 1; |
| 34 | }; | 43 | }; |
| 35 | 44 | ||
| @@ -87,6 +96,11 @@ struct rpc_auth { | |||
| 87 | /* per-flavor data */ | 96 | /* per-flavor data */ |
| 88 | }; | 97 | }; |
| 89 | 98 | ||
| 99 | struct rpc_auth_create_args { | ||
| 100 | rpc_authflavor_t pseudoflavor; | ||
| 101 | const char *target_name; | ||
| 102 | }; | ||
| 103 | |||
| 90 | /* Flags for rpcauth_lookupcred() */ | 104 | /* Flags for rpcauth_lookupcred() */ |
| 91 | #define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ | 105 | #define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ |
| 92 | 106 | ||
| @@ -97,17 +111,17 @@ struct rpc_authops { | |||
| 97 | struct module *owner; | 111 | struct module *owner; |
| 98 | rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */ | 112 | rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */ |
| 99 | char * au_name; | 113 | char * au_name; |
| 100 | struct rpc_auth * (*create)(struct rpc_clnt *, rpc_authflavor_t); | 114 | struct rpc_auth * (*create)(struct rpc_auth_create_args *, struct rpc_clnt *); |
| 101 | void (*destroy)(struct rpc_auth *); | 115 | void (*destroy)(struct rpc_auth *); |
| 102 | 116 | ||
| 103 | struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); | 117 | struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); |
| 104 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); | 118 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); |
| 105 | int (*pipes_create)(struct rpc_auth *); | ||
| 106 | void (*pipes_destroy)(struct rpc_auth *); | ||
| 107 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); | 119 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); |
| 108 | rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); | 120 | rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); |
| 109 | int (*flavor2info)(rpc_authflavor_t, | 121 | int (*flavor2info)(rpc_authflavor_t, |
| 110 | struct rpcsec_gss_info *); | 122 | struct rpcsec_gss_info *); |
| 123 | int (*key_timeout)(struct rpc_auth *, | ||
| 124 | struct rpc_cred *); | ||
| 111 | }; | 125 | }; |
| 112 | 126 | ||
| 113 | struct rpc_credops { | 127 | struct rpc_credops { |
| @@ -124,6 +138,8 @@ struct rpc_credops { | |||
| 124 | void *, __be32 *, void *); | 138 | void *, __be32 *, void *); |
| 125 | int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t, | 139 | int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t, |
| 126 | void *, __be32 *, void *); | 140 | void *, __be32 *, void *); |
| 141 | int (*crkey_timeout)(struct rpc_cred *); | ||
| 142 | bool (*crkey_to_expire)(struct rpc_cred *); | ||
| 127 | }; | 143 | }; |
| 128 | 144 | ||
| 129 | extern const struct rpc_authops authunix_ops; | 145 | extern const struct rpc_authops authunix_ops; |
| @@ -140,7 +156,8 @@ struct rpc_cred * rpc_lookup_cred(void); | |||
| 140 | struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); | 156 | struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); |
| 141 | int rpcauth_register(const struct rpc_authops *); | 157 | int rpcauth_register(const struct rpc_authops *); |
| 142 | int rpcauth_unregister(const struct rpc_authops *); | 158 | int rpcauth_unregister(const struct rpc_authops *); |
| 143 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 159 | struct rpc_auth * rpcauth_create(struct rpc_auth_create_args *, |
| 160 | struct rpc_clnt *); | ||
| 144 | void rpcauth_release(struct rpc_auth *); | 161 | void rpcauth_release(struct rpc_auth *); |
| 145 | rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t, | 162 | rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t, |
| 146 | struct rpcsec_gss_info *); | 163 | struct rpcsec_gss_info *); |
| @@ -162,6 +179,9 @@ int rpcauth_uptodatecred(struct rpc_task *); | |||
| 162 | int rpcauth_init_credcache(struct rpc_auth *); | 179 | int rpcauth_init_credcache(struct rpc_auth *); |
| 163 | void rpcauth_destroy_credcache(struct rpc_auth *); | 180 | void rpcauth_destroy_credcache(struct rpc_auth *); |
| 164 | void rpcauth_clear_credcache(struct rpc_cred_cache *); | 181 | void rpcauth_clear_credcache(struct rpc_cred_cache *); |
| 182 | int rpcauth_key_timeout_notify(struct rpc_auth *, | ||
| 183 | struct rpc_cred *); | ||
| 184 | bool rpcauth_cred_key_to_expire(struct rpc_cred *); | ||
| 165 | 185 | ||
| 166 | static inline | 186 | static inline |
| 167 | struct rpc_cred * get_rpccred(struct rpc_cred *cred) | 187 | struct rpc_cred * get_rpccred(struct rpc_cred *cred) |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6ce690de447f..437ddb6c4aef 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -264,12 +264,30 @@ static inline int get_uint(char **bpp, unsigned int *anint) | |||
| 264 | return 0; | 264 | return 0; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | static inline int get_time(char **bpp, time_t *time) | ||
| 268 | { | ||
| 269 | char buf[50]; | ||
| 270 | long long ll; | ||
| 271 | int len = qword_get(bpp, buf, sizeof(buf)); | ||
| 272 | |||
| 273 | if (len < 0) | ||
| 274 | return -EINVAL; | ||
| 275 | if (len == 0) | ||
| 276 | return -ENOENT; | ||
| 277 | |||
| 278 | if (kstrtoll(buf, 0, &ll)) | ||
| 279 | return -EINVAL; | ||
| 280 | |||
| 281 | *time = (time_t)ll; | ||
| 282 | return 0; | ||
| 283 | } | ||
| 284 | |||
| 267 | static inline time_t get_expiry(char **bpp) | 285 | static inline time_t get_expiry(char **bpp) |
| 268 | { | 286 | { |
| 269 | int rv; | 287 | time_t rv; |
| 270 | struct timespec boot; | 288 | struct timespec boot; |
| 271 | 289 | ||
| 272 | if (get_int(bpp, &rv)) | 290 | if (get_time(bpp, &rv)) |
| 273 | return 0; | 291 | return 0; |
| 274 | if (rv < 0) | 292 | if (rv < 0) |
| 275 | return 0; | 293 | return 0; |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index bfe11be81f6f..6740801aa71a 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> |
| @@ -32,6 +33,7 @@ struct rpc_inode; | |||
| 32 | */ | 33 | */ |
| 33 | struct rpc_clnt { | 34 | struct rpc_clnt { |
| 34 | atomic_t cl_count; /* Number of references */ | 35 | atomic_t cl_count; /* Number of references */ |
| 36 | unsigned int cl_clid; /* client id */ | ||
| 35 | struct list_head cl_clients; /* Global list of clients */ | 37 | struct list_head cl_clients; /* Global list of clients */ |
| 36 | struct list_head cl_tasks; /* List of tasks */ | 38 | struct list_head cl_tasks; /* List of tasks */ |
| 37 | spinlock_t cl_lock; /* spinlock */ | 39 | spinlock_t cl_lock; /* spinlock */ |
| @@ -41,7 +43,6 @@ struct rpc_clnt { | |||
| 41 | cl_vers, /* RPC version number */ | 43 | cl_vers, /* RPC version number */ |
| 42 | cl_maxproc; /* max procedure number */ | 44 | cl_maxproc; /* max procedure number */ |
| 43 | 45 | ||
| 44 | const char * cl_protname; /* protocol name */ | ||
| 45 | struct rpc_auth * cl_auth; /* authenticator */ | 46 | struct rpc_auth * cl_auth; /* authenticator */ |
| 46 | struct rpc_stat * cl_stats; /* per-program statistics */ | 47 | struct rpc_stat * cl_stats; /* per-program statistics */ |
| 47 | struct rpc_iostats * cl_metrics; /* per-client statistics */ | 48 | struct rpc_iostats * cl_metrics; /* per-client statistics */ |
| @@ -56,12 +57,11 @@ struct rpc_clnt { | |||
| 56 | 57 | ||
| 57 | int cl_nodelen; /* nodename length */ | 58 | int cl_nodelen; /* nodename length */ |
| 58 | char cl_nodename[UNX_MAXNODENAME]; | 59 | char cl_nodename[UNX_MAXNODENAME]; |
| 59 | struct dentry * cl_dentry; | 60 | struct rpc_pipe_dir_head cl_pipedir_objects; |
| 60 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 61 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 61 | struct rpc_rtt cl_rtt_default; | 62 | struct rpc_rtt cl_rtt_default; |
| 62 | struct rpc_timeout cl_timeout_default; | 63 | struct rpc_timeout cl_timeout_default; |
| 63 | const struct rpc_program *cl_program; | 64 | const struct rpc_program *cl_program; |
| 64 | char *cl_principal; /* target to authenticate to */ | ||
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | /* | 67 | /* |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index aa5b582cc471..a353e0300b54 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,24 @@ 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 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); | ||
| 109 | extern struct rpc_pipe_dir_object *rpc_find_or_alloc_pipe_dir_object( | ||
| 110 | struct net *net, | ||
| 111 | struct rpc_pipe_dir_head *pdh, | ||
| 112 | int (*match)(struct rpc_pipe_dir_object *, void *), | ||
| 113 | struct rpc_pipe_dir_object *(*alloc)(void *), | ||
| 114 | void *data); | ||
| 78 | 115 | ||
| 79 | struct cache_detail; | 116 | struct cache_detail; |
| 80 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | 117 | extern struct dentry *rpc_create_cache_dir(struct dentry *, |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 1821445708d6..096ee58be11a 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -79,7 +79,7 @@ struct rpc_task { | |||
| 79 | unsigned short tk_flags; /* misc flags */ | 79 | unsigned short tk_flags; /* misc flags */ |
| 80 | unsigned short tk_timeouts; /* maj timeouts */ | 80 | unsigned short tk_timeouts; /* maj timeouts */ |
| 81 | 81 | ||
| 82 | #ifdef RPC_DEBUG | 82 | #if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS) |
| 83 | unsigned short tk_pid; /* debugging aid */ | 83 | unsigned short tk_pid; /* debugging aid */ |
| 84 | #endif | 84 | #endif |
| 85 | unsigned char tk_priority : 2,/* Task priority */ | 85 | unsigned char tk_priority : 2,/* Task priority */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 1f0216b9a6c9..6eecfc2e4f98 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -243,7 +243,6 @@ struct svc_rqst { | |||
| 243 | struct xdr_buf rq_res; | 243 | struct xdr_buf rq_res; |
| 244 | struct page * rq_pages[RPCSVC_MAXPAGES]; | 244 | struct page * rq_pages[RPCSVC_MAXPAGES]; |
| 245 | struct page * *rq_respages; /* points into rq_pages */ | 245 | struct page * *rq_respages; /* points into rq_pages */ |
| 246 | int rq_resused; /* number of pages used for result */ | ||
| 247 | struct page * *rq_next_page; /* next reply page to use */ | 246 | struct page * *rq_next_page; /* next reply page to use */ |
| 248 | 247 | ||
| 249 | struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ | 248 | struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ |
