diff options
author | Tom Tucker <tom@opengridcomputing.com> | 2007-12-30 22:08:27 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:13 -0500 |
commit | 0f0257eaa5d29b80f6ab2c40ed21aa65bb4527f6 (patch) | |
tree | 542f64ec74fc045c06f5a1ffc0d48f823de12ccb /include/linux/sunrpc | |
parent | 18d19f949d5a9c927b2b88402630c5137971b619 (diff) |
svc: Move the xprt independent code to the svc_xprt.c file
This functionally trivial patch moves all of the transport independent
functions from the svcsock.c file to the transport independent svc_xprt.c
file.
In addition the following formatting changes were made:
- White space cleanup
- Function signatures on single line
- The inline directive was removed
- Lines over 80 columns were reformatted
- The term 'socket' was changed to 'transport' in comments
- The SMP comment was moved and updated.
Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Acked-by: Neil Brown <neilb@suse.de>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Greg Banks <gnb@sgi.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/svc_xprt.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 09de12b63c1d..405281e745d1 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -72,9 +72,14 @@ void svc_unreg_xprt_class(struct svc_xprt_class *); | |||
72 | void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, | 72 | void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, |
73 | struct svc_serv *); | 73 | struct svc_serv *); |
74 | int svc_create_xprt(struct svc_serv *, char *, unsigned short, int); | 74 | int svc_create_xprt(struct svc_serv *, char *, unsigned short, int); |
75 | void svc_xprt_enqueue(struct svc_xprt *xprt); | ||
75 | void svc_xprt_received(struct svc_xprt *); | 76 | void svc_xprt_received(struct svc_xprt *); |
76 | void svc_xprt_put(struct svc_xprt *xprt); | 77 | void svc_xprt_put(struct svc_xprt *xprt); |
77 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); | 78 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); |
79 | void svc_close_xprt(struct svc_xprt *xprt); | ||
80 | void svc_delete_xprt(struct svc_xprt *xprt); | ||
81 | int svc_port_is_privileged(struct sockaddr *sin); | ||
82 | |||
78 | static inline void svc_xprt_get(struct svc_xprt *xprt) | 83 | static inline void svc_xprt_get(struct svc_xprt *xprt) |
79 | { | 84 | { |
80 | kref_get(&xprt->xpt_ref); | 85 | kref_get(&xprt->xpt_ref); |
@@ -126,4 +131,26 @@ static inline unsigned short svc_xprt_remote_port(struct svc_xprt *xprt) | |||
126 | return svc_addr_port((struct sockaddr *)&xprt->xpt_remote); | 131 | return svc_addr_port((struct sockaddr *)&xprt->xpt_remote); |
127 | } | 132 | } |
128 | 133 | ||
134 | static inline char *__svc_print_addr(struct sockaddr *addr, | ||
135 | char *buf, size_t len) | ||
136 | { | ||
137 | switch (addr->sa_family) { | ||
138 | case AF_INET: | ||
139 | snprintf(buf, len, "%u.%u.%u.%u, port=%u", | ||
140 | NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), | ||
141 | ntohs(((struct sockaddr_in *) addr)->sin_port)); | ||
142 | break; | ||
143 | |||
144 | case AF_INET6: | ||
145 | snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", | ||
146 | NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), | ||
147 | ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); | ||
148 | break; | ||
149 | |||
150 | default: | ||
151 | snprintf(buf, len, "unknown address type: %d", addr->sa_family); | ||
152 | break; | ||
153 | } | ||
154 | return buf; | ||
155 | } | ||
129 | #endif /* SUNRPC_SVC_XPRT_H */ | 156 | #endif /* SUNRPC_SVC_XPRT_H */ |