aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-04-01 13:28:15 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-04-01 13:28:15 -0400
commitcc85906110e26fe8537c3bdbc08a74ae8110030b (patch)
tree891813098ede3dba4d5ff3b83b1f7b491367ad2f /include
parentc09bca786ff941ed17c5f381c4eca5b106808c51 (diff)
parentc69da774b28e01e062e0a3aba7509f2dcfd2a11a (diff)
Merge branch 'devel' into for-linus
Diffstat (limited to 'include')
-rw-r--r--include/linux/nfs_fs.h4
-rw-r--r--include/linux/nfs_fs_sb.h5
-rw-r--r--include/linux/nfs_xdr.h59
-rw-r--r--include/linux/sunrpc/svc.h9
-rw-r--r--include/linux/sunrpc/svc_xprt.h52
-rw-r--r--include/linux/sunrpc/xprt.h2
6 files changed, 89 insertions, 42 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8cc8807f77d6..bde2557c2a9c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -166,8 +166,7 @@ struct nfs_inode {
166 */ 166 */
167 struct radix_tree_root nfs_page_tree; 167 struct radix_tree_root nfs_page_tree;
168 168
169 unsigned long ncommit, 169 unsigned long npages;
170 npages;
171 170
172 /* Open contexts for shared mmap writes */ 171 /* Open contexts for shared mmap writes */
173 struct list_head open_files; 172 struct list_head open_files;
@@ -207,6 +206,7 @@ struct nfs_inode {
207#define NFS_INO_STALE (1) /* possible stale inode */ 206#define NFS_INO_STALE (1) /* possible stale inode */
208#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ 207#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */
209#define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */ 208#define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */
209#define NFS_INO_FLUSHING (4) /* inode is flushing out data */
210 210
211static inline struct nfs_inode *NFS_I(const struct inode *inode) 211static inline struct nfs_inode *NFS_I(const struct inode *inode)
212{ 212{
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 9bb81aec91cf..29b1e40dce99 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -106,6 +106,11 @@ struct nfs_server {
106 u32 attr_bitmask[2];/* V4 bitmask representing the set 106 u32 attr_bitmask[2];/* V4 bitmask representing the set
107 of attributes supported on this 107 of attributes supported on this
108 filesystem */ 108 filesystem */
109 u32 cache_consistency_bitmask[2];
110 /* V4 bitmask representing the subset
111 of change attribute, size, ctime
112 and mtime attributes supported by
113 the server */
109 u32 acl_bitmask; /* V4 bitmask representing the ACEs 114 u32 acl_bitmask; /* V4 bitmask representing the ACEs
110 that are supported on this 115 that are supported on this
111 filesystem */ 116 filesystem */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 43a713fce11c..b89c34e40bc2 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -27,12 +27,8 @@ static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid
27} 27}
28 28
29struct nfs_fattr { 29struct nfs_fattr {
30 unsigned short valid; /* which fields are valid */ 30 unsigned int valid; /* which fields are valid */
31 __u64 pre_size; /* pre_op_attr.size */ 31 umode_t mode;
32 struct timespec pre_mtime; /* pre_op_attr.mtime */
33 struct timespec pre_ctime; /* pre_op_attr.ctime */
34 enum nfs_ftype type; /* always use NFSv2 types */
35 __u32 mode;
36 __u32 nlink; 32 __u32 nlink;
37 __u32 uid; 33 __u32 uid;
38 __u32 gid; 34 __u32 gid;
@@ -52,19 +48,55 @@ struct nfs_fattr {
52 struct timespec atime; 48 struct timespec atime;
53 struct timespec mtime; 49 struct timespec mtime;
54 struct timespec ctime; 50 struct timespec ctime;
55 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
56 __u64 change_attr; /* NFSv4 change attribute */ 51 __u64 change_attr; /* NFSv4 change attribute */
57 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ 52 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
53 __u64 pre_size; /* pre_op_attr.size */
54 struct timespec pre_mtime; /* pre_op_attr.mtime */
55 struct timespec pre_ctime; /* pre_op_attr.ctime */
58 unsigned long time_start; 56 unsigned long time_start;
59 unsigned long gencount; 57 unsigned long gencount;
60}; 58};
61 59
62#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ 60#define NFS_ATTR_FATTR_TYPE (1U << 0)
63#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ 61#define NFS_ATTR_FATTR_MODE (1U << 1)
64#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ 62#define NFS_ATTR_FATTR_NLINK (1U << 2)
65#define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */ 63#define NFS_ATTR_FATTR_OWNER (1U << 3)
66#define NFS_ATTR_WCC_V4 0x0010 /* pre-op change attribute */ 64#define NFS_ATTR_FATTR_GROUP (1U << 4)
67#define NFS_ATTR_FATTR_V4_REFERRAL 0x0020 /* NFSv4 referral */ 65#define NFS_ATTR_FATTR_RDEV (1U << 5)
66#define NFS_ATTR_FATTR_SIZE (1U << 6)
67#define NFS_ATTR_FATTR_PRESIZE (1U << 7)
68#define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
69#define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
70#define NFS_ATTR_FATTR_FSID (1U << 10)
71#define NFS_ATTR_FATTR_FILEID (1U << 11)
72#define NFS_ATTR_FATTR_ATIME (1U << 12)
73#define NFS_ATTR_FATTR_MTIME (1U << 13)
74#define NFS_ATTR_FATTR_CTIME (1U << 14)
75#define NFS_ATTR_FATTR_PREMTIME (1U << 15)
76#define NFS_ATTR_FATTR_PRECTIME (1U << 16)
77#define NFS_ATTR_FATTR_CHANGE (1U << 17)
78#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
79#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
80
81#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
82 | NFS_ATTR_FATTR_MODE \
83 | NFS_ATTR_FATTR_NLINK \
84 | NFS_ATTR_FATTR_OWNER \
85 | NFS_ATTR_FATTR_GROUP \
86 | NFS_ATTR_FATTR_RDEV \
87 | NFS_ATTR_FATTR_SIZE \
88 | NFS_ATTR_FATTR_FSID \
89 | NFS_ATTR_FATTR_FILEID \
90 | NFS_ATTR_FATTR_ATIME \
91 | NFS_ATTR_FATTR_MTIME \
92 | NFS_ATTR_FATTR_CTIME)
93#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
94 | NFS_ATTR_FATTR_BLOCKS_USED)
95#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
96 | NFS_ATTR_FATTR_SPACE_USED)
97#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
98 | NFS_ATTR_FATTR_SPACE_USED \
99 | NFS_ATTR_FATTR_CHANGE)
68 100
69/* 101/*
70 * Info on the file system 102 * Info on the file system
@@ -836,6 +868,7 @@ struct nfs_rpc_ops {
836 int (*lock)(struct file *, int, struct file_lock *); 868 int (*lock)(struct file *, int, struct file_lock *);
837 int (*lock_check_bounds)(const struct file_lock *); 869 int (*lock_check_bounds)(const struct file_lock *);
838 void (*clear_acl_cache)(struct inode *); 870 void (*clear_acl_cache)(struct inode *);
871 void (*close_context)(struct nfs_open_context *ctx, int);
839}; 872};
840 873
841/* 874/*
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 3435d24bfe55..d3a4c0231933 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -69,7 +69,6 @@ struct svc_serv {
69 struct list_head sv_tempsocks; /* all temporary sockets */ 69 struct list_head sv_tempsocks; /* all temporary sockets */
70 int sv_tmpcnt; /* count of temporary sockets */ 70 int sv_tmpcnt; /* count of temporary sockets */
71 struct timer_list sv_temptimer; /* timer for aging temporary sockets */ 71 struct timer_list sv_temptimer; /* timer for aging temporary sockets */
72 sa_family_t sv_family; /* listener's address family */
73 72
74 char * sv_name; /* service name */ 73 char * sv_name; /* service name */
75 74
@@ -385,19 +384,19 @@ struct svc_procedure {
385/* 384/*
386 * Function prototypes. 385 * Function prototypes.
387 */ 386 */
388struct svc_serv *svc_create(struct svc_program *, unsigned int, sa_family_t, 387struct svc_serv *svc_create(struct svc_program *, unsigned int,
389 void (*shutdown)(struct svc_serv *)); 388 void (*shutdown)(struct svc_serv *));
390struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, 389struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
391 struct svc_pool *pool); 390 struct svc_pool *pool);
392void svc_exit_thread(struct svc_rqst *); 391void svc_exit_thread(struct svc_rqst *);
393struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, 392struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
394 sa_family_t, void (*shutdown)(struct svc_serv *), 393 void (*shutdown)(struct svc_serv *),
395 svc_thread_fn, struct module *); 394 svc_thread_fn, struct module *);
396int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 395int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
397void svc_destroy(struct svc_serv *); 396void svc_destroy(struct svc_serv *);
398int svc_process(struct svc_rqst *); 397int svc_process(struct svc_rqst *);
399int svc_register(const struct svc_serv *, const unsigned short, 398int svc_register(const struct svc_serv *, const int,
400 const unsigned short); 399 const unsigned short, const unsigned short);
401 400
402void svc_wake_up(struct svc_serv *); 401void svc_wake_up(struct svc_serv *);
403void svc_reserve(struct svc_rqst *rqstp, int space); 402void svc_reserve(struct svc_rqst *rqstp, int space);
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 0127daca4354..0d9cb6ef28b0 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -71,7 +71,8 @@ int svc_reg_xprt_class(struct svc_xprt_class *);
71void svc_unreg_xprt_class(struct svc_xprt_class *); 71void svc_unreg_xprt_class(struct svc_xprt_class *);
72void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, 72void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *,
73 struct svc_serv *); 73 struct svc_serv *);
74int svc_create_xprt(struct svc_serv *, char *, unsigned short, int); 74int svc_create_xprt(struct svc_serv *, const char *, const int,
75 const unsigned short, int);
75void svc_xprt_enqueue(struct svc_xprt *xprt); 76void svc_xprt_enqueue(struct svc_xprt *xprt);
76void svc_xprt_received(struct svc_xprt *); 77void svc_xprt_received(struct svc_xprt *);
77void svc_xprt_put(struct svc_xprt *xprt); 78void svc_xprt_put(struct svc_xprt *xprt);
@@ -80,7 +81,8 @@ void svc_close_xprt(struct svc_xprt *xprt);
80void svc_delete_xprt(struct svc_xprt *xprt); 81void svc_delete_xprt(struct svc_xprt *xprt);
81int svc_port_is_privileged(struct sockaddr *sin); 82int svc_port_is_privileged(struct sockaddr *sin);
82int svc_print_xprts(char *buf, int maxlen); 83int svc_print_xprts(char *buf, int maxlen);
83struct svc_xprt *svc_find_xprt(struct svc_serv *, char *, int, int); 84struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
85 const sa_family_t af, const unsigned short port);
84int svc_xprt_names(struct svc_serv *serv, char *buf, int buflen); 86int svc_xprt_names(struct svc_serv *serv, char *buf, int buflen);
85 87
86static inline void svc_xprt_get(struct svc_xprt *xprt) 88static inline void svc_xprt_get(struct svc_xprt *xprt)
@@ -88,29 +90,32 @@ static inline void svc_xprt_get(struct svc_xprt *xprt)
88 kref_get(&xprt->xpt_ref); 90 kref_get(&xprt->xpt_ref);
89} 91}
90static inline void svc_xprt_set_local(struct svc_xprt *xprt, 92static inline void svc_xprt_set_local(struct svc_xprt *xprt,
91 struct sockaddr *sa, int salen) 93 const struct sockaddr *sa,
94 const size_t salen)
92{ 95{
93 memcpy(&xprt->xpt_local, sa, salen); 96 memcpy(&xprt->xpt_local, sa, salen);
94 xprt->xpt_locallen = salen; 97 xprt->xpt_locallen = salen;
95} 98}
96static inline void svc_xprt_set_remote(struct svc_xprt *xprt, 99static inline void svc_xprt_set_remote(struct svc_xprt *xprt,
97 struct sockaddr *sa, int salen) 100 const struct sockaddr *sa,
101 const size_t salen)
98{ 102{
99 memcpy(&xprt->xpt_remote, sa, salen); 103 memcpy(&xprt->xpt_remote, sa, salen);
100 xprt->xpt_remotelen = salen; 104 xprt->xpt_remotelen = salen;
101} 105}
102static inline unsigned short svc_addr_port(struct sockaddr *sa) 106static inline unsigned short svc_addr_port(const struct sockaddr *sa)
103{ 107{
104 unsigned short ret = 0; 108 const struct sockaddr_in *sin = (const struct sockaddr_in *)sa;
109 const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa;
110
105 switch (sa->sa_family) { 111 switch (sa->sa_family) {
106 case AF_INET: 112 case AF_INET:
107 ret = ntohs(((struct sockaddr_in *)sa)->sin_port); 113 return ntohs(sin->sin_port);
108 break;
109 case AF_INET6: 114 case AF_INET6:
110 ret = ntohs(((struct sockaddr_in6 *)sa)->sin6_port); 115 return ntohs(sin6->sin6_port);
111 break;
112 } 116 }
113 return ret; 117
118 return 0;
114} 119}
115 120
116static inline size_t svc_addr_len(struct sockaddr *sa) 121static inline size_t svc_addr_len(struct sockaddr *sa)
@@ -124,36 +129,39 @@ static inline size_t svc_addr_len(struct sockaddr *sa)
124 return -EAFNOSUPPORT; 129 return -EAFNOSUPPORT;
125} 130}
126 131
127static inline unsigned short svc_xprt_local_port(struct svc_xprt *xprt) 132static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt)
128{ 133{
129 return svc_addr_port((struct sockaddr *)&xprt->xpt_local); 134 return svc_addr_port((const struct sockaddr *)&xprt->xpt_local);
130} 135}
131 136
132static inline unsigned short svc_xprt_remote_port(struct svc_xprt *xprt) 137static inline unsigned short svc_xprt_remote_port(const struct svc_xprt *xprt)
133{ 138{
134 return svc_addr_port((struct sockaddr *)&xprt->xpt_remote); 139 return svc_addr_port((const struct sockaddr *)&xprt->xpt_remote);
135} 140}
136 141
137static inline char *__svc_print_addr(struct sockaddr *addr, 142static inline char *__svc_print_addr(const struct sockaddr *addr,
138 char *buf, size_t len) 143 char *buf, const size_t len)
139{ 144{
145 const struct sockaddr_in *sin = (const struct sockaddr_in *)addr;
146 const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)addr;
147
140 switch (addr->sa_family) { 148 switch (addr->sa_family) {
141 case AF_INET: 149 case AF_INET:
142 snprintf(buf, len, "%pI4, port=%u", 150 snprintf(buf, len, "%pI4, port=%u", &sin->sin_addr,
143 &((struct sockaddr_in *)addr)->sin_addr, 151 ntohs(sin->sin_port));
144 ntohs(((struct sockaddr_in *) addr)->sin_port));
145 break; 152 break;
146 153
147 case AF_INET6: 154 case AF_INET6:
148 snprintf(buf, len, "%pI6, port=%u", 155 snprintf(buf, len, "%pI6, port=%u",
149 &((struct sockaddr_in6 *)addr)->sin6_addr, 156 &sin6->sin6_addr,
150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); 157 ntohs(sin6->sin6_port));
151 break; 158 break;
152 159
153 default: 160 default:
154 snprintf(buf, len, "unknown address type: %d", addr->sa_family); 161 snprintf(buf, len, "unknown address type: %d", addr->sa_family);
155 break; 162 break;
156 } 163 }
164
157 return buf; 165 return buf;
158} 166}
159#endif /* SUNRPC_SVC_XPRT_H */ 167#endif /* SUNRPC_SVC_XPRT_H */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 11fc71d50c1e..1758d9f5b5c3 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -235,6 +235,7 @@ static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *
235 */ 235 */
236int xprt_register_transport(struct xprt_class *type); 236int xprt_register_transport(struct xprt_class *type);
237int xprt_unregister_transport(struct xprt_class *type); 237int xprt_unregister_transport(struct xprt_class *type);
238int xprt_load_transport(const char *);
238void xprt_set_retrans_timeout_def(struct rpc_task *task); 239void xprt_set_retrans_timeout_def(struct rpc_task *task);
239void xprt_set_retrans_timeout_rtt(struct rpc_task *task); 240void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
240void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); 241void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
@@ -259,6 +260,7 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie);
259#define XPRT_BOUND (4) 260#define XPRT_BOUND (4)
260#define XPRT_BINDING (5) 261#define XPRT_BINDING (5)
261#define XPRT_CLOSING (6) 262#define XPRT_CLOSING (6)
263#define XPRT_CONNECTION_ABORT (7)
262 264
263static inline void xprt_set_connected(struct rpc_xprt *xprt) 265static inline void xprt_set_connected(struct rpc_xprt *xprt)
264{ 266{