aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-13 19:46:18 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-13 19:46:18 -0400
commit16cefa8c3863721fd40445a1b34dea18cd16ccfe (patch)
treec8e58ca06e2edfd667d3e6062a642b80cc58e5e7 /include
parent4fbef206daead133085fe33905f5e842d38fb8da (diff)
parentd8558f99fbc5ef5d4ae76b893784005056450f82 (diff)
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (122 commits) sunrpc: drop BKL around wrap and unwrap NFSv4: Make sure unlock is really an unlock when cancelling a lock NLM: fix source address of callback to client SUNRPC client: add interface for binding to a local address SUNRPC server: record the destination address of a request SUNRPC: cleanup transport creation argument passing NFSv4: Make the NFS state model work with the nosharedcache mount option NFS: Error when mounting the same filesystem with different options NFS: Add the mount option "nosharecache" NFS: Add support for mounting NFSv4 file systems with string options NFS: Add final pieces to support in-kernel mount option parsing NFS: Introduce generic mount client API NFS: Add enums and match tables for mount option parsing NFS: Improve debugging output in NFS in-kernel mount client NFS: Clean up in-kernel NFS mount NFS: Remake nfsroot_mount as a permanent part of NFS client SUNRPC: Add a convenient default for the hostname when calling rpc_create() SUNRPC: Rename rpcb_getport to be consistent with new rpcb_getport_sync name SUNRPC: Rename rpcb_getport_external routine SUNRPC: Allow rpcbind requests to be interrupted by a signal. ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/nfs4.h1
-rw-r--r--include/linux/nfs4_mount.h3
-rw-r--r--include/linux/nfs_fs.h28
-rw-r--r--include/linux/nfs_fs_sb.h8
-rw-r--r--include/linux/nfs_mount.h3
-rw-r--r--include/linux/nfs_page.h25
-rw-r--r--include/linux/nfs_xdr.h5
-rw-r--r--include/linux/sunrpc/auth.h48
-rw-r--r--include/linux/sunrpc/auth_gss.h6
-rw-r--r--include/linux/sunrpc/clnt.h33
-rw-r--r--include/linux/sunrpc/gss_api.h2
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/sched.h6
-rw-r--r--include/linux/sunrpc/svcsock.h1
-rw-r--r--include/linux/sunrpc/xprt.h16
16 files changed, 96 insertions, 92 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 05707e2fccae..e2d1ce36b367 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -39,6 +39,7 @@
39struct nlm_host { 39struct nlm_host {
40 struct hlist_node h_hash; /* doubly linked list */ 40 struct hlist_node h_hash; /* doubly linked list */
41 struct sockaddr_in h_addr; /* peer address */ 41 struct sockaddr_in h_addr; /* peer address */
42 struct sockaddr_in h_saddr; /* our address (optional) */
42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 43 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
43 char * h_name; /* remote hostname */ 44 char * h_name; /* remote hostname */
44 u32 h_version; /* interface version */ 45 u32 h_version; /* interface version */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 7e7f33a38fc0..8726491de154 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18#define NFS4_BITMAP_SIZE 2
18#define NFS4_VERIFIER_SIZE 8 19#define NFS4_VERIFIER_SIZE 8
19#define NFS4_STATEID_SIZE 16 20#define NFS4_STATEID_SIZE 16
20#define NFS4_FHSIZE 128 21#define NFS4_FHSIZE 128
diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h
index 26b4c83f831d..a0dcf6655657 100644
--- a/include/linux/nfs4_mount.h
+++ b/include/linux/nfs4_mount.h
@@ -65,6 +65,7 @@ struct nfs4_mount_data {
65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */ 65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */ 66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */ 67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
68#define NFS4_MOUNT_FLAGMASK 0xFFFF 68#define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */
69#define NFS4_MOUNT_FLAGMASK 0x9033
69 70
70#endif 71#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0543439a97af..c098ae194f79 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -30,7 +30,9 @@
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32#include <linux/in.h> 32#include <linux/in.h>
33#include <linux/kref.h>
33#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/namei.h>
34#include <linux/pagemap.h> 36#include <linux/pagemap.h>
35#include <linux/rbtree.h> 37#include <linux/rbtree.h>
36#include <linux/rwsem.h> 38#include <linux/rwsem.h>
@@ -69,9 +71,8 @@ struct nfs_access_entry {
69 71
70struct nfs4_state; 72struct nfs4_state;
71struct nfs_open_context { 73struct nfs_open_context {
72 atomic_t count; 74 struct kref kref;
73 struct vfsmount *vfsmnt; 75 struct path path;
74 struct dentry *dentry;
75 struct rpc_cred *cred; 76 struct rpc_cred *cred;
76 struct nfs4_state *state; 77 struct nfs4_state *state;
77 fl_owner_t lockowner; 78 fl_owner_t lockowner;
@@ -155,13 +156,9 @@ struct nfs_inode {
155 /* 156 /*
156 * This is the list of dirty unwritten pages. 157 * This is the list of dirty unwritten pages.
157 */ 158 */
158 spinlock_t req_lock;
159 struct list_head dirty;
160 struct list_head commit;
161 struct radix_tree_root nfs_page_tree; 159 struct radix_tree_root nfs_page_tree;
162 160
163 unsigned int ndirty, 161 unsigned long ncommit,
164 ncommit,
165 npages; 162 npages;
166 163
167 /* Open contexts for shared mmap writes */ 164 /* Open contexts for shared mmap writes */
@@ -187,6 +184,7 @@ struct nfs_inode {
187#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ 184#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */
188#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ 185#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */
189#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ 186#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */
187#define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */
190 188
191/* 189/*
192 * Bit offsets in flags field 190 * Bit offsets in flags field
@@ -496,21 +494,18 @@ static inline void nfs3_forget_cached_acls(struct inode *inode)
496 494
497/* 495/*
498 * linux/fs/mount_clnt.c 496 * linux/fs/mount_clnt.c
499 * (Used only by nfsroot module)
500 */ 497 */
501extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *, 498extern int nfs_mount(struct sockaddr *, size_t, char *, char *,
502 int, int); 499 int, int, struct nfs_fh *);
503 500
504/* 501/*
505 * inline functions 502 * inline functions
506 */ 503 */
507 504
508static inline loff_t 505static inline loff_t nfs_size_to_loff_t(__u64 size)
509nfs_size_to_loff_t(__u64 size)
510{ 506{
511 loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; 507 if (size > (__u64) OFFSET_MAX - 1)
512 if (size > maxsz) 508 return OFFSET_MAX - 1;
513 return maxsz;
514 return (loff_t) size; 509 return (loff_t) size;
515} 510}
516 511
@@ -557,6 +552,7 @@ extern void * nfs_root_data(void);
557#define NFSDBG_ROOT 0x0080 552#define NFSDBG_ROOT 0x0080
558#define NFSDBG_CALLBACK 0x0100 553#define NFSDBG_CALLBACK 0x0100
559#define NFSDBG_CLIENT 0x0200 554#define NFSDBG_CLIENT 0x0200
555#define NFSDBG_MOUNT 0x0400
560#define NFSDBG_ALL 0xFFFF 556#define NFSDBG_ALL 0xFFFF
561 557
562#ifdef __KERNEL__ 558#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 52b4378311c8..0cac49bc0955 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -16,7 +16,6 @@ struct nfs_client {
16#define NFS_CS_INITING 1 /* busy initialising */ 16#define NFS_CS_INITING 1 /* busy initialising */
17 int cl_nfsversion; /* NFS protocol version */ 17 int cl_nfsversion; /* NFS protocol version */
18 unsigned long cl_res_state; /* NFS resources state */ 18 unsigned long cl_res_state; /* NFS resources state */
19#define NFS_CS_RPCIOD 0 /* - rpciod started */
20#define NFS_CS_CALLBACK 1 /* - callback started */ 19#define NFS_CS_CALLBACK 1 /* - callback started */
21#define NFS_CS_IDMAP 2 /* - idmap started */ 20#define NFS_CS_IDMAP 2 /* - idmap started */
22#define NFS_CS_RENEWD 3 /* - renewd started */ 21#define NFS_CS_RENEWD 3 /* - renewd started */
@@ -35,7 +34,8 @@ struct nfs_client {
35 nfs4_verifier cl_confirm; 34 nfs4_verifier cl_confirm;
36 unsigned long cl_state; 35 unsigned long cl_state;
37 36
38 u32 cl_lockowner_id; 37 struct rb_root cl_openowner_id;
38 struct rb_root cl_lockowner_id;
39 39
40 /* 40 /*
41 * The following rwsem ensures exclusive access to the server 41 * The following rwsem ensures exclusive access to the server
@@ -44,9 +44,7 @@ struct nfs_client {
44 struct rw_semaphore cl_sem; 44 struct rw_semaphore cl_sem;
45 45
46 struct list_head cl_delegations; 46 struct list_head cl_delegations;
47 struct list_head cl_state_owners; 47 struct rb_root cl_state_owners;
48 struct list_head cl_unused;
49 int cl_nunused;
50 spinlock_t cl_lock; 48 spinlock_t cl_lock;
51 49
52 unsigned long cl_lease_time; 50 unsigned long cl_lease_time;
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index cc8b9c59acb8..a3ade89a64d2 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -37,7 +37,7 @@ struct nfs_mount_data {
37 int acdirmin; /* 1 */ 37 int acdirmin; /* 1 */
38 int acdirmax; /* 1 */ 38 int acdirmax; /* 1 */
39 struct sockaddr_in addr; /* 1 */ 39 struct sockaddr_in addr; /* 1 */
40 char hostname[256]; /* 1 */ 40 char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
41 int namlen; /* 2 */ 41 int namlen; /* 2 */
42 unsigned int bsize; /* 3 */ 42 unsigned int bsize; /* 3 */
43 struct nfs3_fh root; /* 4 */ 43 struct nfs3_fh root; /* 4 */
@@ -62,6 +62,7 @@ struct nfs_mount_data {
62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ 62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ 63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ 64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
65#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
65#define NFS_MOUNT_FLAGMASK 0xFFFF 66#define NFS_MOUNT_FLAGMASK 0xFFFF
66 67
67#endif 68#endif
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index bd193af80162..78e60798d10e 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -16,12 +16,13 @@
16#include <linux/sunrpc/auth.h> 16#include <linux/sunrpc/auth.h>
17#include <linux/nfs_xdr.h> 17#include <linux/nfs_xdr.h>
18 18
19#include <asm/atomic.h> 19#include <linux/kref.h>
20 20
21/* 21/*
22 * Valid flags for the radix tree 22 * Valid flags for the radix tree
23 */ 23 */
24#define NFS_PAGE_TAG_WRITEBACK 0 24#define NFS_PAGE_TAG_LOCKED 0
25#define NFS_PAGE_TAG_COMMIT 1
25 26
26/* 27/*
27 * Valid flags for a dirty buffer 28 * Valid flags for a dirty buffer
@@ -33,8 +34,7 @@
33 34
34struct nfs_inode; 35struct nfs_inode;
35struct nfs_page { 36struct nfs_page {
36 struct list_head wb_list, /* Defines state of page: */ 37 struct list_head wb_list; /* Defines state of page: */
37 *wb_list_head; /* read/write/commit */
38 struct page *wb_page; /* page to read in/write out */ 38 struct page *wb_page; /* page to read in/write out */
39 struct nfs_open_context *wb_context; /* File state context info */ 39 struct nfs_open_context *wb_context; /* File state context info */
40 atomic_t wb_complete; /* i/os we're waiting for */ 40 atomic_t wb_complete; /* i/os we're waiting for */
@@ -42,7 +42,7 @@ struct nfs_page {
42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ 42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
43 wb_pgbase, /* Start of page data */ 43 wb_pgbase, /* Start of page data */
44 wb_bytes; /* Length of request */ 44 wb_bytes; /* Length of request */
45 atomic_t wb_count; /* reference count */ 45 struct kref wb_kref; /* reference count */
46 unsigned long wb_flags; 46 unsigned long wb_flags;
47 struct nfs_writeverf wb_verf; /* Commit cookie */ 47 struct nfs_writeverf wb_verf; /* Commit cookie */
48}; 48};
@@ -71,8 +71,8 @@ extern void nfs_clear_request(struct nfs_page *req);
71extern void nfs_release_request(struct nfs_page *req); 71extern void nfs_release_request(struct nfs_page *req);
72 72
73 73
74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, 74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
75 pgoff_t idx_start, unsigned int npages); 75 pgoff_t idx_start, unsigned int npages, int tag);
76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
77 struct inode *inode, 77 struct inode *inode,
78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), 78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int),
@@ -84,12 +84,11 @@ extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc);
84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); 84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
85extern int nfs_wait_on_request(struct nfs_page *); 85extern int nfs_wait_on_request(struct nfs_page *);
86extern void nfs_unlock_request(struct nfs_page *req); 86extern void nfs_unlock_request(struct nfs_page *req);
87extern int nfs_set_page_writeback_locked(struct nfs_page *req); 87extern void nfs_clear_page_tag_locked(struct nfs_page *req);
88extern void nfs_clear_page_writeback(struct nfs_page *req);
89 88
90 89
91/* 90/*
92 * Lock the page of an asynchronous request without incrementing the wb_count 91 * Lock the page of an asynchronous request without getting a new reference
93 */ 92 */
94static inline int 93static inline int
95nfs_lock_request_dontget(struct nfs_page *req) 94nfs_lock_request_dontget(struct nfs_page *req)
@@ -98,14 +97,14 @@ nfs_lock_request_dontget(struct nfs_page *req)
98} 97}
99 98
100/* 99/*
101 * Lock the page of an asynchronous request 100 * Lock the page of an asynchronous request and take a reference
102 */ 101 */
103static inline int 102static inline int
104nfs_lock_request(struct nfs_page *req) 103nfs_lock_request(struct nfs_page *req)
105{ 104{
106 if (test_and_set_bit(PG_BUSY, &req->wb_flags)) 105 if (test_and_set_bit(PG_BUSY, &req->wb_flags))
107 return 0; 106 return 0;
108 atomic_inc(&req->wb_count); 107 kref_get(&req->wb_kref);
109 return 1; 108 return 1;
110} 109}
111 110
@@ -118,7 +117,6 @@ static inline void
118nfs_list_add_request(struct nfs_page *req, struct list_head *head) 117nfs_list_add_request(struct nfs_page *req, struct list_head *head)
119{ 118{
120 list_add_tail(&req->wb_list, head); 119 list_add_tail(&req->wb_list, head);
121 req->wb_list_head = head;
122} 120}
123 121
124 122
@@ -132,7 +130,6 @@ nfs_list_remove_request(struct nfs_page *req)
132 if (list_empty(&req->wb_list)) 130 if (list_empty(&req->wb_list))
133 return; 131 return;
134 list_del_init(&req->wb_list); 132 list_del_init(&req->wb_list);
135 req->wb_list_head = NULL;
136} 133}
137 134
138static inline struct nfs_page * 135static inline struct nfs_page *
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 10c26ed0db71..38d77681cf27 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -119,7 +119,7 @@ struct nfs_openargs {
119 struct nfs_seqid * seqid; 119 struct nfs_seqid * seqid;
120 int open_flags; 120 int open_flags;
121 __u64 clientid; 121 __u64 clientid;
122 __u32 id; 122 __u64 id;
123 union { 123 union {
124 struct iattr * attrs; /* UNCHECKED, GUARDED */ 124 struct iattr * attrs; /* UNCHECKED, GUARDED */
125 nfs4_verifier verifier; /* EXCLUSIVE */ 125 nfs4_verifier verifier; /* EXCLUSIVE */
@@ -144,6 +144,7 @@ struct nfs_openres {
144 nfs4_stateid delegation; 144 nfs4_stateid delegation;
145 __u32 do_recall; 145 __u32 do_recall;
146 __u64 maxsize; 146 __u64 maxsize;
147 __u32 attrset[NFS4_BITMAP_SIZE];
147}; 148};
148 149
149/* 150/*
@@ -180,7 +181,7 @@ struct nfs_closeres {
180 * */ 181 * */
181struct nfs_lowner { 182struct nfs_lowner {
182 __u64 clientid; 183 __u64 clientid;
183 u32 id; 184 __u64 id;
184}; 185};
185 186
186struct nfs_lock_args { 187struct nfs_lock_args {
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 534cdc7be58d..7a69ca3bebaf 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -16,6 +16,7 @@
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19#include <linux/rcupdate.h>
19 20
20/* size of the nodename buffer */ 21/* size of the nodename buffer */
21#define UNX_MAXNODENAME 32 22#define UNX_MAXNODENAME 32
@@ -30,22 +31,28 @@ struct auth_cred {
30/* 31/*
31 * Client user credentials 32 * Client user credentials
32 */ 33 */
34struct rpc_auth;
35struct rpc_credops;
33struct rpc_cred { 36struct rpc_cred {
34 struct hlist_node cr_hash; /* hash chain */ 37 struct hlist_node cr_hash; /* hash chain */
35 struct rpc_credops * cr_ops; 38 struct list_head cr_lru; /* lru garbage collection */
36 unsigned long cr_expire; /* when to gc */ 39 struct rcu_head cr_rcu;
37 atomic_t cr_count; /* ref count */ 40 struct rpc_auth * cr_auth;
38 unsigned short cr_flags; /* various flags */ 41 const struct rpc_credops *cr_ops;
39#ifdef RPC_DEBUG 42#ifdef RPC_DEBUG
40 unsigned long cr_magic; /* 0x0f4aa4f0 */ 43 unsigned long cr_magic; /* 0x0f4aa4f0 */
41#endif 44#endif
45 unsigned long cr_expire; /* when to gc */
46 unsigned long cr_flags; /* various flags */
47 atomic_t cr_count; /* ref count */
42 48
43 uid_t cr_uid; 49 uid_t cr_uid;
44 50
45 /* per-flavor data */ 51 /* per-flavor data */
46}; 52};
47#define RPCAUTH_CRED_NEW 0x0001 53#define RPCAUTH_CRED_NEW 0
48#define RPCAUTH_CRED_UPTODATE 0x0002 54#define RPCAUTH_CRED_UPTODATE 1
55#define RPCAUTH_CRED_HASHED 2
49 56
50#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 57#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0
51 58
@@ -56,10 +63,10 @@ struct rpc_cred {
56#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) 63#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1)
57struct rpc_cred_cache { 64struct rpc_cred_cache {
58 struct hlist_head hashtable[RPC_CREDCACHE_NR]; 65 struct hlist_head hashtable[RPC_CREDCACHE_NR];
59 unsigned long nextgc; /* next garbage collection */ 66 spinlock_t lock;
60 unsigned long expire; /* cache expiry interval */
61}; 67};
62 68
69struct rpc_authops;
63struct rpc_auth { 70struct rpc_auth {
64 unsigned int au_cslack; /* call cred size estimate */ 71 unsigned int au_cslack; /* call cred size estimate */
65 /* guess at number of u32's auth adds before 72 /* guess at number of u32's auth adds before
@@ -69,7 +76,7 @@ struct rpc_auth {
69 unsigned int au_verfsize; 76 unsigned int au_verfsize;
70 77
71 unsigned int au_flags; /* various flags */ 78 unsigned int au_flags; /* various flags */
72 struct rpc_authops * au_ops; /* operations */ 79 const struct rpc_authops *au_ops; /* operations */
73 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 80 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
74 * differ from the flavor in 81 * differ from the flavor in
75 * au_ops->au_flavor in gss 82 * au_ops->au_flavor in gss
@@ -115,17 +122,19 @@ struct rpc_credops {
115 void *, __be32 *, void *); 122 void *, __be32 *, void *);
116}; 123};
117 124
118extern struct rpc_authops authunix_ops; 125extern const struct rpc_authops authunix_ops;
119extern struct rpc_authops authnull_ops; 126extern const struct rpc_authops authnull_ops;
120#ifdef CONFIG_SUNRPC_SECURE 127
121extern struct rpc_authops authdes_ops; 128void __init rpc_init_authunix(void);
122#endif 129void __init rpcauth_init_module(void);
130void __exit rpcauth_remove_module(void);
123 131
124int rpcauth_register(struct rpc_authops *); 132int rpcauth_register(const struct rpc_authops *);
125int rpcauth_unregister(struct rpc_authops *); 133int rpcauth_unregister(const struct rpc_authops *);
126struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 134struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
127void rpcauth_destroy(struct rpc_auth *); 135void rpcauth_release(struct rpc_auth *);
128struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 136struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
137void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
129struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); 138struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
130struct rpc_cred * rpcauth_bindcred(struct rpc_task *); 139struct rpc_cred * rpcauth_bindcred(struct rpc_task *);
131void rpcauth_holdcred(struct rpc_task *); 140void rpcauth_holdcred(struct rpc_task *);
@@ -138,8 +147,9 @@ int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
138int rpcauth_refreshcred(struct rpc_task *); 147int rpcauth_refreshcred(struct rpc_task *);
139void rpcauth_invalcred(struct rpc_task *); 148void rpcauth_invalcred(struct rpc_task *);
140int rpcauth_uptodatecred(struct rpc_task *); 149int rpcauth_uptodatecred(struct rpc_task *);
141int rpcauth_init_credcache(struct rpc_auth *, unsigned long); 150int rpcauth_init_credcache(struct rpc_auth *);
142void rpcauth_free_credcache(struct rpc_auth *); 151void rpcauth_destroy_credcache(struct rpc_auth *);
152void rpcauth_clear_credcache(struct rpc_cred_cache *);
143 153
144static inline 154static inline
145struct rpc_cred * get_rpccred(struct rpc_cred *cred) 155struct rpc_cred * get_rpccred(struct rpc_cred *cred)
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 2db2fbf34947..67658e17a375 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -75,6 +75,7 @@ struct gss_cl_ctx {
75 struct xdr_netobj gc_wire_ctx; 75 struct xdr_netobj gc_wire_ctx;
76 u32 gc_win; 76 u32 gc_win;
77 unsigned long gc_expiry; 77 unsigned long gc_expiry;
78 struct rcu_head gc_rcu;
78}; 79};
79 80
80struct gss_upcall_msg; 81struct gss_upcall_msg;
@@ -85,11 +86,6 @@ struct gss_cred {
85 struct gss_upcall_msg *gc_upcall; 86 struct gss_upcall_msg *gc_upcall;
86}; 87};
87 88
88#define gc_uid gc_base.cr_uid
89#define gc_count gc_base.cr_count
90#define gc_flags gc_base.cr_flags
91#define gc_expire gc_base.cr_expire
92
93#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
94#endif /* _LINUX_SUNRPC_AUTH_GSS_H */ 90#endif /* _LINUX_SUNRPC_AUTH_GSS_H */
95 91
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 66611423c8ee..c0d9d14983b3 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -24,8 +24,10 @@ struct rpc_inode;
24 * The high-level client handle 24 * The high-level client handle
25 */ 25 */
26struct rpc_clnt { 26struct rpc_clnt {
27 atomic_t cl_count; /* Number of clones */ 27 struct kref cl_kref; /* Number of references */
28 atomic_t cl_users; /* number of references */ 28 struct list_head cl_clients; /* Global list of clients */
29 struct list_head cl_tasks; /* List of tasks */
30 spinlock_t cl_lock; /* spinlock */
29 struct rpc_xprt * cl_xprt; /* transport */ 31 struct rpc_xprt * cl_xprt; /* transport */
30 struct rpc_procinfo * cl_procinfo; /* procedure info */ 32 struct rpc_procinfo * cl_procinfo; /* procedure info */
31 u32 cl_prog, /* RPC program number */ 33 u32 cl_prog, /* RPC program number */
@@ -41,9 +43,7 @@ struct rpc_clnt {
41 unsigned int cl_softrtry : 1,/* soft timeouts */ 43 unsigned int cl_softrtry : 1,/* soft timeouts */
42 cl_intr : 1,/* interruptible */ 44 cl_intr : 1,/* interruptible */
43 cl_discrtry : 1,/* disconnect before retry */ 45 cl_discrtry : 1,/* disconnect before retry */
44 cl_autobind : 1,/* use getport() */ 46 cl_autobind : 1;/* use getport() */
45 cl_oneshot : 1,/* dispose after use */
46 cl_dead : 1;/* abandoned */
47 47
48 struct rpc_rtt * cl_rtt; /* RTO estimator data */ 48 struct rpc_rtt * cl_rtt; /* RTO estimator data */
49 49
@@ -98,6 +98,7 @@ struct rpc_create_args {
98 int protocol; 98 int protocol;
99 struct sockaddr *address; 99 struct sockaddr *address;
100 size_t addrsize; 100 size_t addrsize;
101 struct sockaddr *saddress;
101 struct rpc_timeout *timeout; 102 struct rpc_timeout *timeout;
102 char *servername; 103 char *servername;
103 struct rpc_program *program; 104 struct rpc_program *program;
@@ -110,20 +111,20 @@ struct rpc_create_args {
110#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) 111#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0)
111#define RPC_CLNT_CREATE_INTR (1UL << 1) 112#define RPC_CLNT_CREATE_INTR (1UL << 1)
112#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) 113#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2)
113#define RPC_CLNT_CREATE_ONESHOT (1UL << 3) 114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3)
114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4) 115#define RPC_CLNT_CREATE_NOPING (1UL << 4)
115#define RPC_CLNT_CREATE_NOPING (1UL << 5) 116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5)
116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 6)
117 117
118struct rpc_clnt *rpc_create(struct rpc_create_args *args); 118struct rpc_clnt *rpc_create(struct rpc_create_args *args);
119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
120 struct rpc_program *, int); 120 struct rpc_program *, int);
121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
122int rpc_shutdown_client(struct rpc_clnt *); 122void rpc_shutdown_client(struct rpc_clnt *);
123int rpc_destroy_client(struct rpc_clnt *);
124void rpc_release_client(struct rpc_clnt *); 123void rpc_release_client(struct rpc_clnt *);
124
125int rpcb_register(u32, u32, int, unsigned short, int *); 125int rpcb_register(u32, u32, int, unsigned short, int *);
126void rpcb_getport(struct rpc_task *); 126int rpcb_getport_sync(struct sockaddr_in *, __u32, __u32, int);
127void rpcb_getport_async(struct rpc_task *);
127 128
128void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); 129void rpc_call_setup(struct rpc_task *, struct rpc_message *, int);
129 130
@@ -132,20 +133,16 @@ int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg,
132 void *calldata); 133 void *calldata);
133int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, 134int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg,
134 int flags); 135 int flags);
136struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
137 int flags);
135void rpc_restart_call(struct rpc_task *); 138void rpc_restart_call(struct rpc_task *);
136void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); 139void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset);
137void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); 140void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset);
138void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 141void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
139size_t rpc_max_payload(struct rpc_clnt *); 142size_t rpc_max_payload(struct rpc_clnt *);
140void rpc_force_rebind(struct rpc_clnt *); 143void rpc_force_rebind(struct rpc_clnt *);
141int rpc_ping(struct rpc_clnt *clnt, int flags);
142size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); 144size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
143char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); 145char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
144 146
145/*
146 * Helper function for NFSroot support
147 */
148int rpcb_getport_external(struct sockaddr_in *, __u32, __u32, int);
149
150#endif /* __KERNEL__ */ 147#endif /* __KERNEL__ */
151#endif /* _LINUX_SUNRPC_CLNT_H */ 148#endif /* _LINUX_SUNRPC_CLNT_H */
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 5eca9e442051..bbac101ac372 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -77,7 +77,7 @@ struct gss_api_mech {
77 struct module *gm_owner; 77 struct module *gm_owner;
78 struct xdr_netobj gm_oid; 78 struct xdr_netobj gm_oid;
79 char *gm_name; 79 char *gm_name;
80 struct gss_api_ops *gm_ops; 80 const struct gss_api_ops *gm_ops;
81 /* pseudoflavors supported by this mechanism: */ 81 /* pseudoflavors supported by this mechanism: */
82 int gm_pf_num; 82 int gm_pf_num;
83 struct pf_desc * gm_pfs; 83 struct pf_desc * gm_pfs;
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index ad293760f6eb..51b977a4ca20 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -23,9 +23,11 @@ struct rpc_inode {
23 void *private; 23 void *private;
24 struct list_head pipe; 24 struct list_head pipe;
25 struct list_head in_upcall; 25 struct list_head in_upcall;
26 struct list_head in_downcall;
26 int pipelen; 27 int pipelen;
27 int nreaders; 28 int nreaders;
28 int nwriters; 29 int nwriters;
30 int nkern_readwriters;
29 wait_queue_head_t waitq; 31 wait_queue_head_t waitq;
30#define RPC_PIPE_WAIT_FOR_OPEN 1 32#define RPC_PIPE_WAIT_FOR_OPEN 1
31 int flags; 33 int flags;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 2047fb202a13..8ea077db0099 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -98,7 +98,6 @@ struct rpc_task {
98 unsigned short tk_pid; /* debugging aid */ 98 unsigned short tk_pid; /* debugging aid */
99#endif 99#endif
100}; 100};
101#define tk_auth tk_client->cl_auth
102#define tk_xprt tk_client->cl_xprt 101#define tk_xprt tk_client->cl_xprt
103 102
104/* support walking a list of tasks on a wait queue */ 103/* support walking a list of tasks on a wait queue */
@@ -110,11 +109,6 @@ struct rpc_task {
110 if (!list_empty(head) && \ 109 if (!list_empty(head) && \
111 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) 110 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1))
112 111
113/* .. and walking list of all tasks */
114#define alltask_for_each(task, pos, head) \
115 list_for_each(pos, head) \
116 if ((task=list_entry(pos, struct rpc_task, tk_task)),1)
117
118typedef void (*rpc_action)(struct rpc_task *); 112typedef void (*rpc_action)(struct rpc_task *);
119 113
120struct rpc_call_ops { 114struct rpc_call_ops {
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index e21dd93ac4b7..a53e0fa855d2 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -59,6 +59,7 @@ struct svc_sock {
59 /* cache of various info for TCP sockets */ 59 /* cache of various info for TCP sockets */
60 void *sk_info_authunix; 60 void *sk_info_authunix;
61 61
62 struct sockaddr_storage sk_local; /* local address */
62 struct sockaddr_storage sk_remote; /* remote peer's address */ 63 struct sockaddr_storage sk_remote; /* remote peer's address */
63 int sk_remotelen; /* length of address */ 64 int sk_remotelen; /* length of address */
64}; 65};
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 34f7590506fa..d11cedd14f0f 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -17,6 +17,8 @@
17#include <linux/sunrpc/xdr.h> 17#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h> 18#include <linux/sunrpc/msg_prot.h>
19 19
20#ifdef __KERNEL__
21
20extern unsigned int xprt_udp_slot_table_entries; 22extern unsigned int xprt_udp_slot_table_entries;
21extern unsigned int xprt_tcp_slot_table_entries; 23extern unsigned int xprt_tcp_slot_table_entries;
22 24
@@ -194,7 +196,13 @@ struct rpc_xprt {
194 char * address_strings[RPC_DISPLAY_MAX]; 196 char * address_strings[RPC_DISPLAY_MAX];
195}; 197};
196 198
197#ifdef __KERNEL__ 199struct rpc_xprtsock_create {
200 int proto; /* IPPROTO_UDP or IPPROTO_TCP */
201 struct sockaddr * srcaddr; /* optional local address */
202 struct sockaddr * dstaddr; /* remote peer address */
203 size_t addrlen;
204 struct rpc_timeout * timeout; /* optional timeout parameters */
205};
198 206
199/* 207/*
200 * Transport operations used by ULPs 208 * Transport operations used by ULPs
@@ -204,7 +212,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long
204/* 212/*
205 * Generic internal transport functions 213 * Generic internal transport functions
206 */ 214 */
207struct rpc_xprt * xprt_create_transport(int proto, struct sockaddr *addr, size_t size, struct rpc_timeout *toparms); 215struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args);
208void xprt_connect(struct rpc_task *task); 216void xprt_connect(struct rpc_task *task);
209void xprt_reserve(struct rpc_task *task); 217void xprt_reserve(struct rpc_task *task);
210int xprt_reserve_xprt(struct rpc_task *task); 218int xprt_reserve_xprt(struct rpc_task *task);
@@ -242,8 +250,8 @@ void xprt_disconnect(struct rpc_xprt *xprt);
242/* 250/*
243 * Socket transport setup operations 251 * Socket transport setup operations
244 */ 252 */
245struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 253struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args);
246struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 254struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args);
247int init_socket_xprt(void); 255int init_socket_xprt(void);
248void cleanup_socket_xprt(void); 256void cleanup_socket_xprt(void);
249 257