diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 11:53:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 11:53:47 -0400 |
| commit | f63d395d47f37a4fe771e6d4b1db9d2cdae5ffc5 (patch) | |
| tree | 3448a14ae965802adb963762cadeb9989ce4caa2 /include | |
| parent | 643ac9fc5429e85b8b7f534544b80bcc4f34c367 (diff) | |
| parent | 5a7c9eec9fde1da0e3adf0a4ddb64ff2a324a492 (diff) | |
Merge tag 'nfs-for-3.4-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates for Linux 3.4 from Trond Myklebust:
"New features include:
- Add NFS client support for containers.
This should enable most of the necessary functionality, including
lockd support, and support for rpc.statd, NFSv4 idmapper and
RPCSEC_GSS upcalls into the correct network namespace from which
the mount system call was issued.
- NFSv4 idmapper scalability improvements
Base the idmapper cache on the keyring interface to allow
concurrent access to idmapper entries. Start the process of
migrating users from the single-threaded daemon-based approach to
the multi-threaded request-key based approach.
- NFSv4.1 implementation id.
Allows the NFSv4.1 client and server to mutually identify each
other for logging and debugging purposes.
- Support the 'vers=4.1' mount option for mounting NFSv4.1 instead of
having to use the more counterintuitive 'vers=4,minorversion=1'.
- SUNRPC tracepoints.
Start the process of adding tracepoints in order to improve
debugging of the RPC layer.
- pNFS object layout support for autologin.
Important bugfixes include:
- Fix a bug in rpc_wake_up/rpc_wake_up_status that caused them to
fail to wake up all tasks when applied to priority waitqueues.
- Ensure that we handle read delegations correctly, when we try to
truncate a file.
- A number of fixes for NFSv4 state manager loops (mostly to do with
delegation recovery)."
* tag 'nfs-for-3.4-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (224 commits)
NFS: fix sb->s_id in nfs debug prints
xprtrdma: Remove assumption that each segment is <= PAGE_SIZE
xprtrdma: The transport should not bug-check when a dup reply is received
pnfs-obj: autologin: Add support for protocol autologin
NFS: Remove nfs4_setup_sequence from generic rename code
NFS: Remove nfs4_setup_sequence from generic unlink code
NFS: Remove nfs4_setup_sequence from generic read code
NFS: Remove nfs4_setup_sequence from generic write code
NFS: Fix more NFS debug related build warnings
SUNRPC/LOCKD: Fix build warnings when CONFIG_SUNRPC_DEBUG is undefined
nfs: non void functions must return a value
SUNRPC: Kill compiler warning when RPC_DEBUG is unset
SUNRPC/NFS: Add Kbuild dependencies for NFS_DEBUG/RPC_DEBUG
NFS: Use cond_resched_lock() to reduce latencies in the commit scans
NFSv4: It is not safe to dereference lsp->ls_state in release_lockowner
NFS: ncommit count is being double decremented
SUNRPC: We must not use list_for_each_entry_safe() in rpc_wake_up()
Try using machine credentials for RENEW calls
NFSv4.1: Fix a few issues in filelayout_commit_pagelist
NFSv4.1: Clean ups and bugfixes for the pNFS read/writeback/commit code
...
Diffstat (limited to 'include')
30 files changed, 448 insertions, 161 deletions
diff --git a/include/linux/key.h b/include/linux/key.h index 1600ebf717a..96933b1e5d2 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -277,6 +277,8 @@ static inline key_serial_t key_serial(const struct key *key) | |||
| 277 | return key ? key->serial : 0; | 277 | return key ? key->serial : 0; |
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | extern void key_set_timeout(struct key *, unsigned); | ||
| 281 | |||
| 280 | /** | 282 | /** |
| 281 | * key_is_instantiated - Determine if a key has been positively instantiated | 283 | * key_is_instantiated - Determine if a key has been positively instantiated |
| 282 | * @key: The key to check. | 284 | * @key: The key to check. |
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index fbc48f89852..11a966e5f82 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
| @@ -42,6 +42,7 @@ struct nlmclnt_initdata { | |||
| 42 | unsigned short protocol; | 42 | unsigned short protocol; |
| 43 | u32 nfs_version; | 43 | u32 nfs_version; |
| 44 | int noresvport; | 44 | int noresvport; |
| 45 | struct net *net; | ||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | /* | 48 | /* |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 88a114fce47..f04ce6ac6d0 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -67,6 +67,7 @@ struct nlm_host { | |||
| 67 | struct list_head h_reclaim; /* Locks in RECLAIM state */ | 67 | struct list_head h_reclaim; /* Locks in RECLAIM state */ |
| 68 | struct nsm_handle *h_nsmhandle; /* NSM status handle */ | 68 | struct nsm_handle *h_nsmhandle; /* NSM status handle */ |
| 69 | char *h_addrbuf; /* address eyecatcher */ | 69 | char *h_addrbuf; /* address eyecatcher */ |
| 70 | struct net *net; /* host net */ | ||
| 70 | }; | 71 | }; |
| 71 | 72 | ||
| 72 | /* | 73 | /* |
| @@ -188,7 +189,7 @@ struct nlm_block { | |||
| 188 | /* | 189 | /* |
| 189 | * Global variables | 190 | * Global variables |
| 190 | */ | 191 | */ |
| 191 | extern struct rpc_program nlm_program; | 192 | extern const struct rpc_program nlm_program; |
| 192 | extern struct svc_procedure nlmsvc_procedures[]; | 193 | extern struct svc_procedure nlmsvc_procedures[]; |
| 193 | #ifdef CONFIG_LOCKD_V4 | 194 | #ifdef CONFIG_LOCKD_V4 |
| 194 | extern struct svc_procedure nlmsvc_procedures4[]; | 195 | extern struct svc_procedure nlmsvc_procedures4[]; |
| @@ -222,7 +223,8 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 222 | const unsigned short protocol, | 223 | const unsigned short protocol, |
| 223 | const u32 version, | 224 | const u32 version, |
| 224 | const char *hostname, | 225 | const char *hostname, |
| 225 | int noresvport); | 226 | int noresvport, |
| 227 | struct net *net); | ||
| 226 | void nlmclnt_release_host(struct nlm_host *); | 228 | void nlmclnt_release_host(struct nlm_host *); |
| 227 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, | 229 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, |
| 228 | const char *hostname, | 230 | const char *hostname, |
| @@ -232,6 +234,7 @@ struct rpc_clnt * nlm_bind_host(struct nlm_host *); | |||
| 232 | void nlm_rebind_host(struct nlm_host *); | 234 | void nlm_rebind_host(struct nlm_host *); |
| 233 | struct nlm_host * nlm_get_host(struct nlm_host *); | 235 | struct nlm_host * nlm_get_host(struct nlm_host *); |
| 234 | void nlm_shutdown_hosts(void); | 236 | void nlm_shutdown_hosts(void); |
| 237 | void nlm_shutdown_hosts_net(struct net *net); | ||
| 235 | void nlm_host_rebooted(const struct nlm_reboot *); | 238 | void nlm_host_rebooted(const struct nlm_reboot *); |
| 236 | 239 | ||
| 237 | /* | 240 | /* |
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h index 7353821341e..e58c88b52ce 100644 --- a/include/linux/lockd/xdr4.h +++ b/include/linux/lockd/xdr4.h | |||
| @@ -42,6 +42,6 @@ int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); | |||
| 42 | int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 42 | int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
| 43 | int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 43 | int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
| 44 | */ | 44 | */ |
| 45 | extern struct rpc_version nlm_version4; | 45 | extern const struct rpc_version nlm_version4; |
| 46 | 46 | ||
| 47 | #endif /* LOCKD_XDR4_H */ | 47 | #endif /* LOCKD_XDR4_H */ |
diff --git a/include/linux/nfs.h b/include/linux/nfs.h index 8c6ee44914c..6d1fb63f592 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | #define NFS_MNT_VERSION 1 | 29 | #define NFS_MNT_VERSION 1 |
| 30 | #define NFS_MNT3_VERSION 3 | 30 | #define NFS_MNT3_VERSION 3 |
| 31 | 31 | ||
| 32 | #define NFS_PIPE_DIRNAME "/nfs" | 32 | #define NFS_PIPE_DIRNAME "nfs" |
| 33 | 33 | ||
| 34 | /* | 34 | /* |
| 35 | * NFS stats. The good thing with these values is that NFSv3 errors are | 35 | * NFS stats. The good thing with these values is that NFSv3 errors are |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 32345c2805c..834df8bf08b 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -183,15 +183,12 @@ struct nfs4_acl { | |||
| 183 | 183 | ||
| 184 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; | 184 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; |
| 185 | 185 | ||
| 186 | struct nfs41_stateid { | 186 | struct nfs_stateid4 { |
| 187 | __be32 seqid; | 187 | __be32 seqid; |
| 188 | char other[NFS4_STATEID_OTHER_SIZE]; | 188 | char other[NFS4_STATEID_OTHER_SIZE]; |
| 189 | } __attribute__ ((packed)); | 189 | } __attribute__ ((packed)); |
| 190 | 190 | ||
| 191 | typedef union { | 191 | typedef struct nfs_stateid4 nfs4_stateid; |
| 192 | char data[NFS4_STATEID_SIZE]; | ||
| 193 | struct nfs41_stateid stateid; | ||
| 194 | } nfs4_stateid; | ||
| 195 | 192 | ||
| 196 | enum nfs_opnum4 { | 193 | enum nfs_opnum4 { |
| 197 | OP_ACCESS = 3, | 194 | OP_ACCESS = 3, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 8c29950d2fa..52a1bdb4ee2 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -38,6 +38,13 @@ | |||
| 38 | 38 | ||
| 39 | #ifdef __KERNEL__ | 39 | #ifdef __KERNEL__ |
| 40 | 40 | ||
| 41 | /* | ||
| 42 | * Enable dprintk() debugging support for nfs client. | ||
| 43 | */ | ||
| 44 | #ifdef CONFIG_NFS_DEBUG | ||
| 45 | # define NFS_DEBUG | ||
| 46 | #endif | ||
| 47 | |||
| 41 | #include <linux/in.h> | 48 | #include <linux/in.h> |
| 42 | #include <linux/mm.h> | 49 | #include <linux/mm.h> |
| 43 | #include <linux/pagemap.h> | 50 | #include <linux/pagemap.h> |
| @@ -171,13 +178,9 @@ struct nfs_inode { | |||
| 171 | */ | 178 | */ |
| 172 | __be32 cookieverf[2]; | 179 | __be32 cookieverf[2]; |
| 173 | 180 | ||
| 174 | /* | ||
| 175 | * This is the list of dirty unwritten pages. | ||
| 176 | */ | ||
| 177 | struct radix_tree_root nfs_page_tree; | ||
| 178 | |||
| 179 | unsigned long npages; | 181 | unsigned long npages; |
| 180 | unsigned long ncommit; | 182 | unsigned long ncommit; |
| 183 | struct list_head commit_list; | ||
| 181 | 184 | ||
| 182 | /* Open contexts for shared mmap writes */ | 185 | /* Open contexts for shared mmap writes */ |
| 183 | struct list_head open_files; | 186 | struct list_head open_files; |
| @@ -395,6 +398,29 @@ static inline void nfs_free_fhandle(const struct nfs_fh *fh) | |||
| 395 | kfree(fh); | 398 | kfree(fh); |
| 396 | } | 399 | } |
| 397 | 400 | ||
| 401 | #ifdef NFS_DEBUG | ||
| 402 | extern u32 _nfs_display_fhandle_hash(const struct nfs_fh *fh); | ||
| 403 | static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh) | ||
| 404 | { | ||
| 405 | return _nfs_display_fhandle_hash(fh); | ||
| 406 | } | ||
| 407 | extern void _nfs_display_fhandle(const struct nfs_fh *fh, const char *caption); | ||
| 408 | #define nfs_display_fhandle(fh, caption) \ | ||
| 409 | do { \ | ||
| 410 | if (unlikely(nfs_debug & NFSDBG_FACILITY)) \ | ||
| 411 | _nfs_display_fhandle(fh, caption); \ | ||
| 412 | } while (0) | ||
| 413 | #else | ||
| 414 | static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh) | ||
| 415 | { | ||
| 416 | return 0; | ||
| 417 | } | ||
| 418 | static inline void nfs_display_fhandle(const struct nfs_fh *fh, | ||
| 419 | const char *caption) | ||
| 420 | { | ||
| 421 | } | ||
| 422 | #endif | ||
| 423 | |||
| 398 | /* | 424 | /* |
| 399 | * linux/fs/nfs/nfsroot.c | 425 | * linux/fs/nfs/nfsroot.c |
| 400 | */ | 426 | */ |
| @@ -632,19 +658,13 @@ nfs_fileid_to_ino_t(u64 fileid) | |||
| 632 | 658 | ||
| 633 | #ifdef __KERNEL__ | 659 | #ifdef __KERNEL__ |
| 634 | 660 | ||
| 635 | /* | ||
| 636 | * Enable debugging support for nfs client. | ||
| 637 | * Requires RPC_DEBUG. | ||
| 638 | */ | ||
| 639 | #ifdef RPC_DEBUG | ||
| 640 | # define NFS_DEBUG | ||
| 641 | #endif | ||
| 642 | |||
| 643 | # undef ifdebug | 661 | # undef ifdebug |
| 644 | # ifdef NFS_DEBUG | 662 | # ifdef NFS_DEBUG |
| 645 | # define ifdebug(fac) if (unlikely(nfs_debug & NFSDBG_##fac)) | 663 | # define ifdebug(fac) if (unlikely(nfs_debug & NFSDBG_##fac)) |
| 664 | # define NFS_IFDEBUG(x) x | ||
| 646 | # else | 665 | # else |
| 647 | # define ifdebug(fac) if (0) | 666 | # define ifdebug(fac) if (0) |
| 667 | # define NFS_IFDEBUG(x) | ||
| 648 | # endif | 668 | # endif |
| 649 | #endif /* __KERNEL */ | 669 | #endif /* __KERNEL */ |
| 650 | 670 | ||
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index 861730275ba..a5c50d97341 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h | |||
| @@ -1,10 +1,6 @@ | |||
| 1 | #ifndef _NFS_FS_I | 1 | #ifndef _NFS_FS_I |
| 2 | #define _NFS_FS_I | 2 | #define _NFS_FS_I |
| 3 | 3 | ||
| 4 | #include <asm/types.h> | ||
| 5 | #include <linux/list.h> | ||
| 6 | #include <linux/nfs.h> | ||
| 7 | |||
| 8 | struct nlm_lockowner; | 4 | struct nlm_lockowner; |
| 9 | 5 | ||
| 10 | /* | 6 | /* |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index ba4d7656ecf..7073fc74481 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/backing-dev.h> | 5 | #include <linux/backing-dev.h> |
| 6 | #include <linux/idr.h> | ||
| 6 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
| 7 | #include <linux/nfs_xdr.h> | 8 | #include <linux/nfs_xdr.h> |
| 8 | #include <linux/sunrpc/xprt.h> | 9 | #include <linux/sunrpc/xprt.h> |
| @@ -17,6 +18,7 @@ struct nfs4_sequence_res; | |||
| 17 | struct nfs_server; | 18 | struct nfs_server; |
| 18 | struct nfs4_minor_version_ops; | 19 | struct nfs4_minor_version_ops; |
| 19 | struct server_scope; | 20 | struct server_scope; |
| 21 | struct nfs41_impl_id; | ||
| 20 | 22 | ||
| 21 | /* | 23 | /* |
| 22 | * The nfs_client identifies our client state to the server. | 24 | * The nfs_client identifies our client state to the server. |
| @@ -85,6 +87,8 @@ struct nfs_client { | |||
| 85 | #endif | 87 | #endif |
| 86 | 88 | ||
| 87 | struct server_scope *server_scope; /* from exchange_id */ | 89 | struct server_scope *server_scope; /* from exchange_id */ |
| 90 | struct nfs41_impl_id *impl_id; /* from exchange_id */ | ||
| 91 | struct net *net; | ||
| 88 | }; | 92 | }; |
| 89 | 93 | ||
| 90 | /* | 94 | /* |
| @@ -144,15 +148,18 @@ struct nfs_server { | |||
| 144 | u32 acl_bitmask; /* V4 bitmask representing the ACEs | 148 | u32 acl_bitmask; /* V4 bitmask representing the ACEs |
| 145 | that are supported on this | 149 | that are supported on this |
| 146 | filesystem */ | 150 | filesystem */ |
| 151 | u32 fh_expire_type; /* V4 bitmask representing file | ||
| 152 | handle volatility type for | ||
| 153 | this filesystem */ | ||
| 147 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ | 154 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ |
| 148 | struct rpc_wait_queue roc_rpcwaitq; | 155 | struct rpc_wait_queue roc_rpcwaitq; |
| 149 | void *pnfs_ld_data; /* per mount point data */ | 156 | void *pnfs_ld_data; /* per mount point data */ |
| 150 | 157 | ||
| 151 | /* the following fields are protected by nfs_client->cl_lock */ | 158 | /* the following fields are protected by nfs_client->cl_lock */ |
| 152 | struct rb_root state_owners; | 159 | struct rb_root state_owners; |
| 153 | struct rb_root openowner_id; | ||
| 154 | struct rb_root lockowner_id; | ||
| 155 | #endif | 160 | #endif |
| 161 | struct ida openowner_id; | ||
| 162 | struct ida lockowner_id; | ||
| 156 | struct list_head state_owners_lru; | 163 | struct list_head state_owners_lru; |
| 157 | struct list_head layouts; | 164 | struct list_head layouts; |
| 158 | struct list_head delegations; | 165 | struct list_head delegations; |
| @@ -188,21 +195,23 @@ struct nfs_server { | |||
| 188 | 195 | ||
| 189 | 196 | ||
| 190 | /* maximum number of slots to use */ | 197 | /* maximum number of slots to use */ |
| 191 | #define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE | 198 | #define NFS4_DEF_SLOT_TABLE_SIZE (16U) |
| 199 | #define NFS4_MAX_SLOT_TABLE (256U) | ||
| 200 | #define NFS4_NO_SLOT ((u32)-1) | ||
| 192 | 201 | ||
| 193 | #if defined(CONFIG_NFS_V4) | 202 | #if defined(CONFIG_NFS_V4) |
| 194 | 203 | ||
| 195 | /* Sessions */ | 204 | /* Sessions */ |
| 196 | #define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long))) | 205 | #define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long)) |
| 197 | struct nfs4_slot_table { | 206 | struct nfs4_slot_table { |
| 198 | struct nfs4_slot *slots; /* seqid per slot */ | 207 | struct nfs4_slot *slots; /* seqid per slot */ |
| 199 | unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */ | 208 | unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */ |
| 200 | spinlock_t slot_tbl_lock; | 209 | spinlock_t slot_tbl_lock; |
| 201 | struct rpc_wait_queue slot_tbl_waitq; /* allocators may wait here */ | 210 | struct rpc_wait_queue slot_tbl_waitq; /* allocators may wait here */ |
| 202 | int max_slots; /* # slots in table */ | 211 | u32 max_slots; /* # slots in table */ |
| 203 | int highest_used_slotid; /* sent to server on each SEQ. | 212 | u32 highest_used_slotid; /* sent to server on each SEQ. |
| 204 | * op for dynamic resizing */ | 213 | * op for dynamic resizing */ |
| 205 | int target_max_slots; /* Set by CB_RECALL_SLOT as | 214 | u32 target_max_slots; /* Set by CB_RECALL_SLOT as |
| 206 | * the new max_slots */ | 215 | * the new max_slots */ |
| 207 | struct completion complete; | 216 | struct completion complete; |
| 208 | }; | 217 | }; |
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index 308c1887701..7eed2012d28 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h | |||
| @@ -69,36 +69,22 @@ struct nfs_server; | |||
| 69 | struct nfs_fattr; | 69 | struct nfs_fattr; |
| 70 | struct nfs4_string; | 70 | struct nfs4_string; |
| 71 | 71 | ||
| 72 | #ifdef CONFIG_NFS_USE_NEW_IDMAPPER | 72 | #ifdef CONFIG_NFS_V4 |
| 73 | |||
| 74 | int nfs_idmap_init(void); | 73 | int nfs_idmap_init(void); |
| 75 | void nfs_idmap_quit(void); | 74 | void nfs_idmap_quit(void); |
| 76 | 75 | #else | |
| 77 | static inline int nfs_idmap_new(struct nfs_client *clp) | ||
| 78 | { | ||
| 79 | return 0; | ||
| 80 | } | ||
| 81 | |||
| 82 | static inline void nfs_idmap_delete(struct nfs_client *clp) | ||
| 83 | { | ||
| 84 | } | ||
| 85 | |||
| 86 | #else /* CONFIG_NFS_USE_NEW_IDMAPPER not set */ | ||
| 87 | |||
| 88 | static inline int nfs_idmap_init(void) | 76 | static inline int nfs_idmap_init(void) |
| 89 | { | 77 | { |
| 90 | return 0; | 78 | return 0; |
| 91 | } | 79 | } |
| 92 | 80 | ||
| 93 | static inline void nfs_idmap_quit(void) | 81 | static inline void nfs_idmap_quit(void) |
| 94 | { | 82 | {} |
| 95 | } | 83 | #endif |
| 96 | 84 | ||
| 97 | int nfs_idmap_new(struct nfs_client *); | 85 | int nfs_idmap_new(struct nfs_client *); |
| 98 | void nfs_idmap_delete(struct nfs_client *); | 86 | void nfs_idmap_delete(struct nfs_client *); |
| 99 | 87 | ||
| 100 | #endif /* CONFIG_NFS_USE_NEW_IDMAPPER */ | ||
| 101 | |||
| 102 | void nfs_fattr_init_names(struct nfs_fattr *fattr, | 88 | void nfs_fattr_init_names(struct nfs_fattr *fattr, |
| 103 | struct nfs4_string *owner_name, | 89 | struct nfs4_string *owner_name, |
| 104 | struct nfs4_string *group_name); | 90 | struct nfs4_string *group_name); |
diff --git a/include/linux/nfs_iostat.h b/include/linux/nfs_iostat.h index 8866bb3502e..9dcbbe9a51f 100644 --- a/include/linux/nfs_iostat.h +++ b/include/linux/nfs_iostat.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #ifndef _LINUX_NFS_IOSTAT | 21 | #ifndef _LINUX_NFS_IOSTAT |
| 22 | #define _LINUX_NFS_IOSTAT | 22 | #define _LINUX_NFS_IOSTAT |
| 23 | 23 | ||
| 24 | #define NFS_IOSTAT_VERS "1.0" | 24 | #define NFS_IOSTAT_VERS "1.1" |
| 25 | 25 | ||
| 26 | /* | 26 | /* |
| 27 | * NFS byte counters | 27 | * NFS byte counters |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index ab465fe8c3d..eac30d6bec1 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
| @@ -19,12 +19,6 @@ | |||
| 19 | #include <linux/kref.h> | 19 | #include <linux/kref.h> |
| 20 | 20 | ||
| 21 | /* | 21 | /* |
| 22 | * Valid flags for the radix tree | ||
| 23 | */ | ||
| 24 | #define NFS_PAGE_TAG_LOCKED 0 | ||
| 25 | #define NFS_PAGE_TAG_COMMIT 1 | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Valid flags for a dirty buffer | 22 | * Valid flags for a dirty buffer |
| 29 | */ | 23 | */ |
| 30 | enum { | 24 | enum { |
| @@ -33,16 +27,13 @@ enum { | |||
| 33 | PG_CLEAN, | 27 | PG_CLEAN, |
| 34 | PG_NEED_COMMIT, | 28 | PG_NEED_COMMIT, |
| 35 | PG_NEED_RESCHED, | 29 | PG_NEED_RESCHED, |
| 36 | PG_PNFS_COMMIT, | ||
| 37 | PG_PARTIAL_READ_FAILED, | 30 | PG_PARTIAL_READ_FAILED, |
| 31 | PG_COMMIT_TO_DS, | ||
| 38 | }; | 32 | }; |
| 39 | 33 | ||
| 40 | struct nfs_inode; | 34 | struct nfs_inode; |
| 41 | struct nfs_page { | 35 | struct nfs_page { |
| 42 | union { | 36 | struct list_head wb_list; /* Defines state of page: */ |
| 43 | struct list_head wb_list; /* Defines state of page: */ | ||
| 44 | struct pnfs_layout_segment *wb_commit_lseg; /* Used when PG_PNFS_COMMIT set */ | ||
| 45 | }; | ||
| 46 | struct page *wb_page; /* page to read in/write out */ | 37 | struct page *wb_page; /* page to read in/write out */ |
| 47 | struct nfs_open_context *wb_context; /* File state context info */ | 38 | struct nfs_open_context *wb_context; /* File state context info */ |
| 48 | struct nfs_lock_context *wb_lock_context; /* lock context info */ | 39 | struct nfs_lock_context *wb_lock_context; /* lock context info */ |
| @@ -90,8 +81,6 @@ extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, | |||
| 90 | extern void nfs_release_request(struct nfs_page *req); | 81 | extern void nfs_release_request(struct nfs_page *req); |
| 91 | 82 | ||
| 92 | 83 | ||
| 93 | extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst, | ||
| 94 | pgoff_t idx_start, unsigned int npages, int tag); | ||
| 95 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, | 84 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, |
| 96 | struct inode *inode, | 85 | struct inode *inode, |
| 97 | const struct nfs_pageio_ops *pg_ops, | 86 | const struct nfs_pageio_ops *pg_ops, |
| @@ -106,8 +95,6 @@ extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, | |||
| 106 | struct nfs_page *req); | 95 | struct nfs_page *req); |
| 107 | extern int nfs_wait_on_request(struct nfs_page *); | 96 | extern int nfs_wait_on_request(struct nfs_page *); |
| 108 | extern void nfs_unlock_request(struct nfs_page *req); | 97 | extern void nfs_unlock_request(struct nfs_page *req); |
| 109 | extern int nfs_set_page_tag_locked(struct nfs_page *req); | ||
| 110 | extern void nfs_clear_page_tag_locked(struct nfs_page *req); | ||
| 111 | 98 | ||
| 112 | /* | 99 | /* |
| 113 | * Lock the page of an asynchronous request without getting a new reference | 100 | * Lock the page of an asynchronous request without getting a new reference |
| @@ -118,6 +105,16 @@ nfs_lock_request_dontget(struct nfs_page *req) | |||
| 118 | return !test_and_set_bit(PG_BUSY, &req->wb_flags); | 105 | return !test_and_set_bit(PG_BUSY, &req->wb_flags); |
| 119 | } | 106 | } |
| 120 | 107 | ||
| 108 | static inline int | ||
| 109 | nfs_lock_request(struct nfs_page *req) | ||
| 110 | { | ||
| 111 | if (test_and_set_bit(PG_BUSY, &req->wb_flags)) | ||
| 112 | return 0; | ||
| 113 | kref_get(&req->wb_kref); | ||
| 114 | return 1; | ||
| 115 | } | ||
| 116 | |||
| 117 | |||
| 121 | /** | 118 | /** |
| 122 | * nfs_list_add_request - Insert a request into a list | 119 | * nfs_list_add_request - Insert a request into a list |
| 123 | * @req: request | 120 | * @req: request |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index d6ba9a12591..bfd0d1bf670 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
| 3 | 3 | ||
| 4 | #include <linux/nfsacl.h> | 4 | #include <linux/nfsacl.h> |
| 5 | #include <linux/nfs3.h> | ||
| 6 | #include <linux/sunrpc/gss_api.h> | 5 | #include <linux/sunrpc/gss_api.h> |
| 7 | 6 | ||
| 8 | /* | 7 | /* |
| @@ -89,11 +88,12 @@ struct nfs_fattr { | |||
| 89 | #define NFS_ATTR_FATTR_PRECTIME (1U << 16) | 88 | #define NFS_ATTR_FATTR_PRECTIME (1U << 16) |
| 90 | #define NFS_ATTR_FATTR_CHANGE (1U << 17) | 89 | #define NFS_ATTR_FATTR_CHANGE (1U << 17) |
| 91 | #define NFS_ATTR_FATTR_PRECHANGE (1U << 18) | 90 | #define NFS_ATTR_FATTR_PRECHANGE (1U << 18) |
| 92 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ | 91 | #define NFS_ATTR_FATTR_V4_LOCATIONS (1U << 19) |
| 93 | #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */ | 92 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 20) |
| 94 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21) | 93 | #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 21) |
| 95 | #define NFS_ATTR_FATTR_OWNER_NAME (1U << 22) | 94 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22) |
| 96 | #define NFS_ATTR_FATTR_GROUP_NAME (1U << 23) | 95 | #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23) |
| 96 | #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24) | ||
| 97 | 97 | ||
| 98 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ | 98 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ |
| 99 | | NFS_ATTR_FATTR_MODE \ | 99 | | NFS_ATTR_FATTR_MODE \ |
| @@ -182,7 +182,7 @@ struct nfs4_slot { | |||
| 182 | 182 | ||
| 183 | struct nfs4_sequence_args { | 183 | struct nfs4_sequence_args { |
| 184 | struct nfs4_session *sa_session; | 184 | struct nfs4_session *sa_session; |
| 185 | u8 sa_slotid; | 185 | u32 sa_slotid; |
| 186 | u8 sa_cache_this; | 186 | u8 sa_cache_this; |
| 187 | }; | 187 | }; |
| 188 | 188 | ||
| @@ -977,6 +977,7 @@ struct nfs4_server_caps_res { | |||
| 977 | u32 acl_bitmask; | 977 | u32 acl_bitmask; |
| 978 | u32 has_links; | 978 | u32 has_links; |
| 979 | u32 has_symlinks; | 979 | u32 has_symlinks; |
| 980 | u32 fh_expire_type; | ||
| 980 | struct nfs4_sequence_res seq_res; | 981 | struct nfs4_sequence_res seq_res; |
| 981 | }; | 982 | }; |
| 982 | 983 | ||
| @@ -1055,14 +1056,6 @@ struct nfstime4 { | |||
| 1055 | }; | 1056 | }; |
| 1056 | 1057 | ||
| 1057 | #ifdef CONFIG_NFS_V4_1 | 1058 | #ifdef CONFIG_NFS_V4_1 |
| 1058 | struct nfs_impl_id4 { | ||
| 1059 | u32 domain_len; | ||
| 1060 | char *domain; | ||
| 1061 | u32 name_len; | ||
| 1062 | char *name; | ||
| 1063 | struct nfstime4 date; | ||
| 1064 | }; | ||
| 1065 | |||
| 1066 | #define NFS4_EXCHANGE_ID_LEN (48) | 1059 | #define NFS4_EXCHANGE_ID_LEN (48) |
| 1067 | struct nfs41_exchange_id_args { | 1060 | struct nfs41_exchange_id_args { |
| 1068 | struct nfs_client *client; | 1061 | struct nfs_client *client; |
| @@ -1083,10 +1076,17 @@ struct server_scope { | |||
| 1083 | char server_scope[NFS4_OPAQUE_LIMIT]; | 1076 | char server_scope[NFS4_OPAQUE_LIMIT]; |
| 1084 | }; | 1077 | }; |
| 1085 | 1078 | ||
| 1079 | struct nfs41_impl_id { | ||
| 1080 | char domain[NFS4_OPAQUE_LIMIT + 1]; | ||
| 1081 | char name[NFS4_OPAQUE_LIMIT + 1]; | ||
| 1082 | struct nfstime4 date; | ||
| 1083 | }; | ||
| 1084 | |||
| 1086 | struct nfs41_exchange_id_res { | 1085 | struct nfs41_exchange_id_res { |
| 1087 | struct nfs_client *client; | 1086 | struct nfs_client *client; |
| 1088 | u32 flags; | 1087 | u32 flags; |
| 1089 | struct server_scope *server_scope; | 1088 | struct server_scope *server_scope; |
| 1089 | struct nfs41_impl_id *impl_id; | ||
| 1090 | }; | 1090 | }; |
| 1091 | 1091 | ||
| 1092 | struct nfs41_create_session_args { | 1092 | struct nfs41_create_session_args { |
| @@ -1192,6 +1192,27 @@ struct nfs_write_data { | |||
| 1192 | struct page *page_array[NFS_PAGEVEC_SIZE]; | 1192 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
| 1193 | }; | 1193 | }; |
| 1194 | 1194 | ||
| 1195 | struct nfs_unlinkdata { | ||
| 1196 | struct hlist_node list; | ||
| 1197 | struct nfs_removeargs args; | ||
| 1198 | struct nfs_removeres res; | ||
| 1199 | struct inode *dir; | ||
| 1200 | struct rpc_cred *cred; | ||
| 1201 | struct nfs_fattr dir_attr; | ||
| 1202 | }; | ||
| 1203 | |||
| 1204 | struct nfs_renamedata { | ||
| 1205 | struct nfs_renameargs args; | ||
| 1206 | struct nfs_renameres res; | ||
| 1207 | struct rpc_cred *cred; | ||
| 1208 | struct inode *old_dir; | ||
| 1209 | struct dentry *old_dentry; | ||
| 1210 | struct nfs_fattr old_fattr; | ||
| 1211 | struct inode *new_dir; | ||
| 1212 | struct dentry *new_dentry; | ||
| 1213 | struct nfs_fattr new_fattr; | ||
| 1214 | }; | ||
| 1215 | |||
| 1195 | struct nfs_access_entry; | 1216 | struct nfs_access_entry; |
| 1196 | struct nfs_client; | 1217 | struct nfs_client; |
| 1197 | struct rpc_timeout; | 1218 | struct rpc_timeout; |
| @@ -1221,10 +1242,12 @@ struct nfs_rpc_ops { | |||
| 1221 | struct iattr *, int, struct nfs_open_context *); | 1242 | struct iattr *, int, struct nfs_open_context *); |
| 1222 | int (*remove) (struct inode *, struct qstr *); | 1243 | int (*remove) (struct inode *, struct qstr *); |
| 1223 | void (*unlink_setup) (struct rpc_message *, struct inode *dir); | 1244 | void (*unlink_setup) (struct rpc_message *, struct inode *dir); |
| 1245 | void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); | ||
| 1224 | int (*unlink_done) (struct rpc_task *, struct inode *); | 1246 | int (*unlink_done) (struct rpc_task *, struct inode *); |
| 1225 | int (*rename) (struct inode *, struct qstr *, | 1247 | int (*rename) (struct inode *, struct qstr *, |
| 1226 | struct inode *, struct qstr *); | 1248 | struct inode *, struct qstr *); |
| 1227 | void (*rename_setup) (struct rpc_message *msg, struct inode *dir); | 1249 | void (*rename_setup) (struct rpc_message *msg, struct inode *dir); |
| 1250 | void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *); | ||
| 1228 | int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); | 1251 | int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); |
| 1229 | int (*link) (struct inode *, struct inode *, struct qstr *); | 1252 | int (*link) (struct inode *, struct inode *, struct qstr *); |
| 1230 | int (*symlink) (struct inode *, struct dentry *, struct page *, | 1253 | int (*symlink) (struct inode *, struct dentry *, struct page *, |
| @@ -1244,8 +1267,10 @@ struct nfs_rpc_ops { | |||
| 1244 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | 1267 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
| 1245 | int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); | 1268 | int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); |
| 1246 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); | 1269 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); |
| 1270 | void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *); | ||
| 1247 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 1271 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
| 1248 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); | 1272 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); |
| 1273 | void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); | ||
| 1249 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); | 1274 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); |
| 1250 | void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); | 1275 | void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); |
| 1251 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); | 1276 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); |
| @@ -1275,11 +1300,11 @@ struct nfs_rpc_ops { | |||
| 1275 | extern const struct nfs_rpc_ops nfs_v2_clientops; | 1300 | extern const struct nfs_rpc_ops nfs_v2_clientops; |
| 1276 | extern const struct nfs_rpc_ops nfs_v3_clientops; | 1301 | extern const struct nfs_rpc_ops nfs_v3_clientops; |
| 1277 | extern const struct nfs_rpc_ops nfs_v4_clientops; | 1302 | extern const struct nfs_rpc_ops nfs_v4_clientops; |
| 1278 | extern struct rpc_version nfs_version2; | 1303 | extern const struct rpc_version nfs_version2; |
| 1279 | extern struct rpc_version nfs_version3; | 1304 | extern const struct rpc_version nfs_version3; |
| 1280 | extern struct rpc_version nfs_version4; | 1305 | extern const struct rpc_version nfs_version4; |
| 1281 | 1306 | ||
| 1282 | extern struct rpc_version nfsacl_version3; | 1307 | extern const struct rpc_version nfsacl_version3; |
| 1283 | extern struct rpc_program nfsacl_program; | 1308 | extern const struct rpc_program nfsacl_program; |
| 1284 | 1309 | ||
| 1285 | #endif | 1310 | #endif |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 7874a8a5663..492a36d7282 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -99,6 +99,8 @@ struct rpc_authops { | |||
| 99 | 99 | ||
| 100 | struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); | 100 | struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); |
| 101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); | 101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); |
| 102 | int (*pipes_create)(struct rpc_auth *); | ||
| 103 | void (*pipes_destroy)(struct rpc_auth *); | ||
| 102 | }; | 104 | }; |
| 103 | 105 | ||
| 104 | struct rpc_credops { | 106 | struct rpc_credops { |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index f7f3ce340c0..969c0a671db 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| 35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | 35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); |
| 36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
| 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
| 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | 38 | void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); |
| 39 | int bc_send(struct rpc_rqst *req); | 39 | int bc_send(struct rpc_rqst *req); |
| 40 | 40 | ||
| 41 | /* | 41 | /* |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 57531f8e595..f5fd6160dbc 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -117,6 +117,7 @@ struct cache_detail { | |||
| 117 | struct cache_detail_procfs procfs; | 117 | struct cache_detail_procfs procfs; |
| 118 | struct cache_detail_pipefs pipefs; | 118 | struct cache_detail_pipefs pipefs; |
| 119 | } u; | 119 | } u; |
| 120 | struct net *net; | ||
| 120 | }; | 121 | }; |
| 121 | 122 | ||
| 122 | 123 | ||
| @@ -197,11 +198,14 @@ extern void cache_flush(void); | |||
| 197 | extern void cache_purge(struct cache_detail *detail); | 198 | extern void cache_purge(struct cache_detail *detail); |
| 198 | #define NEVER (0x7FFFFFFF) | 199 | #define NEVER (0x7FFFFFFF) |
| 199 | extern void __init cache_initialize(void); | 200 | extern void __init cache_initialize(void); |
| 200 | extern int cache_register(struct cache_detail *cd); | ||
| 201 | extern int cache_register_net(struct cache_detail *cd, struct net *net); | 201 | extern int cache_register_net(struct cache_detail *cd, struct net *net); |
| 202 | extern void cache_unregister(struct cache_detail *cd); | ||
| 203 | extern void cache_unregister_net(struct cache_detail *cd, struct net *net); | 202 | extern void cache_unregister_net(struct cache_detail *cd, struct net *net); |
| 204 | 203 | ||
| 204 | extern struct cache_detail *cache_create_net(struct cache_detail *tmpl, struct net *net); | ||
| 205 | extern void cache_destroy_net(struct cache_detail *cd, struct net *net); | ||
| 206 | |||
| 207 | extern void sunrpc_init_cache_detail(struct cache_detail *cd); | ||
| 208 | extern void sunrpc_destroy_cache_detail(struct cache_detail *cd); | ||
| 205 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, | 209 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, |
| 206 | umode_t, struct cache_detail *); | 210 | umode_t, struct cache_detail *); |
| 207 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); | 211 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 2c5993a17c3..523547ecfee 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -35,14 +35,13 @@ struct rpc_clnt { | |||
| 35 | struct list_head cl_clients; /* Global list of clients */ | 35 | struct list_head cl_clients; /* Global list of clients */ |
| 36 | struct list_head cl_tasks; /* List of tasks */ | 36 | struct list_head cl_tasks; /* List of tasks */ |
| 37 | spinlock_t cl_lock; /* spinlock */ | 37 | spinlock_t cl_lock; /* spinlock */ |
| 38 | struct rpc_xprt * cl_xprt; /* transport */ | 38 | struct rpc_xprt __rcu * cl_xprt; /* transport */ |
| 39 | struct rpc_procinfo * cl_procinfo; /* procedure info */ | 39 | struct rpc_procinfo * cl_procinfo; /* procedure info */ |
| 40 | u32 cl_prog, /* RPC program number */ | 40 | u32 cl_prog, /* RPC program number */ |
| 41 | cl_vers, /* RPC version number */ | 41 | cl_vers, /* RPC version number */ |
| 42 | cl_maxproc; /* max procedure number */ | 42 | cl_maxproc; /* max procedure number */ |
| 43 | 43 | ||
| 44 | char * cl_server; /* server machine name */ | 44 | const char * cl_protname; /* protocol name */ |
| 45 | char * cl_protname; /* protocol name */ | ||
| 46 | struct rpc_auth * cl_auth; /* authenticator */ | 45 | struct rpc_auth * cl_auth; /* authenticator */ |
| 47 | struct rpc_stat * cl_stats; /* per-program statistics */ | 46 | struct rpc_stat * cl_stats; /* per-program statistics */ |
| 48 | struct rpc_iostats * cl_metrics; /* per-client statistics */ | 47 | struct rpc_iostats * cl_metrics; /* per-client statistics */ |
| @@ -57,12 +56,11 @@ struct rpc_clnt { | |||
| 57 | 56 | ||
| 58 | int cl_nodelen; /* nodename length */ | 57 | int cl_nodelen; /* nodename length */ |
| 59 | char cl_nodename[UNX_MAXNODENAME]; | 58 | char cl_nodename[UNX_MAXNODENAME]; |
| 60 | struct path cl_path; | 59 | struct dentry * cl_dentry; |
| 61 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 60 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 62 | struct rpc_rtt cl_rtt_default; | 61 | struct rpc_rtt cl_rtt_default; |
| 63 | struct rpc_timeout cl_timeout_default; | 62 | struct rpc_timeout cl_timeout_default; |
| 64 | struct rpc_program * cl_program; | 63 | const struct rpc_program *cl_program; |
| 65 | char cl_inline_name[32]; | ||
| 66 | char *cl_principal; /* target to authenticate to */ | 64 | char *cl_principal; /* target to authenticate to */ |
| 67 | }; | 65 | }; |
| 68 | 66 | ||
| @@ -71,12 +69,12 @@ struct rpc_clnt { | |||
| 71 | */ | 69 | */ |
| 72 | #define RPC_MAXVERSION 4 | 70 | #define RPC_MAXVERSION 4 |
| 73 | struct rpc_program { | 71 | struct rpc_program { |
| 74 | char * name; /* protocol name */ | 72 | const char * name; /* protocol name */ |
| 75 | u32 number; /* program number */ | 73 | u32 number; /* program number */ |
| 76 | unsigned int nrvers; /* number of versions */ | 74 | unsigned int nrvers; /* number of versions */ |
| 77 | struct rpc_version ** version; /* version array */ | 75 | const struct rpc_version ** version; /* version array */ |
| 78 | struct rpc_stat * stats; /* statistics */ | 76 | struct rpc_stat * stats; /* statistics */ |
| 79 | char * pipe_dir_name; /* path to rpc_pipefs dir */ | 77 | const char * pipe_dir_name; /* path to rpc_pipefs dir */ |
| 80 | }; | 78 | }; |
| 81 | 79 | ||
| 82 | struct rpc_version { | 80 | struct rpc_version { |
| @@ -97,7 +95,7 @@ struct rpc_procinfo { | |||
| 97 | unsigned int p_count; /* call count */ | 95 | unsigned int p_count; /* call count */ |
| 98 | unsigned int p_timer; /* Which RTT timer to use */ | 96 | unsigned int p_timer; /* Which RTT timer to use */ |
| 99 | u32 p_statidx; /* Which procedure to account */ | 97 | u32 p_statidx; /* Which procedure to account */ |
| 100 | char * p_name; /* name of procedure */ | 98 | const char * p_name; /* name of procedure */ |
| 101 | }; | 99 | }; |
| 102 | 100 | ||
| 103 | #ifdef __KERNEL__ | 101 | #ifdef __KERNEL__ |
| @@ -109,8 +107,8 @@ struct rpc_create_args { | |||
| 109 | size_t addrsize; | 107 | size_t addrsize; |
| 110 | struct sockaddr *saddress; | 108 | struct sockaddr *saddress; |
| 111 | const struct rpc_timeout *timeout; | 109 | const struct rpc_timeout *timeout; |
| 112 | char *servername; | 110 | const char *servername; |
| 113 | struct rpc_program *program; | 111 | const struct rpc_program *program; |
| 114 | u32 prognumber; /* overrides program->number */ | 112 | u32 prognumber; /* overrides program->number */ |
| 115 | u32 version; | 113 | u32 version; |
| 116 | rpc_authflavor_t authflavor; | 114 | rpc_authflavor_t authflavor; |
| @@ -129,17 +127,18 @@ struct rpc_create_args { | |||
| 129 | 127 | ||
| 130 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 128 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
| 131 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 129 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
| 132 | struct rpc_program *, u32); | 130 | const struct rpc_program *, u32); |
| 133 | void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); | 131 | void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); |
| 134 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 132 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
| 135 | void rpc_shutdown_client(struct rpc_clnt *); | 133 | void rpc_shutdown_client(struct rpc_clnt *); |
| 136 | void rpc_release_client(struct rpc_clnt *); | 134 | void rpc_release_client(struct rpc_clnt *); |
| 137 | void rpc_task_release_client(struct rpc_task *); | 135 | void rpc_task_release_client(struct rpc_task *); |
| 138 | 136 | ||
| 139 | int rpcb_create_local(void); | 137 | int rpcb_create_local(struct net *); |
| 140 | void rpcb_put_local(void); | 138 | void rpcb_put_local(struct net *); |
| 141 | int rpcb_register(u32, u32, int, unsigned short); | 139 | int rpcb_register(struct net *, u32, u32, int, unsigned short); |
| 142 | int rpcb_v4_register(const u32 program, const u32 version, | 140 | int rpcb_v4_register(struct net *net, const u32 program, |
| 141 | const u32 version, | ||
| 143 | const struct sockaddr *address, | 142 | const struct sockaddr *address, |
| 144 | const char *netid); | 143 | const char *netid); |
| 145 | void rpcb_getport_async(struct rpc_task *); | 144 | void rpcb_getport_async(struct rpc_task *); |
| @@ -156,16 +155,19 @@ struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | |||
| 156 | int rpc_restart_call_prepare(struct rpc_task *); | 155 | int rpc_restart_call_prepare(struct rpc_task *); |
| 157 | int rpc_restart_call(struct rpc_task *); | 156 | int rpc_restart_call(struct rpc_task *); |
| 158 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 157 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
| 158 | int rpc_protocol(struct rpc_clnt *); | ||
| 159 | struct net * rpc_net_ns(struct rpc_clnt *); | ||
| 159 | size_t rpc_max_payload(struct rpc_clnt *); | 160 | size_t rpc_max_payload(struct rpc_clnt *); |
| 160 | void rpc_force_rebind(struct rpc_clnt *); | 161 | void rpc_force_rebind(struct rpc_clnt *); |
| 161 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 162 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 162 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 163 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
| 164 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); | ||
| 163 | 165 | ||
| 164 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | 166 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); |
| 165 | size_t rpc_pton(const char *, const size_t, | 167 | size_t rpc_pton(struct net *, const char *, const size_t, |
| 166 | struct sockaddr *, const size_t); | 168 | struct sockaddr *, const size_t); |
| 167 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); | 169 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); |
| 168 | size_t rpc_uaddr2sockaddr(const char *, const size_t, | 170 | size_t rpc_uaddr2sockaddr(struct net *, const char *, const size_t, |
| 169 | struct sockaddr *, const size_t); | 171 | struct sockaddr *, const size_t); |
| 170 | 172 | ||
| 171 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | 173 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index c2786f20016..a76cc20d98c 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
| @@ -31,9 +31,12 @@ | |||
| 31 | /* | 31 | /* |
| 32 | * Enable RPC debugging/profiling. | 32 | * Enable RPC debugging/profiling. |
| 33 | */ | 33 | */ |
| 34 | #ifdef CONFIG_SYSCTL | 34 | #ifdef CONFIG_SUNRPC_DEBUG |
| 35 | #define RPC_DEBUG | 35 | #define RPC_DEBUG |
| 36 | #endif | 36 | #endif |
| 37 | #ifdef CONFIG_TRACEPOINTS | ||
| 38 | #define RPC_TRACEPOINTS | ||
| 39 | #endif | ||
| 37 | /* #define RPC_PROFILE */ | 40 | /* #define RPC_PROFILE */ |
| 38 | 41 | ||
| 39 | /* | 42 | /* |
| @@ -47,15 +50,32 @@ extern unsigned int nlm_debug; | |||
| 47 | #endif | 50 | #endif |
| 48 | 51 | ||
| 49 | #define dprintk(args...) dfprintk(FACILITY, ## args) | 52 | #define dprintk(args...) dfprintk(FACILITY, ## args) |
| 53 | #define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) | ||
| 50 | 54 | ||
| 51 | #undef ifdebug | 55 | #undef ifdebug |
| 52 | #ifdef RPC_DEBUG | 56 | #ifdef RPC_DEBUG |
| 53 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) | 57 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) |
| 54 | # define dfprintk(fac, args...) do { ifdebug(fac) printk(args); } while(0) | 58 | |
| 59 | # define dfprintk(fac, args...) \ | ||
| 60 | do { \ | ||
| 61 | ifdebug(fac) \ | ||
| 62 | printk(KERN_DEFAULT args); \ | ||
| 63 | } while (0) | ||
| 64 | |||
| 65 | # define dfprintk_rcu(fac, args...) \ | ||
| 66 | do { \ | ||
| 67 | ifdebug(fac) { \ | ||
| 68 | rcu_read_lock(); \ | ||
| 69 | printk(KERN_DEFAULT args); \ | ||
| 70 | rcu_read_unlock(); \ | ||
| 71 | } \ | ||
| 72 | } while (0) | ||
| 73 | |||
| 55 | # define RPC_IFDEBUG(x) x | 74 | # define RPC_IFDEBUG(x) x |
| 56 | #else | 75 | #else |
| 57 | # define ifdebug(fac) if (0) | 76 | # define ifdebug(fac) if (0) |
| 58 | # define dfprintk(fac, args...) do ; while (0) | 77 | # define dfprintk(fac, args...) do {} while (0) |
| 78 | # define dfprintk_rcu(fac, args...) do {} while (0) | ||
| 59 | # define RPC_IFDEBUG(x) | 79 | # define RPC_IFDEBUG(x) |
| 60 | #endif | 80 | #endif |
| 61 | 81 | ||
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index b6edbc0ea83..1565bbe86d5 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
| @@ -74,14 +74,16 @@ struct rpc_clnt; | |||
| 74 | #ifdef CONFIG_PROC_FS | 74 | #ifdef CONFIG_PROC_FS |
| 75 | 75 | ||
| 76 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); | 76 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); |
| 77 | void rpc_count_iostats(struct rpc_task *); | 77 | void rpc_count_iostats(const struct rpc_task *, |
| 78 | struct rpc_iostats *); | ||
| 78 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); | 79 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); |
| 79 | void rpc_free_iostats(struct rpc_iostats *); | 80 | void rpc_free_iostats(struct rpc_iostats *); |
| 80 | 81 | ||
| 81 | #else /* CONFIG_PROC_FS */ | 82 | #else /* CONFIG_PROC_FS */ |
| 82 | 83 | ||
| 83 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } | 84 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } |
| 84 | static inline void rpc_count_iostats(struct rpc_task *task) {} | 85 | static inline void rpc_count_iostats(const struct rpc_task *task, |
| 86 | struct rpc_iostats *stats) {} | ||
| 85 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} | 87 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} |
| 86 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} | 88 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} |
| 87 | 89 | ||
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 2bb03d77375..a7b422b33ed 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
| @@ -21,21 +21,26 @@ struct rpc_pipe_ops { | |||
| 21 | void (*destroy_msg)(struct rpc_pipe_msg *); | 21 | void (*destroy_msg)(struct rpc_pipe_msg *); |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | struct rpc_inode { | 24 | struct rpc_pipe { |
| 25 | struct inode vfs_inode; | ||
| 26 | void *private; | ||
| 27 | struct list_head pipe; | 25 | struct list_head pipe; |
| 28 | struct list_head in_upcall; | 26 | struct list_head in_upcall; |
| 29 | struct list_head in_downcall; | 27 | struct list_head in_downcall; |
| 30 | int pipelen; | 28 | int pipelen; |
| 31 | int nreaders; | 29 | int nreaders; |
| 32 | int nwriters; | 30 | int nwriters; |
| 33 | int nkern_readwriters; | ||
| 34 | wait_queue_head_t waitq; | ||
| 35 | #define RPC_PIPE_WAIT_FOR_OPEN 1 | 31 | #define RPC_PIPE_WAIT_FOR_OPEN 1 |
| 36 | int flags; | 32 | int flags; |
| 37 | struct delayed_work queue_timeout; | 33 | struct delayed_work queue_timeout; |
| 38 | const struct rpc_pipe_ops *ops; | 34 | const struct rpc_pipe_ops *ops; |
| 35 | spinlock_t lock; | ||
| 36 | struct dentry *dentry; | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct rpc_inode { | ||
| 40 | struct inode vfs_inode; | ||
| 41 | void *private; | ||
| 42 | struct rpc_pipe *pipe; | ||
| 43 | wait_queue_head_t waitq; | ||
| 39 | }; | 44 | }; |
| 40 | 45 | ||
| 41 | static inline struct rpc_inode * | 46 | static inline struct rpc_inode * |
| @@ -44,9 +49,28 @@ RPC_I(struct inode *inode) | |||
| 44 | return container_of(inode, struct rpc_inode, vfs_inode); | 49 | return container_of(inode, struct rpc_inode, vfs_inode); |
| 45 | } | 50 | } |
| 46 | 51 | ||
| 52 | enum { | ||
| 53 | SUNRPC_PIPEFS_NFS_PRIO, | ||
| 54 | SUNRPC_PIPEFS_RPC_PRIO, | ||
| 55 | }; | ||
| 56 | |||
| 57 | extern int rpc_pipefs_notifier_register(struct notifier_block *); | ||
| 58 | extern void rpc_pipefs_notifier_unregister(struct notifier_block *); | ||
| 59 | |||
| 60 | enum { | ||
| 61 | RPC_PIPEFS_MOUNT, | ||
| 62 | RPC_PIPEFS_UMOUNT, | ||
| 63 | }; | ||
| 64 | |||
| 65 | extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb, | ||
| 66 | const unsigned char *dir_name); | ||
| 67 | extern void rpc_pipefs_init_net(struct net *net); | ||
| 68 | extern struct super_block *rpc_get_sb_net(const struct net *net); | ||
| 69 | extern void rpc_put_sb_net(const struct net *net); | ||
| 70 | |||
| 47 | extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *, | 71 | extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *, |
| 48 | char __user *, size_t); | 72 | char __user *, size_t); |
| 49 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | 73 | extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); |
| 50 | 74 | ||
| 51 | struct rpc_clnt; | 75 | struct rpc_clnt; |
| 52 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); | 76 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); |
| @@ -59,11 +83,13 @@ extern struct dentry *rpc_create_cache_dir(struct dentry *, | |||
| 59 | struct cache_detail *); | 83 | struct cache_detail *); |
| 60 | extern void rpc_remove_cache_dir(struct dentry *); | 84 | extern void rpc_remove_cache_dir(struct dentry *); |
| 61 | 85 | ||
| 62 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, | 86 | extern int rpc_rmdir(struct dentry *dentry); |
| 63 | const struct rpc_pipe_ops *, int flags); | 87 | |
| 88 | struct rpc_pipe *rpc_mkpipe_data(const struct rpc_pipe_ops *ops, int flags); | ||
| 89 | void rpc_destroy_pipe_data(struct rpc_pipe *pipe); | ||
| 90 | extern struct dentry *rpc_mkpipe_dentry(struct dentry *, const char *, void *, | ||
| 91 | struct rpc_pipe *); | ||
| 64 | extern int rpc_unlink(struct dentry *); | 92 | extern int rpc_unlink(struct dentry *); |
| 65 | extern struct vfsmount *rpc_get_mount(void); | ||
| 66 | extern void rpc_put_mount(void); | ||
| 67 | extern int register_rpc_pipefs(void); | 93 | extern int register_rpc_pipefs(void); |
| 68 | extern void unregister_rpc_pipefs(void); | 94 | extern void unregister_rpc_pipefs(void); |
| 69 | 95 | ||
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index e7756896f3c..dc0c3cc3ada 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -103,6 +103,7 @@ typedef void (*rpc_action)(struct rpc_task *); | |||
| 103 | struct rpc_call_ops { | 103 | struct rpc_call_ops { |
| 104 | void (*rpc_call_prepare)(struct rpc_task *, void *); | 104 | void (*rpc_call_prepare)(struct rpc_task *, void *); |
| 105 | void (*rpc_call_done)(struct rpc_task *, void *); | 105 | void (*rpc_call_done)(struct rpc_task *, void *); |
| 106 | void (*rpc_count_stats)(struct rpc_task *, void *); | ||
| 106 | void (*rpc_release)(void *); | 107 | void (*rpc_release)(void *); |
| 107 | }; | 108 | }; |
| 108 | 109 | ||
| @@ -195,7 +196,7 @@ struct rpc_wait_queue { | |||
| 195 | unsigned char nr; /* # tasks remaining for cookie */ | 196 | unsigned char nr; /* # tasks remaining for cookie */ |
| 196 | unsigned short qlen; /* total # tasks waiting in queue */ | 197 | unsigned short qlen; /* total # tasks waiting in queue */ |
| 197 | struct rpc_timer timer_list; | 198 | struct rpc_timer timer_list; |
| 198 | #ifdef RPC_DEBUG | 199 | #if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS) |
| 199 | const char * name; | 200 | const char * name; |
| 200 | #endif | 201 | #endif |
| 201 | }; | 202 | }; |
| @@ -235,6 +236,9 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *, | |||
| 235 | struct rpc_task *); | 236 | struct rpc_task *); |
| 236 | void rpc_wake_up(struct rpc_wait_queue *); | 237 | void rpc_wake_up(struct rpc_wait_queue *); |
| 237 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | 238 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
| 239 | struct rpc_task *rpc_wake_up_first(struct rpc_wait_queue *, | ||
| 240 | bool (*)(struct rpc_task *, void *), | ||
| 241 | void *); | ||
| 238 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 242 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
| 239 | int rpc_queue_empty(struct rpc_wait_queue *); | 243 | int rpc_queue_empty(struct rpc_wait_queue *); |
| 240 | void rpc_delay(struct rpc_task *, unsigned long); | 244 | void rpc_delay(struct rpc_task *, unsigned long); |
| @@ -244,7 +248,8 @@ int rpciod_up(void); | |||
| 244 | void rpciod_down(void); | 248 | void rpciod_down(void); |
| 245 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | 249 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); |
| 246 | #ifdef RPC_DEBUG | 250 | #ifdef RPC_DEBUG |
| 247 | void rpc_show_tasks(void); | 251 | struct net; |
| 252 | void rpc_show_tasks(struct net *); | ||
| 248 | #endif | 253 | #endif |
| 249 | int rpc_init_mempool(void); | 254 | int rpc_init_mempool(void); |
| 250 | void rpc_destroy_mempool(void); | 255 | void rpc_destroy_mempool(void); |
| @@ -266,11 +271,22 @@ static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char pri | |||
| 266 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); | 271 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); |
| 267 | } | 272 | } |
| 268 | 273 | ||
| 269 | #ifdef RPC_DEBUG | 274 | #if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS) |
| 270 | static inline const char * rpc_qname(struct rpc_wait_queue *q) | 275 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) |
| 271 | { | 276 | { |
| 272 | return ((q && q->name) ? q->name : "unknown"); | 277 | return ((q && q->name) ? q->name : "unknown"); |
| 273 | } | 278 | } |
| 279 | |||
| 280 | static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q, | ||
| 281 | const char *name) | ||
| 282 | { | ||
| 283 | q->name = name; | ||
| 284 | } | ||
| 285 | #else | ||
| 286 | static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q, | ||
| 287 | const char *name) | ||
| 288 | { | ||
| 289 | } | ||
| 274 | #endif | 290 | #endif |
| 275 | 291 | ||
| 276 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ | 292 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ |
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h index 680471d1f28..edc64219f92 100644 --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <linux/proc_fs.h> | 12 | #include <linux/proc_fs.h> |
| 13 | 13 | ||
| 14 | struct rpc_stat { | 14 | struct rpc_stat { |
| 15 | struct rpc_program * program; | 15 | const struct rpc_program *program; |
| 16 | 16 | ||
| 17 | unsigned int netcnt, | 17 | unsigned int netcnt, |
| 18 | netudpcnt, | 18 | netudpcnt, |
| @@ -58,24 +58,24 @@ void rpc_modcount(struct inode *, int); | |||
| 58 | #endif | 58 | #endif |
| 59 | 59 | ||
| 60 | #ifdef CONFIG_PROC_FS | 60 | #ifdef CONFIG_PROC_FS |
| 61 | struct proc_dir_entry * rpc_proc_register(struct rpc_stat *); | 61 | struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *); |
| 62 | void rpc_proc_unregister(const char *); | 62 | void rpc_proc_unregister(struct net *,const char *); |
| 63 | void rpc_proc_zero(struct rpc_program *); | 63 | void rpc_proc_zero(const struct rpc_program *); |
| 64 | struct proc_dir_entry * svc_proc_register(struct svc_stat *, | 64 | struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *, |
| 65 | const struct file_operations *); | 65 | const struct file_operations *); |
| 66 | void svc_proc_unregister(const char *); | 66 | void svc_proc_unregister(struct net *, const char *); |
| 67 | 67 | ||
| 68 | void svc_seq_show(struct seq_file *, | 68 | void svc_seq_show(struct seq_file *, |
| 69 | const struct svc_stat *); | 69 | const struct svc_stat *); |
| 70 | #else | 70 | #else |
| 71 | 71 | ||
| 72 | static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; } | 72 | static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; } |
| 73 | static inline void rpc_proc_unregister(const char *p) {} | 73 | static inline void rpc_proc_unregister(struct net *net, const char *p) {} |
| 74 | static inline void rpc_proc_zero(struct rpc_program *p) {} | 74 | static inline void rpc_proc_zero(const struct rpc_program *p) {} |
| 75 | 75 | ||
| 76 | static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s, | 76 | static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s, |
| 77 | const struct file_operations *f) { return NULL; } | 77 | const struct file_operations *f) { return NULL; } |
| 78 | static inline void svc_proc_unregister(const char *p) {} | 78 | static inline void svc_proc_unregister(struct net *net, const char *p) {} |
| 79 | 79 | ||
| 80 | static inline void svc_seq_show(struct seq_file *seq, | 80 | static inline void svc_seq_show(struct seq_file *seq, |
| 81 | const struct svc_stat *st) {} | 81 | const struct svc_stat *st) {} |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 35b37b1e929..51b29ac45a8 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -84,7 +84,8 @@ struct svc_serv { | |||
| 84 | unsigned int sv_nrpools; /* number of thread pools */ | 84 | unsigned int sv_nrpools; /* number of thread pools */ |
| 85 | struct svc_pool * sv_pools; /* array of thread pools */ | 85 | struct svc_pool * sv_pools; /* array of thread pools */ |
| 86 | 86 | ||
| 87 | void (*sv_shutdown)(struct svc_serv *serv); | 87 | void (*sv_shutdown)(struct svc_serv *serv, |
| 88 | struct net *net); | ||
| 88 | /* Callback to use when last thread | 89 | /* Callback to use when last thread |
| 89 | * exits. | 90 | * exits. |
| 90 | */ | 91 | */ |
| @@ -413,22 +414,24 @@ struct svc_procedure { | |||
| 413 | /* | 414 | /* |
| 414 | * Function prototypes. | 415 | * Function prototypes. |
| 415 | */ | 416 | */ |
| 416 | void svc_rpcb_cleanup(struct svc_serv *serv); | 417 | int svc_rpcb_setup(struct svc_serv *serv, struct net *net); |
| 418 | void svc_rpcb_cleanup(struct svc_serv *serv, struct net *net); | ||
| 417 | struct svc_serv *svc_create(struct svc_program *, unsigned int, | 419 | struct svc_serv *svc_create(struct svc_program *, unsigned int, |
| 418 | void (*shutdown)(struct svc_serv *)); | 420 | void (*shutdown)(struct svc_serv *, struct net *net)); |
| 419 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | 421 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, |
| 420 | struct svc_pool *pool, int node); | 422 | struct svc_pool *pool, int node); |
| 421 | void svc_exit_thread(struct svc_rqst *); | 423 | void svc_exit_thread(struct svc_rqst *); |
| 422 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | 424 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, |
| 423 | void (*shutdown)(struct svc_serv *), | 425 | void (*shutdown)(struct svc_serv *, struct net *net), |
| 424 | svc_thread_fn, struct module *); | 426 | svc_thread_fn, struct module *); |
| 425 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | 427 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); |
| 426 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); | 428 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); |
| 427 | void svc_destroy(struct svc_serv *); | 429 | void svc_destroy(struct svc_serv *); |
| 430 | void svc_shutdown_net(struct svc_serv *, struct net *); | ||
| 428 | int svc_process(struct svc_rqst *); | 431 | int svc_process(struct svc_rqst *); |
| 429 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, | 432 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, |
| 430 | struct svc_rqst *); | 433 | struct svc_rqst *); |
| 431 | int svc_register(const struct svc_serv *, const int, | 434 | int svc_register(const struct svc_serv *, struct net *, const int, |
| 432 | const unsigned short, const unsigned short); | 435 | const unsigned short, const unsigned short); |
| 433 | 436 | ||
| 434 | void svc_wake_up(struct svc_serv *); | 437 | void svc_wake_up(struct svc_serv *); |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index dfa900948af..b3f64b12f14 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
| @@ -121,7 +121,8 @@ void svc_close_xprt(struct svc_xprt *xprt); | |||
| 121 | int svc_port_is_privileged(struct sockaddr *sin); | 121 | int svc_port_is_privileged(struct sockaddr *sin); |
| 122 | int svc_print_xprts(char *buf, int maxlen); | 122 | int svc_print_xprts(char *buf, int maxlen); |
| 123 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, | 123 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, |
| 124 | const sa_family_t af, const unsigned short port); | 124 | struct net *net, const sa_family_t af, |
| 125 | const unsigned short port); | ||
| 125 | int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); | 126 | int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); |
| 126 | 127 | ||
| 127 | static inline void svc_xprt_get(struct svc_xprt *xprt) | 128 | static inline void svc_xprt_get(struct svc_xprt *xprt) |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index 25d333c1b57..548790e9113 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
| @@ -135,6 +135,9 @@ extern void svcauth_unix_purge(void); | |||
| 135 | extern void svcauth_unix_info_release(struct svc_xprt *xpt); | 135 | extern void svcauth_unix_info_release(struct svc_xprt *xpt); |
| 136 | extern int svcauth_unix_set_client(struct svc_rqst *rqstp); | 136 | extern int svcauth_unix_set_client(struct svc_rqst *rqstp); |
| 137 | 137 | ||
| 138 | extern int unix_gid_cache_create(struct net *net); | ||
| 139 | extern void unix_gid_cache_destroy(struct net *net); | ||
| 140 | |||
| 138 | static inline unsigned long hash_str(char *name, int bits) | 141 | static inline unsigned long hash_str(char *name, int bits) |
| 139 | { | 142 | { |
| 140 | unsigned long hash = 0; | 143 | unsigned long hash = 0; |
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index 83bbee3f089..7c32daa025e 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
| @@ -18,6 +18,8 @@ | |||
| 18 | 18 | ||
| 19 | int gss_svc_init(void); | 19 | int gss_svc_init(void); |
| 20 | void gss_svc_shutdown(void); | 20 | void gss_svc_shutdown(void); |
| 21 | int gss_svc_init_net(struct net *net); | ||
| 22 | void gss_svc_shutdown_net(struct net *net); | ||
| 21 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); | 23 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); |
| 22 | u32 svcauth_gss_flavor(struct auth_domain *dom); | 24 | u32 svcauth_gss_flavor(struct auth_domain *dom); |
| 23 | char *svc_gss_principal(struct svc_rqst *); | 25 | char *svc_gss_principal(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index c84e9741cb2..cb4ac69e1f3 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
| @@ -34,7 +34,7 @@ struct svc_sock { | |||
| 34 | /* | 34 | /* |
| 35 | * Function prototypes. | 35 | * Function prototypes. |
| 36 | */ | 36 | */ |
| 37 | void svc_close_all(struct svc_serv *); | 37 | void svc_close_net(struct svc_serv *, struct net *); |
| 38 | int svc_recv(struct svc_rqst *, long); | 38 | int svc_recv(struct svc_rqst *, long); |
| 39 | int svc_send(struct svc_rqst *); | 39 | int svc_send(struct svc_rqst *); |
| 40 | void svc_drop(struct svc_rqst *); | 40 | void svc_drop(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 15518a152ac..77d278defa7 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -21,8 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | #define RPC_MIN_SLOT_TABLE (2U) | 22 | #define RPC_MIN_SLOT_TABLE (2U) |
| 23 | #define RPC_DEF_SLOT_TABLE (16U) | 23 | #define RPC_DEF_SLOT_TABLE (16U) |
| 24 | #define RPC_MAX_SLOT_TABLE (128U) | ||
| 25 | #define RPC_MAX_SLOT_TABLE_LIMIT (65536U) | 24 | #define RPC_MAX_SLOT_TABLE_LIMIT (65536U) |
| 25 | #define RPC_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE_LIMIT | ||
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| 28 | * This describes a timeout strategy | 28 | * This describes a timeout strategy |
| @@ -219,13 +219,17 @@ struct rpc_xprt { | |||
| 219 | connect_time, /* jiffies waiting for connect */ | 219 | connect_time, /* jiffies waiting for connect */ |
| 220 | sends, /* how many complete requests */ | 220 | sends, /* how many complete requests */ |
| 221 | recvs, /* how many complete requests */ | 221 | recvs, /* how many complete requests */ |
| 222 | bad_xids; /* lookup_rqst didn't find XID */ | 222 | bad_xids, /* lookup_rqst didn't find XID */ |
| 223 | max_slots; /* max rpc_slots used */ | ||
| 223 | 224 | ||
| 224 | unsigned long long req_u, /* average requests on the wire */ | 225 | unsigned long long req_u, /* average requests on the wire */ |
| 225 | bklog_u; /* backlog queue utilization */ | 226 | bklog_u, /* backlog queue utilization */ |
| 227 | sending_u, /* send q utilization */ | ||
| 228 | pending_u; /* pend q utilization */ | ||
| 226 | } stat; | 229 | } stat; |
| 227 | 230 | ||
| 228 | struct net *xprt_net; | 231 | struct net *xprt_net; |
| 232 | const char *servername; | ||
| 229 | const char *address_strings[RPC_DISPLAY_MAX]; | 233 | const char *address_strings[RPC_DISPLAY_MAX]; |
| 230 | }; | 234 | }; |
| 231 | 235 | ||
| @@ -255,6 +259,7 @@ struct xprt_create { | |||
| 255 | struct sockaddr * srcaddr; /* optional local address */ | 259 | struct sockaddr * srcaddr; /* optional local address */ |
| 256 | struct sockaddr * dstaddr; /* remote peer address */ | 260 | struct sockaddr * dstaddr; /* remote peer address */ |
| 257 | size_t addrlen; | 261 | size_t addrlen; |
| 262 | const char *servername; | ||
| 258 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | 263 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ |
| 259 | }; | 264 | }; |
| 260 | 265 | ||
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index 3f14a02e9cc..1ad36cc25b2 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h | |||
| @@ -12,18 +12,6 @@ | |||
| 12 | int init_socket_xprt(void); | 12 | int init_socket_xprt(void); |
| 13 | void cleanup_socket_xprt(void); | 13 | void cleanup_socket_xprt(void); |
| 14 | 14 | ||
| 15 | /* | ||
| 16 | * RPC slot table sizes for UDP, TCP transports | ||
| 17 | */ | ||
| 18 | extern unsigned int xprt_udp_slot_table_entries; | ||
| 19 | extern unsigned int xprt_tcp_slot_table_entries; | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Parameters for choosing a free port | ||
| 23 | */ | ||
| 24 | extern unsigned int xprt_min_resvport; | ||
| 25 | extern unsigned int xprt_max_resvport; | ||
| 26 | |||
| 27 | #define RPC_MIN_RESVPORT (1U) | 15 | #define RPC_MIN_RESVPORT (1U) |
| 28 | #define RPC_MAX_RESVPORT (65535U) | 16 | #define RPC_MAX_RESVPORT (65535U) |
| 29 | #define RPC_DEF_MIN_RESVPORT (665U) | 17 | #define RPC_DEF_MIN_RESVPORT (665U) |
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h new file mode 100644 index 00000000000..43be87d5dd5 --- /dev/null +++ b/include/trace/events/sunrpc.h | |||
| @@ -0,0 +1,177 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM sunrpc | ||
| 3 | |||
| 4 | #if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_SUNRPC_H | ||
| 6 | |||
| 7 | #include <linux/sunrpc/sched.h> | ||
| 8 | #include <linux/sunrpc/clnt.h> | ||
| 9 | #include <linux/tracepoint.h> | ||
| 10 | |||
| 11 | DECLARE_EVENT_CLASS(rpc_task_status, | ||
| 12 | |||
| 13 | TP_PROTO(struct rpc_task *task), | ||
| 14 | |||
| 15 | TP_ARGS(task), | ||
| 16 | |||
| 17 | TP_STRUCT__entry( | ||
| 18 | __field(const struct rpc_task *, task) | ||
| 19 | __field(const struct rpc_clnt *, clnt) | ||
| 20 | __field(int, status) | ||
| 21 | ), | ||
| 22 | |||
| 23 | TP_fast_assign( | ||
| 24 | __entry->task = task; | ||
| 25 | __entry->clnt = task->tk_client; | ||
| 26 | __entry->status = task->tk_status; | ||
| 27 | ), | ||
| 28 | |||
| 29 | TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) | ||
| 30 | ); | ||
| 31 | |||
| 32 | DEFINE_EVENT(rpc_task_status, rpc_call_status, | ||
| 33 | TP_PROTO(struct rpc_task *task), | ||
| 34 | |||
| 35 | TP_ARGS(task) | ||
| 36 | ); | ||
| 37 | |||
| 38 | DEFINE_EVENT(rpc_task_status, rpc_bind_status, | ||
| 39 | TP_PROTO(struct rpc_task *task), | ||
| 40 | |||
| 41 | TP_ARGS(task) | ||
| 42 | ); | ||
| 43 | |||
| 44 | TRACE_EVENT(rpc_connect_status, | ||
| 45 | TP_PROTO(struct rpc_task *task, int status), | ||
| 46 | |||
| 47 | TP_ARGS(task, status), | ||
| 48 | |||
| 49 | TP_STRUCT__entry( | ||
| 50 | __field(const struct rpc_task *, task) | ||
| 51 | __field(const struct rpc_clnt *, clnt) | ||
| 52 | __field(int, status) | ||
| 53 | ), | ||
| 54 | |||
| 55 | TP_fast_assign( | ||
| 56 | __entry->task = task; | ||
| 57 | __entry->clnt = task->tk_client; | ||
| 58 | __entry->status = status; | ||
| 59 | ), | ||
| 60 | |||
| 61 | TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) | ||
| 62 | ); | ||
| 63 | |||
| 64 | DECLARE_EVENT_CLASS(rpc_task_running, | ||
| 65 | |||
| 66 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
| 67 | |||
| 68 | TP_ARGS(clnt, task, action), | ||
| 69 | |||
| 70 | TP_STRUCT__entry( | ||
| 71 | __field(const struct rpc_clnt *, clnt) | ||
| 72 | __field(const struct rpc_task *, task) | ||
| 73 | __field(const void *, action) | ||
| 74 | __field(unsigned long, runstate) | ||
| 75 | __field(int, status) | ||
| 76 | __field(unsigned short, flags) | ||
| 77 | ), | ||
| 78 | |||
| 79 | TP_fast_assign( | ||
| 80 | __entry->clnt = clnt; | ||
| 81 | __entry->task = task; | ||
| 82 | __entry->action = action; | ||
| 83 | __entry->runstate = task->tk_runstate; | ||
| 84 | __entry->status = task->tk_status; | ||
| 85 | __entry->flags = task->tk_flags; | ||
| 86 | ), | ||
| 87 | |||
| 88 | TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d action=%pf", | ||
| 89 | __entry->task, | ||
| 90 | __entry->clnt, | ||
| 91 | __entry->flags, | ||
| 92 | __entry->runstate, | ||
| 93 | __entry->status, | ||
| 94 | __entry->action | ||
| 95 | ) | ||
| 96 | ); | ||
| 97 | |||
| 98 | DEFINE_EVENT(rpc_task_running, rpc_task_begin, | ||
| 99 | |||
| 100 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
| 101 | |||
| 102 | TP_ARGS(clnt, task, action) | ||
| 103 | |||
| 104 | ); | ||
| 105 | |||
| 106 | DEFINE_EVENT(rpc_task_running, rpc_task_run_action, | ||
| 107 | |||
| 108 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
| 109 | |||
| 110 | TP_ARGS(clnt, task, action) | ||
| 111 | |||
| 112 | ); | ||
| 113 | |||
| 114 | DEFINE_EVENT(rpc_task_running, rpc_task_complete, | ||
| 115 | |||
| 116 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
| 117 | |||
| 118 | TP_ARGS(clnt, task, action) | ||
| 119 | |||
| 120 | ); | ||
| 121 | |||
| 122 | DECLARE_EVENT_CLASS(rpc_task_queued, | ||
| 123 | |||
| 124 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), | ||
| 125 | |||
| 126 | TP_ARGS(clnt, task, q), | ||
| 127 | |||
| 128 | TP_STRUCT__entry( | ||
| 129 | __field(const struct rpc_clnt *, clnt) | ||
| 130 | __field(const struct rpc_task *, task) | ||
| 131 | __field(unsigned long, timeout) | ||
| 132 | __field(unsigned long, runstate) | ||
| 133 | __field(int, status) | ||
| 134 | __field(unsigned short, flags) | ||
| 135 | __string(q_name, rpc_qname(q)) | ||
| 136 | ), | ||
| 137 | |||
| 138 | TP_fast_assign( | ||
| 139 | __entry->clnt = clnt; | ||
| 140 | __entry->task = task; | ||
| 141 | __entry->timeout = task->tk_timeout; | ||
| 142 | __entry->runstate = task->tk_runstate; | ||
| 143 | __entry->status = task->tk_status; | ||
| 144 | __entry->flags = task->tk_flags; | ||
| 145 | __assign_str(q_name, rpc_qname(q)); | ||
| 146 | ), | ||
| 147 | |||
| 148 | TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s", | ||
| 149 | __entry->task, | ||
| 150 | __entry->clnt, | ||
| 151 | __entry->flags, | ||
| 152 | __entry->runstate, | ||
| 153 | __entry->status, | ||
| 154 | __entry->timeout, | ||
| 155 | __get_str(q_name) | ||
| 156 | ) | ||
| 157 | ); | ||
| 158 | |||
| 159 | DEFINE_EVENT(rpc_task_queued, rpc_task_sleep, | ||
| 160 | |||
| 161 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), | ||
| 162 | |||
| 163 | TP_ARGS(clnt, task, q) | ||
| 164 | |||
| 165 | ); | ||
| 166 | |||
| 167 | DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup, | ||
| 168 | |||
| 169 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), | ||
| 170 | |||
| 171 | TP_ARGS(clnt, task, q) | ||
| 172 | |||
| 173 | ); | ||
| 174 | |||
| 175 | #endif /* _TRACE_SUNRPC_H */ | ||
| 176 | |||
| 177 | #include <trace/define_trace.h> | ||
