aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 20:21:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 20:21:24 -0500
commit713404d6082fee34a829a0c6d511e4aec72d7654 (patch)
treedccfa03988c763b0b39241181f37cdffb5b0fdcc /include
parentd599edcaea987e233fad808f88850f725e8a5530 (diff)
parentdb43910cb42285a99f45f7e0a0a32e32d0b61dcf (diff)
Merge branch 'for-2.6.29' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.29' of git://linux-nfs.org/~bfields/linux: (67 commits) nfsd: get rid of NFSD_VERSION nfsd: last_byte_offset nfsd: delete wrong file comment from nfsd/nfs4xdr.c nfsd: git rid of nfs4_cb_null_ops declaration nfsd: dprint each op status in nfsd4_proc_compound nfsd: add etoosmall to nfserrno NFSD: FIDs need to take precedence over UUIDs SUNRPC: The sunrpc server code should not be used by out-of-tree modules svc: Clean up deferred requests on transport destruction nfsd: fix double-locks of directory mutex svc: Move kfree of deferral record to common code CRED: Fix NFSD regression NLM: Clean up flow of control in make_socks() function NLM: Refactor make_socks() function nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT SUNRPC: Ensure the server closes sockets in a timely fashion NFSD: Add documenting comments for nfsctl interface NFSD: Replace open-coded integer with macro NFSD: Fix a handful of coding style issues in write_filehandle() NFSD: clean up failover sysctl function naming ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/lockd/lockd.h68
-rw-r--r--include/linux/lockd/sm_inter.h48
-rw-r--r--include/linux/lockd/xdr.h15
-rw-r--r--include/linux/nfs4.h2
-rw-r--r--include/linux/nfsd/nfsd.h1
-rw-r--r--include/linux/nfsd/nfsfh.h4
-rw-r--r--include/linux/sunrpc/svc.h5
7 files changed, 64 insertions, 79 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 23da3fa69efa..aa6fe7026de7 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -43,8 +43,8 @@ struct nlm_host {
43 struct sockaddr_storage h_addr; /* peer address */ 43 struct sockaddr_storage h_addr; /* peer address */
44 size_t h_addrlen; 44 size_t h_addrlen;
45 struct sockaddr_storage h_srcaddr; /* our address (optional) */ 45 struct sockaddr_storage h_srcaddr; /* our address (optional) */
46 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 46 struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */
47 char * h_name; /* remote hostname */ 47 char *h_name; /* remote hostname */
48 u32 h_version; /* interface version */ 48 u32 h_version; /* interface version */
49 unsigned short h_proto; /* transport proto */ 49 unsigned short h_proto; /* transport proto */
50 unsigned short h_reclaiming : 1, 50 unsigned short h_reclaiming : 1,
@@ -64,21 +64,29 @@ struct nlm_host {
64 spinlock_t h_lock; 64 spinlock_t h_lock;
65 struct list_head h_granted; /* Locks in GRANTED state */ 65 struct list_head h_granted; /* Locks in GRANTED state */
66 struct list_head h_reclaim; /* Locks in RECLAIM state */ 66 struct list_head h_reclaim; /* Locks in RECLAIM state */
67 struct nsm_handle * h_nsmhandle; /* NSM status handle */ 67 struct nsm_handle *h_nsmhandle; /* NSM status handle */
68 68 char *h_addrbuf; /* address eyecatcher */
69 char h_addrbuf[48], /* address eyecatchers */
70 h_srcaddrbuf[48];
71}; 69};
72 70
71/*
72 * The largest string sm_addrbuf should hold is a full-size IPv6 address
73 * (no "::" anywhere) with a scope ID. The buffer size is computed to
74 * hold eight groups of colon-separated four-hex-digit numbers, a
75 * percent sign, a scope id (at most 32 bits, in decimal), and NUL.
76 */
77#define NSM_ADDRBUF ((8 * 4 + 7) + (1 + 10) + 1)
78
73struct nsm_handle { 79struct nsm_handle {
74 struct list_head sm_link; 80 struct list_head sm_link;
75 atomic_t sm_count; 81 atomic_t sm_count;
76 char * sm_name; 82 char *sm_mon_name;
83 char *sm_name;
77 struct sockaddr_storage sm_addr; 84 struct sockaddr_storage sm_addr;
78 size_t sm_addrlen; 85 size_t sm_addrlen;
79 unsigned int sm_monitored : 1, 86 unsigned int sm_monitored : 1,
80 sm_sticky : 1; /* don't unmonitor */ 87 sm_sticky : 1; /* don't unmonitor */
81 char sm_addrbuf[48]; /* address eyecatcher */ 88 struct nsm_private sm_priv;
89 char sm_addrbuf[NSM_ADDRBUF];
82}; 90};
83 91
84/* 92/*
@@ -104,16 +112,6 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host)
104 return (struct sockaddr *)&host->h_srcaddr; 112 return (struct sockaddr *)&host->h_srcaddr;
105} 113}
106 114
107static inline struct sockaddr_in *nsm_addr_in(const struct nsm_handle *handle)
108{
109 return (struct sockaddr_in *)&handle->sm_addr;
110}
111
112static inline struct sockaddr *nsm_addr(const struct nsm_handle *handle)
113{
114 return (struct sockaddr *)&handle->sm_addr;
115}
116
117/* 115/*
118 * Map an fl_owner_t into a unique 32-bit "pid" 116 * Map an fl_owner_t into a unique 32-bit "pid"
119 */ 117 */
@@ -197,6 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
197extern int nlmsvc_grace_period; 195extern int nlmsvc_grace_period;
198extern unsigned long nlmsvc_timeout; 196extern unsigned long nlmsvc_timeout;
199extern int nsm_use_hostnames; 197extern int nsm_use_hostnames;
198extern int nsm_local_state;
200 199
201/* 200/*
202 * Lockd client functions 201 * Lockd client functions
@@ -231,10 +230,20 @@ void nlm_rebind_host(struct nlm_host *);
231struct nlm_host * nlm_get_host(struct nlm_host *); 230struct nlm_host * nlm_get_host(struct nlm_host *);
232void nlm_release_host(struct nlm_host *); 231void nlm_release_host(struct nlm_host *);
233void nlm_shutdown_hosts(void); 232void nlm_shutdown_hosts(void);
234extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, 233void nlm_host_rebooted(const struct nlm_reboot *);
235 unsigned int, u32);
236void nsm_release(struct nsm_handle *);
237 234
235/*
236 * Host monitoring
237 */
238int nsm_monitor(const struct nlm_host *host);
239void nsm_unmonitor(const struct nlm_host *host);
240
241struct nsm_handle *nsm_get_handle(const struct sockaddr *sap,
242 const size_t salen,
243 const char *hostname,
244 const size_t hostname_len);
245struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info);
246void nsm_release(struct nsm_handle *nsm);
238 247
239/* 248/*
240 * This is used in garbage collection and resource reclaim 249 * This is used in garbage collection and resource reclaim
@@ -282,16 +291,25 @@ static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
282static inline int __nlm_privileged_request4(const struct sockaddr *sap) 291static inline int __nlm_privileged_request4(const struct sockaddr *sap)
283{ 292{
284 const struct sockaddr_in *sin = (struct sockaddr_in *)sap; 293 const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
285 return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) && 294
286 (ntohs(sin->sin_port) < 1024); 295 if (ntohs(sin->sin_port) > 1023)
296 return 0;
297
298 return ipv4_is_loopback(sin->sin_addr.s_addr);
287} 299}
288 300
289#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 301#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
290static inline int __nlm_privileged_request6(const struct sockaddr *sap) 302static inline int __nlm_privileged_request6(const struct sockaddr *sap)
291{ 303{
292 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; 304 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
293 return (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK) && 305
294 (ntohs(sin6->sin6_port) < 1024); 306 if (ntohs(sin6->sin6_port) > 1023)
307 return 0;
308
309 if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_MAPPED)
310 return ipv4_is_loopback(sin6->sin6_addr.s6_addr32[3]);
311
312 return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK;
295} 313}
296#else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 314#else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
297static inline int __nlm_privileged_request6(const struct sockaddr *sap) 315static inline int __nlm_privileged_request6(const struct sockaddr *sap)
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
deleted file mode 100644
index 5a5448bdb17d..000000000000
--- a/include/linux/lockd/sm_inter.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * linux/include/linux/lockd/sm_inter.h
3 *
4 * Declarations for the kernel statd client.
5 *
6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef LINUX_LOCKD_SM_INTER_H
10#define LINUX_LOCKD_SM_INTER_H
11
12#define SM_PROGRAM 100024
13#define SM_VERSION 1
14#define SM_STAT 1
15#define SM_MON 2
16#define SM_UNMON 3
17#define SM_UNMON_ALL 4
18#define SM_SIMU_CRASH 5
19#define SM_NOTIFY 6
20
21#define SM_MAXSTRLEN 1024
22#define SM_PRIV_SIZE 16
23
24/*
25 * Arguments for all calls to statd
26 */
27struct nsm_args {
28 __be32 addr; /* remote address */
29 u32 prog; /* RPC callback info */
30 u32 vers;
31 u32 proc;
32
33 char * mon_name;
34};
35
36/*
37 * Result returned by statd
38 */
39struct nsm_res {
40 u32 status;
41 u32 state;
42};
43
44int nsm_monitor(struct nlm_host *);
45int nsm_unmonitor(struct nlm_host *);
46extern int nsm_local_state;
47
48#endif /* LINUX_LOCKD_SM_INTER_H */
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index d6b3a802c046..7dc5b6cb44cd 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -13,6 +13,13 @@
13#include <linux/nfs.h> 13#include <linux/nfs.h>
14#include <linux/sunrpc/xdr.h> 14#include <linux/sunrpc/xdr.h>
15 15
16#define SM_MAXSTRLEN 1024
17#define SM_PRIV_SIZE 16
18
19struct nsm_private {
20 unsigned char data[SM_PRIV_SIZE];
21};
22
16struct svc_rqst; 23struct svc_rqst;
17 24
18#define NLM_MAXCOOKIELEN 32 25#define NLM_MAXCOOKIELEN 32
@@ -77,10 +84,10 @@ struct nlm_res {
77 * statd callback when client has rebooted 84 * statd callback when client has rebooted
78 */ 85 */
79struct nlm_reboot { 86struct nlm_reboot {
80 char * mon; 87 char *mon;
81 unsigned int len; 88 unsigned int len;
82 u32 state; 89 u32 state;
83 __be32 addr; 90 struct nsm_private priv;
84}; 91};
85 92
86/* 93/*
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index ea0366769484..b912311a56b1 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -88,6 +88,8 @@
88#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0 88#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
89#define NFS4_ACE_MASK_ALL 0x001F01FF 89#define NFS4_ACE_MASK_ALL 0x001F01FF
90 90
91#define NFS4_MAX_UINT64 (~(u64)0)
92
91enum nfs4_acl_whotype { 93enum nfs4_acl_whotype {
92 NFS4_ACL_WHO_NAMED = 0, 94 NFS4_ACL_WHO_NAMED = 0,
93 NFS4_ACL_WHO_OWNER, 95 NFS4_ACL_WHO_OWNER,
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 21269405ffe2..e19f45991b2e 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -23,7 +23,6 @@
23/* 23/*
24 * nfsd version 24 * nfsd version
25 */ 25 */
26#define NFSD_VERSION "0.5"
27#define NFSD_SUPPORTED_MINOR_VERSION 0 26#define NFSD_SUPPORTED_MINOR_VERSION 0
28 27
29/* 28/*
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index d1941cb965e9..b2e093870bc6 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -68,6 +68,10 @@ struct nfs_fhbase_old {
68 * 1 - 4 byte user specified identifier 68 * 1 - 4 byte user specified identifier
69 * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED 69 * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
70 * 3 - 4 byte device id, encoded for user-space, 4 byte inode number 70 * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
71 * 4 - 4 byte inode number and 4 byte uuid
72 * 5 - 8 byte uuid
73 * 6 - 16 byte uuid
74 * 7 - 8 byte inode number and 16 byte uuid
71 * 75 *
72 * The fileid_type identified how the file within the filesystem is encoded. 76 * The fileid_type identified how the file within the filesystem is encoded.
73 * This is (will be) passed to, and set by, the underlying filesystem if it supports 77 * This is (will be) passed to, and set by, the underlying filesystem if it supports
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 3afe7fb403b2..3435d24bfe55 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -58,10 +58,13 @@ struct svc_serv {
58 struct svc_stat * sv_stats; /* RPC statistics */ 58 struct svc_stat * sv_stats; /* RPC statistics */
59 spinlock_t sv_lock; 59 spinlock_t sv_lock;
60 unsigned int sv_nrthreads; /* # of server threads */ 60 unsigned int sv_nrthreads; /* # of server threads */
61 unsigned int sv_maxconn; /* max connections allowed or
62 * '0' causing max to be based
63 * on number of threads. */
64
61 unsigned int sv_max_payload; /* datagram payload size */ 65 unsigned int sv_max_payload; /* datagram payload size */
62 unsigned int sv_max_mesg; /* max_payload + 1 page for overheads */ 66 unsigned int sv_max_mesg; /* max_payload + 1 page for overheads */
63 unsigned int sv_xdrsize; /* XDR buffer size */ 67 unsigned int sv_xdrsize; /* XDR buffer size */
64
65 struct list_head sv_permsocks; /* all permanent sockets */ 68 struct list_head sv_permsocks; /* all permanent sockets */
66 struct list_head sv_tempsocks; /* all temporary sockets */ 69 struct list_head sv_tempsocks; /* all temporary sockets */
67 int sv_tmpcnt; /* count of temporary sockets */ 70 int sv_tmpcnt; /* count of temporary sockets */